ar.1 (2010 09)

a
ar(1) ar(1)
where the single quote marks indicate updated files. The first command says "move
f2 and f3 after f1
in newlib .a", thus creating the order:
f1 f3 f2 f4
Note that the relative order of f2 and
f3 has not changed. The second command says "move f3 after f2
in newlib.a", creating the order:
f1 f2 f3 f4
The third command then replaces files f2
and f3. Since files f2 and f3 both already existed in the
archive, this sequence of commands could not be simply replaced by:
ar ra f1 newlib.a f2 f3
because the previous position and relative order of
f2 and f3 in the archive are preserved (no matter
how the files are specified on the command line), producing the following archive:
newlib.a: f3’ f2’ f1 f4
WARNINGS
If you are a user who has appropriate privileges,
ar can alter any archive file, even if it is write-
protected.
If the same file is mentioned twice in an argument list, it might be put in the archive twice.
If multiple copies of a file exist in an archive,
ar matches the first occurrence of the file in the archive.
ar automatically creates an archive symbol table, a task performed in early HP-UX versions by
ranlib.
Use of the
z modifier either suppresses generation of the symbol table, or invalidates it if it exists. The
ranlib command can be used to rebuild the symbol table if an archive was built with the
z modifier.
FILES
/var/tmp/ar* Temporary files
SEE ALSO
System Tools:
ld(1) Invoke the link editor
Miscellaneous:
acl(5) Access control lists
a.out (4) Assembler, compiler, and linker output
ar(4) Archive format
lorder (1) Find the ordering relation for object files or archive libraries
ranlib (1) Regenerate an archive symbol table
strip (1) Strip symbol and line number information from an object file
tmpnam(3S) Create a name for a temporary file
Texts and Tutorial s:
HP-UX Linker and Libraries Online User Guide
(See the
+help option)
HP-UX Linker and Libraries User’s Guide
(See manuals (5) for ordering information)
STANDARDS CONFORMANCE
ar: SVID2, SVID3, XPG2, XPG3, XPG4, POSIX.2
4 Hewlett-Packard Company 4 HP-UX 11i Version 3: September 2010