man h8300-hitachi-hms-ar (Commandes) - create, modify, and extract from archives.
NAME
ar - create, modify, and extract from archives.
SYNOPSIS
ar [-]c {dmpqrtx}[abcfilNoPsSuvV] c [c membernamec ] c [c countc ] c archivec c filesc ...
DESCRIPTION
The GNU c arc program creates, modifies, and extracts from archives. An c archivec is a single file holding a collection of other files in a structure that makes it possible to retrieve the original individual files (called c membersc of the archive).
The original files' contents, mode (permissions), timestamp, owner, and group are preserved in the archive, and may be reconstituted on extraction.
GNU c arc can maintain archives whose members have names of any length; however, depending on how c arc 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).
c arc is considered a binary utility because archives of this sort are most often used as c librariesc holding commonly needed subroutines.
c arc will create an index to the symbols defined in relocatable object modules in the archive when you specify the modifier `c sc '. Once created, this index is updated in the archive whenever c arc makes a change to its contents (save for the `c qc ' 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.
You may use `c nm -sc ' or `c nm --print-armapc ' to list this index table. If an archive lacks the table, another form of c arc called c ranlibc can be used to add just the table.
c arc insists on at least two arguments to execute: one keyletter specifying the c operationc (optionally accompanied by other keyletters specifying c modifiersc ), and the archive name to act on.
Most operations can also accept further c filesc arguments, specifying particular files to operate on.
OPTIONS
GNU c arc allows you to mix the operation code c pc and modifier flags c modc in any order, within the first command-line argument.
If you wish, you may begin the first command-line argument with a dash.
The c pc keyletter specifies what operation to execute; it may be any of the following, but you must specify only one of them:
- d
- c Deletec modules from the archive. Specify the names of modules to be deleted as c filesc ; the archive is untouched if you specify no files to delete.
If you specify the `c vc ' modifier, c arc will list each module as it is deleted.
- m
- Use this operation to c movec members in an archive.
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.
If no modifiers are used with c mc , any members you name in the c filesc arguments are moved to the c endc of the archive; you can use the `c ac ', `c bc ', or `c ic ' modifiers to move them to a specified place instead.
- p
- c Printc the specified members of the archive, to the standard output file. If the `c vc ' modifier is specified, show the member name before copying its contents to standard output.
If you specify no c filesc , all the files in the archive are printed.
- q
- c Quick appendc ; add c filesc to the end of c archivec , without checking for replacement.
The modifiers `c ac ', `c bc ', and `c ic ' do c notc affect this operation; new members are always placed at the end of the archive.
The modifier `c vc ' makes c arc list each file as it is appended.
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 `c ar sc ' or c ranlibc explicitly to update the symbol table index.
However, too many different systems assume quick append rebuilds the index, so GNU ar implements `c qc ' as a synonym for `c rc '.
- r
- Insert c filesc into c archivec (with c replacementc ). This operation differs from `c qc ' in that any previously existing members are deleted if their names match those being added.
If one of the files named in c filesc doesn't exist, c arc displays an error message, and leaves undisturbed any existing members of the archive matching that name.
By default, new members are added at the end of the file; but you may use one of the modifiers `c ac ', `c bc ', or `c ic ' to request placement relative to some existing member.
The modifier `c vc ' used with this operation elicits a line of output for each file inserted, along with one of the letters `c ac ' or `c rc ' to indicate whether the file was appended (no old member deleted) or replaced.
- t
- Display a c tablec listing the contents of c archivec , or those of the files listed in c filesc 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 `c vc ' modifier.
If you do not specify any c filesc , all files in the archive are listed.
If there is more than one file with the same name (say, `c fiec ') in an archive (say `c b.ac '), `c ar t b.a fiec ' will list only the first instance; to see them all, you must ask for a complete listing-in our example, `c ar t b.ac '.
- x
- c Extractc members (named c filesc ) from the archive. You can use the `c vc ' modifier with this operation, to request that c arc list each name as it extracts it.
If you do not specify any c filesc , all files in the archive are extracted.
A number of modifiers (c modc ) may immediately follow the c pc keyletter, to specify variations on an operation's behavior:
- a
- Add new files c afterc an existing member of the archive. If you use the modifier c ac , the name of an existing archive member must be present as the c membernamec argument, before the c archivec specification.
- b
- Add new files c beforec an existing member of the archive. If you use the modifier c bc , the name of an existing archive member must be present as the c membernamec argument, before the c archivec specification. (same as `c ic ').
- c
- c Createc the archive. The specified c archivec is always created if it didn't 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.
- f
- Truncate names in the archive. ar will normally permit file names of any length. This will cause it to create archives which are not compatible with the native ar program on some systems. If this is a concern, the f modifier may be used to truncate file names when putting them in the archive.
- i
- Insert new files c beforec an existing member of the archive. If you use the modifier c ic , the name of an existing archive member must be present as the c membernamec argument, before the c archivec specification. (same as `c bc ').
- l
- This modifier is accepted but not used.
- N
- Uses the count parameter. This is used if there are multiple entries in the archive with the same name. Extract or delete instance count of the given name from the archive.
- o
- Preserve the c originalc dates of members when extracting them. If you do not specify this modifier, files extracted from the archive will be stamped with the time of extraction.
- P
- Use the full path name when matching names in the archive. ar can not create an archive with a full path name (such archives are not POSIX complaint), but other archive creators can. This option will cause ar 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.
- s
- 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 `c ar sc ' on an archive is equivalent to running `c ranlibc ' on it.
- S
- 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 `c Sc ' modifier on the last execution of `c arc ', or you must run `c ranlibc ' on the archive.
- u
- Normally, c ar rc ... inserts all files listed into the archive. If you would like to insert c onlyc those of the files you list that are newer than existing members of the same names, use this modifier. The `c uc ' modifier is allowed only for the operation `c rc ' (replace). In particular, the combination `c quc ' is not allowed, since checking the timestamps would lose any speed advantage from the operation `c qc '.
- v
- This modifier requests the c verbosec version of an operation. Many operations display additional information, such as filenames processed, when the modifier `c vc ' is appended.
- V
- This modifier shows the version number of ar.
SEE ALSO
`binutils' entry in infoc ; The GNU Binary Utilitiesc , Roland H. Pesch (October 1991). nm(1)c , ranlib(1)c .
COPYING
Copyright (c) 1991, 1992, 1993, 1995, 1998, 1999 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies.
Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one.
Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be included in translations approved by the Free Software Foundation instead of in the original English.