Kenwood HP 9000 Personal Computer User Manual


 
Chapter 5 135
Creating and Using Libraries
Creating Archive Libraries
Deleting an Object Module
To delete an object module from a library, use the d key. For example, to
delete volume.o from libunits.a:
$ ar d libunits.a volume.o Delete volume.o.
$ ar t libunits.a List the contents.
length.o
mass.o volume.o is gone.
Summary of Keys to the ar(1) Command
When used to create and manage archive libraries, ar's syntax is:
ar [-]
keys archive
[
modules
] ...
archive is the name of the archive library. modules is an optional list of
object modules or files. See ar(1) for the complete list of keys and options.
Useful ar Keys
Here are some useful ar keys and their modifiers:
key Description
dDelete the modules from the archive.
rReplace or add the modules to the archive. If archive
exists, ar replaces modules specified on the command
line. If archive does not exist, ar creates a new archive
containing the modules.
t Display a table of contents for the archive.
u Used with the r, this modifier tells ar to replace only
those modules with creation dates later than those in
the archive.
v Display verbose output.
x Extracts object modules from the library. Extracted
modules are placed in .o files in the current directory.
Once an object module is extracted, you can use nm to
view the symbols in the module.
For example, when used with the v flag, the t flag creates a verbose table
of contents — including such information as module creation date and
file size: