Merge branch 'vendor/EE'
[dragonfly.git] / contrib / binutils-2.24 / binutils / doc / ar.1
1 .\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14)
2 .\"
3 .\" Standard preamble:
4 .\" ========================================================================
5 .de Sp \" Vertical space (when we can't use .PP)
6 .if t .sp .5v
7 .if n .sp
8 ..
9 .de Vb \" Begin verbatim text
10 .ft CW
11 .nf
12 .ne \\$1
13 ..
14 .de Ve \" End verbatim text
15 .ft R
16 .fi
17 ..
18 .\" Set up some character translations and predefined strings.  \*(-- will
19 .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
20 .\" double quote, and \*(R" will give a right double quote.  \*(C+ will
21 .\" give a nicer C++.  Capital omega is used to do unbreakable dashes and
22 .\" therefore won't be available.  \*(C` and \*(C' expand to `' in nroff,
23 .\" nothing in troff, for use with C<>.
24 .tr \(*W-
25 .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
26 .ie n \{\
27 .    ds -- \(*W-
28 .    ds PI pi
29 .    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
30 .    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
31 .    ds L" ""
32 .    ds R" ""
33 .    ds C` ""
34 .    ds C' ""
35 'br\}
36 .el\{\
37 .    ds -- \|\(em\|
38 .    ds PI \(*p
39 .    ds L" ``
40 .    ds R" ''
41 'br\}
42 .\"
43 .\" Escape single quotes in literal strings from groff's Unicode transform.
44 .ie \n(.g .ds Aq \(aq
45 .el       .ds Aq '
46 .\"
47 .\" If the F register is turned on, we'll generate index entries on stderr for
48 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
49 .\" entries marked with X<> in POD.  Of course, you'll have to process the
50 .\" output yourself in some meaningful fashion.
51 .ie \nF \{\
52 .    de IX
53 .    tm Index:\\$1\t\\n%\t"\\$2"
54 ..
55 .    nr % 0
56 .    rr F
57 .\}
58 .el \{\
59 .    de IX
60 ..
61 .\}
62 .\"
63 .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
64 .\" Fear.  Run.  Save yourself.  No user-serviceable parts.
65 .    \" fudge factors for nroff and troff
66 .if n \{\
67 .    ds #H 0
68 .    ds #V .8m
69 .    ds #F .3m
70 .    ds #[ \f1
71 .    ds #] \fP
72 .\}
73 .if t \{\
74 .    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
75 .    ds #V .6m
76 .    ds #F 0
77 .    ds #[ \&
78 .    ds #] \&
79 .\}
80 .    \" simple accents for nroff and troff
81 .if n \{\
82 .    ds ' \&
83 .    ds ` \&
84 .    ds ^ \&
85 .    ds , \&
86 .    ds ~ ~
87 .    ds /
88 .\}
89 .if t \{\
90 .    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
91 .    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
92 .    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
93 .    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
94 .    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
95 .    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
96 .\}
97 .    \" troff and (daisy-wheel) nroff accents
98 .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
99 .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
100 .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
101 .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
102 .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
103 .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
104 .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
105 .ds ae a\h'-(\w'a'u*4/10)'e
106 .ds Ae A\h'-(\w'A'u*4/10)'E
107 .    \" corrections for vroff
108 .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
109 .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
110 .    \" for low resolution devices (crt and lpr)
111 .if \n(.H>23 .if \n(.V>19 \
112 \{\
113 .    ds : e
114 .    ds 8 ss
115 .    ds o a
116 .    ds d- d\h'-1'\(ga
117 .    ds D- D\h'-1'\(hy
118 .    ds th \o'bp'
119 .    ds Th \o'LP'
120 .    ds ae ae
121 .    ds Ae AE
122 .\}
123 .rm #[ #] #H #V #F C
124 .\" ========================================================================
125 .\"
126 .IX Title "AR 1"
127 .TH AR 1 "2013-11-18" "binutils-2.23.91" "GNU Development Tools"
128 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
129 .\" way too many mistakes in technical documents.
130 .if n .ad l
131 .nh
132 .SH "NAME"
133 ar \- create, modify, and extract from archives
134 .SH "SYNOPSIS"
135 .IX Header "SYNOPSIS"
136 ar [\fB\-\-plugin\fR \fIname\fR] [\fB\-X32_64\fR] [\fB\-\fR]\fIp\fR[\fImod\fR [\fIrelpos\fR] [\fIcount\fR]] [\fB\-\-target\fR \fIbfdname\fR] \fIarchive\fR [\fImember\fR...]
137 .SH "DESCRIPTION"
138 .IX Header "DESCRIPTION"
139 The \s-1GNU\s0 \fBar\fR program creates, modifies, and extracts from
140 archives.  An \fIarchive\fR is a single file holding a collection of
141 other files in a structure that makes it possible to retrieve
142 the original individual files (called \fImembers\fR of the archive).
143 .PP
144 The original files' contents, mode (permissions), timestamp, owner, and
145 group are preserved in the archive, and can be restored on
146 extraction.
147 .PP
148 \&\s-1GNU\s0 \fBar\fR can maintain archives whose members have names of any
149 length; however, depending on how \fBar\fR is configured on your
150 system, a limit on member-name length may be imposed for compatibility
151 with archive formats maintained with other tools.  If it exists, the
152 limit is often 15 characters (typical of formats related to a.out) or 16
153 characters (typical of formats related to coff).
154 .PP
155 \&\fBar\fR is considered a binary utility because archives of this sort
156 are most often used as \fIlibraries\fR holding commonly needed
157 subroutines.
158 .PP
159 \&\fBar\fR creates an index to the symbols defined in relocatable
160 object modules in the archive when you specify the modifier \fBs\fR.
161 Once created, this index is updated in the archive whenever \fBar\fR
162 makes a change to its contents (save for the \fBq\fR update operation).
163 An archive with such an index speeds up linking to the library, and
164 allows routines in the library to call each other without regard to
165 their placement in the archive.
166 .PP
167 You may use \fBnm \-s\fR or \fBnm \-\-print\-armap\fR to list this index
168 table.  If an archive lacks the table, another form of \fBar\fR called
169 \&\fBranlib\fR can be used to add just the table.
170 .PP
171 \&\s-1GNU\s0 \fBar\fR can optionally create a \fIthin\fR archive,
172 which contains a symbol index and references to the original copies
173 of the member files of the archive.  This is useful for building
174 libraries for use within a local build tree, where the relocatable
175 objects are expected to remain available, and copying the contents of
176 each object would only waste time and space.
177 .PP
178 An archive can either be \fIthin\fR or it can be normal.  It cannot
179 be both at the same time.  Once an archive is created its format
180 cannot be changed without first deleting it and then creating a new
181 archive in its place.
182 .PP
183 Thin archives are also \fIflattened\fR, so that adding one thin
184 archive to another thin archive does not nest it, as would happen with
185 a normal archive.  Instead the elements of the first archive are added
186 individually to the second archive.
187 .PP
188 The paths to the elements of the archive are stored relative to the
189 archive itself.
190 .PP
191 \&\s-1GNU\s0 \fBar\fR is designed to be compatible with two different
192 facilities.  You can control its activity using command-line options,
193 like the different varieties of \fBar\fR on Unix systems; or, if you
194 specify the single command-line option \fB\-M\fR, you can control it
195 with a script supplied via standard input, like the \s-1MRI\s0 \*(L"librarian\*(R"
196 program.
197 .SH "OPTIONS"
198 .IX Header "OPTIONS"
199 \&\s-1GNU\s0 \fBar\fR allows you to mix the operation code \fIp\fR and modifier
200 flags \fImod\fR in any order, within the first command-line argument.
201 .PP
202 If you wish, you may begin the first command-line argument with a
203 dash.
204 .PP
205 The \fIp\fR keyletter specifies what operation to execute; it may be
206 any of the following, but you must specify only one of them:
207 .IP "\fBd\fR" 4
208 .IX Item "d"
209 \&\fIDelete\fR modules from the archive.  Specify the names of modules to
210 be deleted as \fImember\fR...; the archive is untouched if you
211 specify no files to delete.
212 .Sp
213 If you specify the \fBv\fR modifier, \fBar\fR lists each module
214 as it is deleted.
215 .IP "\fBm\fR" 4
216 .IX Item "m"
217 Use this operation to \fImove\fR members in an archive.
218 .Sp
219 The ordering of members in an archive can make a difference in how
220 programs are linked using the library, if a symbol is defined in more
221 than one member.
222 .Sp
223 If no modifiers are used with \f(CW\*(C`m\*(C'\fR, any members you name in the
224 \&\fImember\fR arguments are moved to the \fIend\fR of the archive;
225 you can use the \fBa\fR, \fBb\fR, or \fBi\fR modifiers to move them to a
226 specified place instead.
227 .IP "\fBp\fR" 4
228 .IX Item "p"
229 \&\fIPrint\fR the specified members of the archive, to the standard
230 output file.  If the \fBv\fR modifier is specified, show the member
231 name before copying its contents to standard output.
232 .Sp
233 If you specify no \fImember\fR arguments, all the files in the archive are
234 printed.
235 .IP "\fBq\fR" 4
236 .IX Item "q"
237 \&\fIQuick append\fR; Historically, add the files \fImember\fR... to the end of
238 \&\fIarchive\fR, without checking for replacement.
239 .Sp
240 The modifiers \fBa\fR, \fBb\fR, and \fBi\fR do \fInot\fR affect this
241 operation; new members are always placed at the end of the archive.
242 .Sp
243 The modifier \fBv\fR makes \fBar\fR list each file as it is appended.
244 .Sp
245 Since the point of this operation is speed, implementations of
246 \&\fBar\fR have the option of not updating the archive's symbol
247 table if one exists.  Too many different systems however assume that
248 symbol tables are always up-to-date, so \s-1GNU\s0 \fBar\fR will
249 rebuild the table even with a quick append.
250 .Sp
251 Note \- \s-1GNU\s0 \fBar\fR treats the command \fBqs\fR as a
252 synonym for \fBr\fR \- replacing already existing files in the
253 archive and appending new ones at the end.
254 .IP "\fBr\fR" 4
255 .IX Item "r"
256 Insert the files \fImember\fR... into \fIarchive\fR (with
257 \&\fIreplacement\fR). This operation differs from \fBq\fR in that any
258 previously existing members are deleted if their names match those being
259 added.
260 .Sp
261 If one of the files named in \fImember\fR... does not exist, \fBar\fR
262 displays an error message, and leaves undisturbed any existing members
263 of the archive matching that name.
264 .Sp
265 By default, new members are added at the end of the file; but you may
266 use one of the modifiers \fBa\fR, \fBb\fR, or \fBi\fR to request
267 placement relative to some existing member.
268 .Sp
269 The modifier \fBv\fR used with this operation elicits a line of
270 output for each file inserted, along with one of the letters \fBa\fR or
271 \&\fBr\fR to indicate whether the file was appended (no old member
272 deleted) or replaced.
273 .IP "\fBs\fR" 4
274 .IX Item "s"
275 Add an index to the archive, or update it if it already exists.  Note
276 this command is an exception to the rule that there can only be one
277 command letter, as it is possible to use it as either a command or a
278 modifier.  In either case it does the same thing.
279 .IP "\fBt\fR" 4
280 .IX Item "t"
281 Display a \fItable\fR listing the contents of \fIarchive\fR, or those
282 of the files listed in \fImember\fR... 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 \fBv\fR modifier.
286 .Sp
287 If you do not specify a \fImember\fR, all files in the archive
288 are listed.
289 .Sp
290 If there is more than one file with the same name (say, \fBfie\fR) in
291 an archive (say \fBb.a\fR), \fBar t b.a fie\fR lists only the
292 first instance; to see them all, you must ask for a complete
293 listing\-\-\-in our example, \fBar t b.a\fR.
294 .IP "\fBx\fR" 4
295 .IX Item "x"
296 \&\fIExtract\fR members (named \fImember\fR) from the archive.  You can
297 use the \fBv\fR modifier with this operation, to request that
298 \&\fBar\fR list each name as it extracts it.
299 .Sp
300 If you do not specify a \fImember\fR, all files in the archive
301 are extracted.
302 .Sp
303 Files cannot be extracted from a thin archive.
304 .IP "\fB\-\-help\fR" 4
305 .IX Item "--help"
306 Displays the list of command line options supported by \fBar\fR
307 and then exits.
308 .IP "\fB\-\-version\fR" 4
309 .IX Item "--version"
310 Displays the version information of \fBar\fR and then exits.
311 .PP
312 A number of modifiers (\fImod\fR) may immediately follow the \fIp\fR
313 keyletter, to specify variations on an operation's behavior:
314 .IP "\fBa\fR" 4
315 .IX Item "a"
316 Add new files \fIafter\fR an existing member of the
317 archive.  If you use the modifier \fBa\fR, the name of an existing archive
318 member must be present as the \fIrelpos\fR argument, before the
319 \&\fIarchive\fR specification.
320 .IP "\fBb\fR" 4
321 .IX Item "b"
322 Add new files \fIbefore\fR an existing member of the
323 archive.  If you use the modifier \fBb\fR, the name of an existing archive
324 member must be present as the \fIrelpos\fR argument, before the
325 \&\fIarchive\fR specification.  (same as \fBi\fR).
326 .IP "\fBc\fR" 4
327 .IX Item "c"
328 \&\fICreate\fR the archive.  The specified \fIarchive\fR is always
329 created if it did not exist, when you request an update.  But a warning is
330 issued unless you specify in advance that you expect to create it, by
331 using this modifier.
332 .IP "\fBD\fR" 4
333 .IX Item "D"
334 Operate in \fIdeterministic\fR mode.  When adding files and the archive
335 index use zero for UIDs, GIDs, timestamps, and use consistent file modes
336 for all files.  When this option is used, if \fBar\fR is used with
337 identical options and identical input files, multiple runs will create
338 identical output files regardless of the input files' owners, groups,
339 file modes, or modification times.
340 .Sp
341 If \fIbinutils\fR was configured with
342 \&\fB\-\-enable\-deterministic\-archives\fR, then this mode is on by default.
343 It can be disabled with the \fBU\fR modifier, below.
344 .IP "\fBf\fR" 4
345 .IX Item "f"
346 Truncate names in the archive.  \s-1GNU\s0 \fBar\fR will normally permit file
347 names of any length.  This will cause it to create archives which are
348 not compatible with the native \fBar\fR program on some systems.  If
349 this is a concern, the \fBf\fR modifier may be used to truncate file
350 names when putting them in the archive.
351 .IP "\fBi\fR" 4
352 .IX Item "i"
353 Insert new files \fIbefore\fR an existing member of the
354 archive.  If you use the modifier \fBi\fR, the name of an existing archive
355 member must be present as the \fIrelpos\fR argument, before the
356 \&\fIarchive\fR specification.  (same as \fBb\fR).
357 .IP "\fBl\fR" 4
358 .IX Item "l"
359 This modifier is accepted but not used.
360 .IP "\fBN\fR" 4
361 .IX Item "N"
362 Uses the \fIcount\fR parameter.  This is used if there are multiple
363 entries in the archive with the same name.  Extract or delete instance
364 \&\fIcount\fR of the given name from the archive.
365 .IP "\fBo\fR" 4
366 .IX Item "o"
367 Preserve the \fIoriginal\fR dates of members when extracting them.  If
368 you do not specify this modifier, files extracted from the archive
369 are stamped with the time of extraction.
370 .IP "\fBP\fR" 4
371 .IX Item "P"
372 Use the full path name when matching names in the archive.  \s-1GNU\s0
373 \&\fBar\fR can not create an archive with a full path name (such archives
374 are not \s-1POSIX\s0 complaint), but other archive creators can.  This option
375 will cause \s-1GNU\s0 \fBar\fR to match file names using a complete path
376 name, which can be convenient when extracting a single file from an
377 archive created by another tool.
378 .IP "\fBs\fR" 4
379 .IX Item "s"
380 Write an object-file index into the archive, or update an existing one,
381 even if no other change is made to the archive.  You may use this modifier
382 flag either with any operation, or alone.  Running \fBar s\fR on an
383 archive is equivalent to running \fBranlib\fR on it.
384 .IP "\fBS\fR" 4
385 .IX Item "S"
386 Do not generate an archive symbol table.  This can speed up building a
387 large library in several steps.  The resulting archive can not be used
388 with the linker.  In order to build a symbol table, you must omit the
389 \&\fBS\fR modifier on the last execution of \fBar\fR, or you must run
390 \&\fBranlib\fR on the archive.
391 .IP "\fBT\fR" 4
392 .IX Item "T"
393 Make the specified \fIarchive\fR a \fIthin\fR archive.  If it already
394 exists and is a regular archive, the existing members must be present
395 in the same directory as \fIarchive\fR.
396 .IP "\fBu\fR" 4
397 .IX Item "u"
398 Normally, \fBar r\fR... inserts all files
399 listed into the archive.  If you would like to insert \fIonly\fR those
400 of the files you list that are newer than existing members of the same
401 names, use this modifier.  The \fBu\fR modifier is allowed only for the
402 operation \fBr\fR (replace).  In particular, the combination \fBqu\fR is
403 not allowed, since checking the timestamps would lose any speed
404 advantage from the operation \fBq\fR.
405 .IP "\fBU\fR" 4
406 .IX Item "U"
407 Do \fInot\fR operate in \fIdeterministic\fR mode.  This is the inverse
408 of the \fBD\fR modifier, above: added files and the archive index will
409 get their actual \s-1UID\s0, \s-1GID\s0, timestamp, and file mode values.
410 .Sp
411 This is the default unless \fIbinutils\fR was configured with
412 \&\fB\-\-enable\-deterministic\-archives\fR.
413 .IP "\fBv\fR" 4
414 .IX Item "v"
415 This modifier requests the \fIverbose\fR version of an operation.  Many
416 operations display additional information, such as filenames processed,
417 when the modifier \fBv\fR is appended.
418 .IP "\fBV\fR" 4
419 .IX Item "V"
420 This modifier shows the version number of \fBar\fR.
421 .PP
422 \&\fBar\fR ignores an initial option spelt \fB\-X32_64\fR, for
423 compatibility with \s-1AIX\s0.  The behaviour produced by this option is the
424 default for \s-1GNU\s0 \fBar\fR.  \fBar\fR does not support any of the other
425 \&\fB\-X\fR options; in particular, it does not support \fB\-X32\fR
426 which is the default for \s-1AIX\s0 \fBar\fR.
427 .PP
428 The optional command line switch \fB\-\-plugin\fR \fIname\fR causes
429 \&\fBar\fR to load the plugin called \fIname\fR which adds support
430 for more file formats.  This option is only available if the toolchain
431 has been built with plugin support enabled.
432 .PP
433 The optional command line switch \fB\-\-target\fR \fIbfdname\fR
434 specifies that the archive members are in an object code format
435 different from your system's default format.  See
436 .IP "\fB@\fR\fIfile\fR" 4
437 .IX Item "@file"
438 Read command-line options from \fIfile\fR.  The options read are
439 inserted in place of the original @\fIfile\fR option.  If \fIfile\fR
440 does not exist, or cannot be read, then the option will be treated
441 literally, and not removed.
442 .Sp
443 Options in \fIfile\fR are separated by whitespace.  A whitespace
444 character may be included in an option by surrounding the entire
445 option in either single or double quotes.  Any character (including a
446 backslash) may be included by prefixing the character to be included
447 with a backslash.  The \fIfile\fR may itself contain additional
448 @\fIfile\fR options; any such options will be processed recursively.
449 .SH "SEE ALSO"
450 .IX Header "SEE ALSO"
451 \&\fInm\fR\|(1), \fIranlib\fR\|(1), and the Info entries for \fIbinutils\fR.
452 .SH "COPYRIGHT"
453 .IX Header "COPYRIGHT"
454 Copyright (c) 1991\-2013 Free Software Foundation, Inc.
455 .PP
456 Permission is granted to copy, distribute and/or modify this document
457 under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.3
458 or any later version published by the Free Software Foundation;
459 with no Invariant Sections, with no Front-Cover Texts, and with no
460 Back-Cover Texts.  A copy of the license is included in the
461 section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R".