4 Linker Tools for PA-RISC Systems

This chapter describes the linker toolset, which provides several tools to help you find symbols, display and modify object files, and determine link order. Some of these tools are specific to a particular object file type. Others are available in both 32-bit and 64-bit mode. The following table lists the linker toolset.

Tool

Mode

Description

 

 

 

chatr

32-bit/64-bit

Displays or modifies the internal attributes of an object file. See “Changing a

 

 

Program's Attributes with chatr(1)” (page 69) .

 

 

 

nm

32-bit/64-bit

Displays the symbol table of an object file. See “Viewing Symbols in an Object

 

 

file with nm(1)” (page 71) .

 

 

 

elfdump

64-bit

Displays the contents of an ELF object file. See “Viewing the Contents of an Object

 

 

File with elfdump(1)” (page 72)

 

 

 

ldd

32-bit/64-bit

Lists dynamic dependencies of executable files and shared libraries. “Viewing

 

 

library dependencies with ldd(1)” (page 74).

 

 

 

size

32-bit/64-bit

Prints sizes of object file elements. See “Viewing the Size of Object File Elements

 

 

with size(1)” (page 75)

 

 

 

strip

32-bit/64-bit

Strips symbol and debugging information from an object file, executable, or

 

 

archive library. See “Reducing Storage Space with strip(1)” (page 76)

 

 

 

fastbind

32-bit/64-bit

Improves startup time of programs that use shared libraries. See. “Improving

 

 

Program Start-up with fastbind(1)” (page 76)

 

 

 

lorder

32-bit/64-bit

Finds ordering relationship for an object library. See “Finding Object Library

 

 

Ordering Relationships with lorder(1)” (page 77)

 

 

 

odump

32-bit

Displays the contents of a SOM object file. See the odump(1).

 

 

 

Changing a Program's Attributes with chatr(1)

The chatr command (seechatr(1)) allows you to change various program attributes that were determined at link time. When run without any options, chatr displays the attributes of the specified file.

Using chatr for 32-bit Program Attributes

The following table summarizes the options you can use to change various attributes:

To

Use the option

32-bit mode only: Set the file's magic number to SHARE_MAGIC.

-n

 

 

32-bit mode only: Set the file's magic number to DEMAND_MAGIC.

-q

 

 

32-bit mode only: Change the file's magic number from EXEC_MAGIC to

-M

SHMEM_MAGIC.

 

 

 

32-bit mode only: Change the file's magic number from SHMEM_MAGIC to

-N

EXEC_MAGIC.

 

 

 

Use immediate binding for all libraries loaded at program startup.

-B immediate

 

 

Use deferred binding for all libraries loaded at program startup.

-B deferred

 

 

Use nonfatal binding. Must be specified with -Bimmediate or -B deferred.

-B nonfatal

 

 

Use restricted binding. Must be specified with -Bimmediate or -Bdeferred.

-B restricted

 

 

Changing a Program's Attributes with chatr(1) 69