ld(1)

 

 

ld(1)

 

used. If a program uses shared libraries, the dynamic loader /usr/lib/dld.sl

 

for 32-bit or

/usr/lib/pa20_64/dld.sl for 64-bit will attempt to load each

 

library from the same directory in which it was found at link time (see the +s and

 

+b options).

 

 

-l:library

Search the library speci®ed. Similar to the -loption except the current state of the

 

-aoption is not important. The library name can be any valid ®lename. (Note that

 

previous releases required that the library name contain the pre®x lib and end with

 

a suf®x of .a or .sl.)

 

-m

This option produces a load map on the standard output.

 

-n

This option is accepted but ignored by the 64-bit ld. Generate an executable output

 

®le with ®le type SHARE_MAGIC . This is the default. This option is incompatible

 

with -Nand -q.

 

-ooutfile

Produce an output object ®le named out®le (a.out if -oout®le is not speci®ed).

-q

This option is ignored for 64-bit links. Generate an executable output ®le with ®le

 

type DEMAND_MAGIC . This option is incompatible with -n, -N, and -Q.

-r

Retain relocation information in the output ®le for subsequent re-linking. The ld

 

command does not report unde®ned symbols. This option cannot be used when build-

 

ing a shared library ( -b) or in conjunction with -Aor +ild incremental linking

 

options.

 

 

-s

Strip the output ®le of all symbol table, relocation, and debug support information.

 

This might impair or prevent the use of a symbolic debugger on the resulting pro-

 

gram. This option is incompatible with -r. (The strip(1) command also removes this

 

information.)

This option is incompatible with +ild.

(The incremental linking

 

requires the parts of the output load module which are stripped out with -soption.)

-t

Print a trace (to standard output) of each input ®le as ld processes it.

-usymbol

Enter symbol as an unde®ned symbol in the symbol table. The resulting unresolved

 

reference is useful for linking a program solely from object ®les in a library. More

 

than one symbol can be speci®ed, but each must be preceded by -u.

-v

Display verbose messages during linking. For each library module that is loaded, the

 

linker indicates which symbol caused that module to be loaded.

-x

Strip local symbols from the output ®le. This reduces

the size of the output ®le

without impairing the effectiveness of object ®le utilities. This option is incompatible with the -roption. This option is incompatible with the +ild option. (The incremental linking requires the parts of the output load module which are stripped out with the -xoption.

 

Note: use of -xmight affect the use of a debugger.

 

-ysymbol

Indicate each ®le in which symbol appears. More than one symbol can be speci®ed,

 

but each must be preceded by -y.

 

-z

Arrange for run-time dereferencing of null pointers to produce a

SIGSEGV signal.

 

(This is the complement of the -Zoption.)

 

-Bbind

Select run-time binding behavior of a program using shared libraries or the binding

 

preference in building a shared library. The most common values for bind are:

 

deferred

 

 

 

 

Bind addresses on ®rst reference rather than at program start-up time. This is

 

the default.

 

 

 

immediate

 

 

 

Bind addresses of all symbols immediately upon loading the library. Commonly

 

followed by

-B nonfatal to allow procedure calls that cannot be resolved at

 

program start-up to be resolved on ®rst reference.

 

 

Since

-B

nonfatal suppresses messages about unresolved symbols, also

 

specify

-B verbose to display those messages.

 

 

See the example below.

 

HP-UX Release 11i: December 2000

 

− 3 −

Section 1425

l