old-cross-binutils/binutils/ar.1
2001-03-25 20:32:31 +00:00

469 lines
15 KiB
Groff

.rn '' }`
''' $RCSfile$$Revision$$Date$
'''
''' $Log$
''' Revision 1.7 2001/03/25 20:32:25 nickc
''' Automate generate on man pages
'''
'''
.de Sh
.br
.if t .Sp
.ne 5
.PP
\fB\\$1\fR
.PP
..
.de Sp
.if t .sp .5v
.if n .sp
..
.de Ip
.br
.ie \\n(.$>=3 .ne \\$3
.el .ne 3
.IP "\\$1" \\$2
..
.de Vb
.ft CW
.nf
.ne \\$1
..
.de Ve
.ft R
.fi
..
'''
'''
''' Set up \*(-- to give an unbreakable dash;
''' string Tr holds user defined translation string.
''' Bell System Logo is used as a dummy character.
'''
.tr \(*W-|\(bv\*(Tr
.ie n \{\
.ds -- \(*W-
.ds PI pi
.if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
.if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
.ds L" ""
.ds R" ""
''' \*(M", \*(S", \*(N" and \*(T" are the equivalent of
''' \*(L" and \*(R", except that they are used on ".xx" lines,
''' such as .IP and .SH, which do another additional levels of
''' double-quote interpretation
.ds M" """
.ds S" """
.ds N" """""
.ds T" """""
.ds L' '
.ds R' '
.ds M' '
.ds S' '
.ds N' '
.ds T' '
'br\}
.el\{\
.ds -- \(em\|
.tr \*(Tr
.ds L" ``
.ds R" ''
.ds M" ``
.ds S" ''
.ds N" ``
.ds T" ''
.ds L' `
.ds R' '
.ds M' `
.ds S' '
.ds N' `
.ds T' '
.ds PI \(*p
'br\}
.\" If the F register is turned on, we'll generate
.\" index entries out stderr for the following things:
.\" TH Title
.\" SH Header
.\" Sh Subsection
.\" Ip Item
.\" X<> Xref (embedded
.\" Of course, you have to process the output yourself
.\" in some meaninful fashion.
.if \nF \{
.de IX
.tm Index:\\$1\t\\n%\t"\\$2"
..
.nr % 0
.rr F
.\}
.TH AR.1 1 "binutils-2.11.90" "23/Mar/101" "GNU"
.UC
.if n .hy 0
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.de CQ \" put $1 in typewriter font
.ft CW
'if n "\c
'if t \\&\\$1\c
'if n \\&\\$1\c
'if n \&"
\\&\\$2 \\$3 \\$4 \\$5 \\$6 \\$7
'.ft R
..
.\" @(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2
. \" AM - accent mark definitions
.bd B 3
. \" fudge factors for nroff and troff
.if n \{\
. ds #H 0
. ds #V .8m
. ds #F .3m
. ds #[ \f1
. ds #] \fP
.\}
.if t \{\
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
. ds #V .6m
. ds #F 0
. ds #[ \&
. ds #] \&
.\}
. \" simple accents for nroff and troff
.if n \{\
. ds ' \&
. ds ` \&
. ds ^ \&
. ds , \&
. ds ~ ~
. ds ? ?
. ds ! !
. ds /
. ds q
.\}
.if t \{\
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
. ds ? \s-2c\h'-\w'c'u*7/10'\u\h'\*(#H'\zi\d\s+2\h'\w'c'u*8/10'
. ds ! \s-2\(or\s+2\h'-\w'\(or'u'\v'-.8m'.\v'.8m'
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
. ds q o\h'-\w'o'u*8/10'\s-4\v'.4m'\z\(*i\v'-.4m'\s+4\h'\w'o'u*8/10'
.\}
. \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds v \\k:\h'-(\\n(.wu*9/10-\*(#H)'\v'-\*(#V'\*(#[\s-4v\s0\v'\*(#V'\h'|\\n:u'\*(#]
.ds _ \\k:\h'-(\\n(.wu*9/10-\*(#H+(\*(#F*2/3))'\v'-.4m'\z\(hy\v'.4m'\h'|\\n:u'
.ds . \\k:\h'-(\\n(.wu*8/10)'\v'\*(#V*4/10'\z.\v'-\*(#V*4/10'\h'|\\n:u'
.ds 3 \*(#[\v'.2m'\s-2\&3\s0\v'-.2m'\*(#]
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
.ds oe o\h'-(\w'o'u*4/10)'e
.ds Oe O\h'-(\w'O'u*4/10)'E
. \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
. \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
. ds : e
. ds 8 ss
. ds v \h'-1'\o'\(aa\(ga'
. ds _ \h'-1'^
. ds . \h'-1'.
. ds 3 3
. ds o a
. ds d- d\h'-1'\(ga
. ds D- D\h'-1'\(hy
. ds th \o'bp'
. ds Th \o'LP'
. ds ae ae
. ds Ae AE
. ds oe oe
. ds Oe OE
.\}
.rm #[ #] #H #V #F C
.SH "NAME"
ar \- create, modify, and extract from archives
.SH "SYNOPSIS"
ar [\-X32_64] [\-]\fIp\fR[\fImod\fR [\fIrelpos\fR] [\fIcount\fR]] \fIarchive\fR [\fImember\fR...]
.SH "DESCRIPTION"
The GNU \f(CWar\fR program creates, modifies, and extracts from
archives. An \fIarchive\fR is a single file holding a collection of
other files in a structure that makes it possible to retrieve
the original individual files (called \fImembers\fR of the archive).
.PP
The original files\*(R' contents, mode (permissions), timestamp, owner, and
group are preserved in the archive, and can be restored on
extraction.
.PP
GNU \f(CWar\fR can maintain archives whose members have names of any
length; however, depending on how \f(CWar\fR is configured on your
system, a limit on member-name length may be imposed for compatibility
with archive formats maintained with other tools. If it exists, the
limit is often 15 characters (typical of formats related to a.out) or 16
characters (typical of formats related to coff).
.PP
\f(CWar\fR is considered a binary utility because archives of this sort
are most often used as \fIlibraries\fR holding commonly needed
subroutines.
.PP
\f(CWar\fR creates an index to the symbols defined in relocatable
object modules in the archive when you specify the modifier \fBs\fR.
Once created, this index is updated in the archive whenever \f(CWar\fR
makes a change to its contents (save for the \fBq\fR update operation).
An archive with such an index speeds up linking to the library, and
allows routines in the library to call each other without regard to
their placement in the archive.
.PP
You may use \fBnm \-s\fR or \fBnm --print-armap\fR to list this index
table. If an archive lacks the table, another form of \f(CWar\fR called
\f(CWranlib\fR can be used to add just the table.
.PP
GNU \f(CWar\fR is designed to be compatible with two different
facilities. You can control its activity using command-line options,
like the different varieties of \f(CWar\fR on Unix systems; or, if you
specify the single command-line option \fB\-M\fR, you can control it
with a script supplied via standard input, like the MRI ``librarian'\*(R'
program.
.SH "OPTIONS"
GNU \f(CWar\fR allows you to mix the operation code \fIp\fR and modifier
flags \fImod\fR in any order, within the first command-line argument.
.PP
If you wish, you may begin the first command-line argument with a
dash.
.PP
The \fIp\fR keyletter specifies what operation to execute; it may be
any of the following, but you must specify only one of them:
.Ip "\f(CWd\fR" 4
\fIDelete\fR modules from the archive. Specify the names of modules to
be deleted as \fImember\fR...; the archive is untouched if you
specify no files to delete.
.Sp
If you specify the \fBv\fR modifier, \f(CWar\fR lists each module
as it is deleted.
.Ip "\f(CWm\fR" 4
Use this operation to \fImove\fR members in an archive.
.Sp
The ordering of members in an archive can make a difference in how
programs are linked using the library, if a symbol is defined in more
than one member.
.Sp
If no modifiers are used with \f(CWm\fR, any members you name in the
\fImember\fR arguments are moved to the \fIend\fR of the archive;
you can use the \fBa\fR, \fBb\fR, or \fBi\fR modifiers to move them to a
specified place instead.
.Ip "\f(CWp\fR" 4
\fIPrint\fR the specified members of the archive, to the standard
output file. If the \fBv\fR modifier is specified, show the member
name before copying its contents to standard output.
.Sp
If you specify no \fImember\fR arguments, all the files in the archive are
printed.
.Ip "\f(CWq\fR" 4
\fIQuick append\fR; Historically, add the files \fImember\fR... to the end of
\fIarchive\fR, without checking for replacement.
.Sp
The modifiers \fBa\fR, \fBb\fR, and \fBi\fR do \fInot\fR affect this
operation; new members are always placed at the end of the archive.
.Sp
The modifier \fBv\fR makes \f(CWar\fR list each file as it is appended.
.Sp
Since the point of this operation is speed, the archive's symbol table
index is not updated, even if it already existed; you can use \fBar s\fR or
\f(CWranlib\fR explicitly to update the symbol table index.
.Sp
However, too many different systems assume quick append rebuilds the
index, so \s-1GNU\s0 ar implements \f(CWq\fR as a synonym for \f(CWr\fR.
.Ip "\f(CWr\fR" 4
Insert the files \fImember\fR... into \fIarchive\fR (with
\fIreplacement\fR). This operation differs from \fBq\fR in that any
previously existing members are deleted if their names match those being
added.
.Sp
If one of the files named in \fImember\fR... does not exist, \f(CWar\fR
displays an error message, and leaves undisturbed any existing members
of the archive matching that name.
.Sp
By default, new members are added at the end of the file; but you may
use one of the modifiers \fBa\fR, \fBb\fR, or \fBi\fR to request
placement relative to some existing member.
.Sp
The modifier \fBv\fR used with this operation elicits a line of
output for each file inserted, along with one of the letters \fBa\fR or
\fBr\fR to indicate whether the file was appended (no old member
deleted) or replaced.
.Ip "\f(CWt\fR" 4
Display a \fItable\fR listing the contents of \fIarchive\fR, or those
of the files listed in \fImember\fR... that are present in the
archive. Normally only the member name is shown; if you also want to
see the modes (permissions), timestamp, owner, group, and size, you can
request that by also specifying the \fBv\fR modifier.
.Sp
If you do not specify a \fImember\fR, all files in the archive
are listed.
.Sp
If there is more than one file with the same name (say, \fBfie\fR) in
an archive (say \fBb.a\fR), \fBar t b.a fie\fR lists only the
first instance; to see them all, you must ask for a complete
listing---in our example, \fBar t b.a\fR.
.Ip "\f(CWx\fR" 4
\fIExtract\fR members (named \fImember\fR) from the archive. You can
use the \fBv\fR modifier with this operation, to request that
\f(CWar\fR list each name as it extracts it.
.Sp
If you do not specify a \fImember\fR, all files in the archive
are extracted.
.PP
A number of modifiers (\fImod\fR) may immediately follow the \fIp\fR
keyletter, to specify variations on an operation's behavior:
.Ip "\f(CWa\fR" 4
Add new files \fIafter\fR an existing member of the
archive. If you use the modifier \fBa\fR, the name of an existing archive
member must be present as the \fIrelpos\fR argument, before the
\fIarchive\fR specification.
.Ip "\f(CWb\fR" 4
Add new files \fIbefore\fR an existing member of the
archive. If you use the modifier \fBb\fR, the name of an existing archive
member must be present as the \fIrelpos\fR argument, before the
\fIarchive\fR specification. (same as \fBi\fR).
.Ip "\f(CWc\fR" 4
\fICreate\fR the archive. The specified \fIarchive\fR is always
created if it did not exist, when you request an update. But a warning is
issued unless you specify in advance that you expect to create it, by
using this modifier.
.Ip "\f(CWf\fR" 4
Truncate names in the archive. \s-1GNU\s0 \f(CWar\fR will normally permit file
names of any length. This will cause it to create archives which are
not compatible with the native \f(CWar\fR program on some systems. If
this is a concern, the \fBf\fR modifier may be used to truncate file
names when putting them in the archive.
.Ip "\f(CWi\fR" 4
Insert new files \fIbefore\fR an existing member of the
archive. If you use the modifier \fBi\fR, the name of an existing archive
member must be present as the \fIrelpos\fR argument, before the
\fIarchive\fR specification. (same as \fBb\fR).
.Ip "\f(CWl\fR" 4
This modifier is accepted but not used.
.Ip "\f(CWN\fR" 4
Uses the \fIcount\fR parameter. This is used if there are multiple
entries in the archive with the same name. Extract or delete instance
\fIcount\fR of the given name from the archive.
.Ip "\f(CWo\fR" 4
Preserve the \fIoriginal\fR dates of members when extracting them. If
you do not specify this modifier, files extracted from the archive
are stamped with the time of extraction.
.Ip "\f(CWP\fR" 4
Use the full path name when matching names in the archive. \s-1GNU\s0
\f(CWar\fR can not create an archive with a full path name (such archives
are not \s-1POSIX\s0 complaint), but other archive creators can. This option
will cause \s-1GNU\s0 \f(CWar\fR to match file names using a complete path
name, which can be convenient when extracting a single file from an
archive created by another tool.
.Ip "\f(CWs\fR" 4
Write an object-file index into the archive, or update an existing one,
even if no other change is made to the archive. You may use this modifier
flag either with any operation, or alone. Running \fBar s\fR on an
archive is equivalent to running \fBranlib\fR on it.
.Ip "\f(CWS\fR" 4
Do not generate an archive symbol table. This can speed up building a
large library in several steps. The resulting archive can not be used
with the linker. In order to build a symbol table, you must omit the
\fBS\fR modifier on the last execution of \fBar\fR, or you must run
\fBranlib\fR on the archive.
.Ip "\f(CWu\fR" 4
Normally, \fBar r\fR... inserts all files
listed into the archive. If you would like to insert \fIonly\fR those
of the files you list that are newer than existing members of the same
names, use this modifier. The \fBu\fR modifier is allowed only for the
operation \fBr\fR (replace). In particular, the combination \fBqu\fR is
not allowed, since checking the timestamps would lose any speed
advantage from the operation \fBq\fR.
.Ip "\f(CWv\fR" 4
This modifier requests the \fIverbose\fR version of an operation. Many
operations display additional information, such as filenames processed,
when the modifier \fBv\fR is appended.
.Ip "\f(CWV\fR" 4
This modifier shows the version number of \f(CWar\fR.
.PP
\f(CWar\fR ignores an initial option spelt \f(CW-X32_64\fR, for
compatibility with \s-1AIX\s0. The behaviour produced by this option is the
default for \s-1GNU\s0 \f(CWar\fR. \f(CWar\fR does not support any of the other
\f(CW-X\fR options; in particular, it does not support \f(CW-X32\fR
which is the default for \s-1AIX\s0 \f(CWar\fR.
.SH "SEE ALSO"
\fInm\fR\|(1), \fIranlib\fR\|(1), and the Info entries for \fIbinutils\fR.
.SH "COPYRIGHT"
Copyright (c) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001 Free Software Foundation, Inc.
.PP
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.1
or any later version published by the Free Software Foundation;
with no Invariant Sections, with no Front-Cover Texts, and with no
Back-Cover Texts. A copy of the license is included in the
section entitled \*(L"GNU Free Documentation License\*(R".
.rn }` ''
.IX Title "AR.1 1"
.IX Name "ar - create, modify, and extract from archives"
.IX Header "NAME"
.IX Header "SYNOPSIS"
.IX Header "DESCRIPTION"
.IX Header "OPTIONS"
.IX Item "\f(CWd\fR"
.IX Item "\f(CWm\fR"
.IX Item "\f(CWp\fR"
.IX Item "\f(CWq\fR"
.IX Item "\f(CWr\fR"
.IX Item "\f(CWt\fR"
.IX Item "\f(CWx\fR"
.IX Item "\f(CWa\fR"
.IX Item "\f(CWb\fR"
.IX Item "\f(CWc\fR"
.IX Item "\f(CWf\fR"
.IX Item "\f(CWi\fR"
.IX Item "\f(CWl\fR"
.IX Item "\f(CWN\fR"
.IX Item "\f(CWo\fR"
.IX Item "\f(CWP\fR"
.IX Item "\f(CWs\fR"
.IX Item "\f(CWS\fR"
.IX Item "\f(CWu\fR"
.IX Item "\f(CWv\fR"
.IX Item "\f(CWV\fR"
.IX Header "SEE ALSO"
.IX Header "COPYRIGHT"