1 .\" Copyright (c) 1991, 1992, 1993, 1995, 1998, 1999 Free Software Foundation
2 .\" See section COPYING for conditions for redistribution
3 .TH ar 1 "1999" "Cygnus Solutions" "GNU Development Tools"
11 ar \- create, modify, and extract from archives.
16 .BR ar " [\|" "-" "\|]"\c
17 .I {dmpqrtx}[abcfilNoPsSuvV] \c
34 \& program creates, modifies, and extracts from
37 \& is a single file holding a collection of
38 other files in a structure that makes it possible to retrieve
39 the original individual files (called \c
43 The original files' contents, mode (permissions), timestamp, owner, and
44 group are preserved in the archive, and may be reconstituted on
49 \& can maintain archives whose members have names of any
50 length; however, depending on how \c
52 \& is configured on your
53 system, a limit on member-name length may be imposed (for compatibility
54 with archive formats maintained with other tools). If it exists, the
55 limit is often 15 characters (typical of formats related to a.out) or 16
56 characters (typical of formats related to coff).
60 \& is considered a binary utility because archives of this sort
61 are most often used as \c
63 \& holding commonly needed
68 \& will create an index to the symbols defined in relocatable
69 object modules in the archive when you specify the modifier `\|\c
72 Once created, this index is updated in the archive whenever \c
75 makes a change to its contents (save for the `\|\c
77 \|' update operation).
78 An archive with such an index speeds up linking to the library, and
79 allows routines in the library to call each other without regard to
80 their placement in the archive.
85 .B nm \-\-print\-armap\c
86 \|' to list this index
87 table. If an archive lacks the table, another form of \c
92 \& can be used to add just the table.
96 \& insists on at least two arguments to execute: one
97 keyletter specifying the \c
99 \& (optionally accompanied by other
100 keyletters specifying \c
102 \&), and the archive name to act on.
104 Most operations can also accept further \c
107 specifying particular files to operate on.
112 \& allows you to mix the operation code \c
117 \& in any order, within the first command-line argument.
119 If you wish, you may begin the first command-line argument with a
124 \& keyletter specifies what operation to execute; it may be
125 any of the following, but you must specify only one of them:
131 \& modules from the archive. Specify the names of modules to
134 \&; the archive is untouched if you
135 specify no files to delete.
137 If you specify the `\|\c
141 \& will list each module
146 Use this operation to \c
148 \& members in an archive.
150 The ordering of members in an archive can make a difference in how
151 programs are linked using the library, if a symbol is defined in more
154 If no modifiers are used with \c
156 \&, any members you name in the
159 \& arguments are moved to the \c
162 you can use the `\|\c
168 \|' modifiers to move them to a
169 specified place instead.
175 \& the specified members of the archive, to the standard
176 output file. If the `\|\c
178 \|' modifier is specified, show the member
179 name before copying its contents to standard output.
183 \&, all the files in the archive are printed.
194 without checking for replacement.
205 operation; new members are always placed at the end of the archive.
211 \& list each file as it is appended.
213 Since the point of this operation is speed, the archive's symbol table
214 index is not updated, even if it already existed; you can use `\|\c
219 \& explicitly to update the symbol table index.
221 However, too many different systems assume quick append rebuilds the
226 \|' as a synonym for `\|\c
239 operation differs from `\|\c
241 \|' in that any previously existing members
242 are deleted if their names match those being added.
244 If one of the files named in \c
249 displays an error message, and leaves undisturbed any existing members
250 of the archive matching that name.
252 By default, new members are added at the end of the file; but you may
253 use one of the modifiers `\|\c
260 placement relative to some existing member.
264 \|' used with this operation elicits a line of
265 output for each file inserted, along with one of the letters `\|\c
270 \|' to indicate whether the file was appended (no old member
271 deleted) or replaced.
277 \& listing the contents of \c
280 of the files listed in \c
282 \& that are present in the
283 archive. Normally only the member name is shown; if you also want to
284 see the modes (permissions), timestamp, owner, group, and size, you can
285 request that by also specifying the `\|\c
289 If you do not specify any \c
291 \&, all files in the archive
294 If there is more than one file with the same name (say, `\|\c
297 an archive (say `\|\c
301 \|' will list only the
302 first instance; to see them all, you must ask for a complete
303 listing\(em\&in our example, `\|\c
313 \&) from the archive. You can
316 \|' modifier with this operation, to request that
319 \& list each name as it extracts it.
321 If you do not specify any \c
323 \&, all files in the archive
328 A number of modifiers (\c
330 \&) may immediately follow the \c
333 keyletter, to specify variations on an operation's behavior:
339 \& an existing member of the
340 archive. If you use the modifier \c
342 \&, the name of an existing archive
343 member must be present as the \c
345 \& argument, before the
354 \& an existing member of the
355 archive. If you use the modifier \c
357 \&, the name of an existing archive
358 member must be present as the \c
360 \& argument, before the
363 \& specification. (same as `\|\c
371 \& the archive. The specified \c
374 created if it didn't exist, when you request an update. But a warning is
375 issued unless you specify in advance that you expect to create it, by
380 Truncate names in the archive.
382 will normally permit file names of any length. This will cause it to
383 create archives which are not compatible with the native
385 program on some systems. If this is a concern, the
387 modifier may be used to truncate file names when putting them in the
394 \& an existing member of the
395 archive. If you use the modifier \c
397 \&, the name of an existing archive
398 member must be present as the \c
400 \& argument, before the
403 \& specification. (same as `\|\c
409 This modifier is accepted but not used.
415 parameter. This is used if there are multiple entries in the archive
416 with the same name. Extract or delete instance
418 of the given name from the archive.
424 \& dates of members when extracting them. If
425 you do not specify this modifier, files extracted from the archive
426 will be stamped with the time of extraction.
430 Use the full path name when matching names in the archive.
432 can not create an archive with a full path name (such archives are not
433 POSIX complaint), but other archive creators can. This option will
436 to match file names using a complete path name, which can be
437 convenient when extracting a single file from an archive created by
442 Write an object-file index into the archive, or update an existing one,
443 even if no other change is made to the archive. You may use this modifier
444 flag either with any operation, or alone. Running `\|\c
447 archive is equivalent to running `\|\c
453 Do not generate an archive symbol table. This can speed up building a
454 large library in several steps. The resulting archive can not be used
455 with the linker. In order to build a symbol table, you must omit the
458 \|' modifier on the last execution of `\|\c
460 \|', or you must run `\|\c
468 \&.\|.\|. inserts all files
469 listed into the archive. If you would like to insert \c
472 of the files you list that are newer than existing members of the same
473 names, use this modifier. The `\|\c
475 \|' modifier is allowed only for the
478 \|' (replace). In particular, the combination `\|\c
481 not allowed, since checking the timestamps would lose any speed
482 advantage from the operation `\|\c
488 This modifier requests the \c
490 \& version of an operation. Many
491 operations display additional information, such as filenames processed,
492 when the modifier `\|\c
498 This modifier shows the version number of
504 .RB "`\|" binutils "\|'"
510 The GNU Binary Utilities\c
511 , Roland H. Pesch (October 1991).
518 Copyright (c) 1991, 1992, 1993, 1995, 1998, 1999 Free Software Foundation, Inc.
520 Permission is granted to make and distribute verbatim copies of
521 this manual provided the copyright notice and this permission notice
522 are preserved on all copies.
524 Permission is granted to copy and distribute modified versions of this
525 manual under the conditions for verbatim copying, provided that the
526 entire resulting derived work is distributed under the terms of a
527 permission notice identical to this one.
529 Permission is granted to copy and distribute translations of this
530 manual into another language, under the above conditions for modified
531 versions, except that this permission notice may be included in
532 translations approved by the Free Software Foundation instead of in
533 the original English.