Search notes:

ar

ar is the archiver. It can be used to create static libraries.
ar [-X32_64] [-]p[mod] [--plugin name] [--target bfdname] [--output dirname] [relpos] [count] archive [member…]
p is a letter that represents a command. Only one command can be used.
The exact behavior of the chosen command can be changed with the modifier.
The optional relpos argument is used to specify the position after or before which new members are added, see commands modifiers a
Note: ar doesn't store paths, only filenames.

Commands and Options

Commands

d delete file(s) from the archive
m[ab] move file(s) in the archive
p print file(s) found in the archive
q[f] quick append file(s) to the archive
r[ab][f][u] replace existing or insert new file(s) into the archive
s act as ranlib
t[O][v] display contents of the archive
x[o] extract file(s) from the archive

Command specific modifiers

a put file(s) after [relpos]
b put file(s) before [relpos] (same as i)
i insert file before [relpos] (same as b)
D use zero for timestamps and uids/gids (default)
U use actual timestamps and uids/gids
N use instance [count] of name
f truncate inserted file names
P use full path names when matching
o preserve original dates
O display offsets of files in the archive
u only replace files that are newer than current archive contents

Generic modifiers

c do not warn if the library had to be created
s create an archive index (cf. ranlib)
S do not build a symbol table
T make a thin archive
v be verbose
V display the version number
@<file> read options from <file>
--target=BFDNAME specify the target object format as BFDNAME
--output=DIRNAME specify the output directory for extraction operations

Optional

--plugin <p> load the specified plugin

See also

binutils, ranlib, nm
ar fileformat

Index