Kenwood HP 9000 Summary of Keys to the ar1 Command, Deleting an Object Module, Useful ar Keys

Models: HP 9000

1 333
Download 333 pages 57.85 Kb
Page 135
Image 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

volume.o is gone.

mass.o

 

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:

keyDescription

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:

Chapter 5

135

Page 135
Image 135
Kenwood HP 9000 manual Summary of Keys to the ar1 Command, Deleting an Object Module, Useful ar Keys, Archive