HP-UX Reference (11i v2 07/12) - 1 User Commands A-M (vol 1)

l
ld_pa(1)
PA-RISC Systems Only
ld_pa(1)
-e epsym Set the default entry point address for the output file to be that of the symbol epsym.
(This option only applies to executable files.)
-h symbol Prior to writing the symbol table to the output file, mark this name as "local" so that it
is no longer externally visible. This ensures that this particular entry will not clash
with a definition in another file during future processing by
ld.
More than one symbol can be specified, but
-h must precede each one. If used when
building a shared library or program, this option prevents the named symbol from
being visible to the dynamic loader.
-lx Search a library libx
.a or libx.sl, where x is one or more characters. The
current state of the
-a option determines whether the archive (
.a) or shared (.sl)
version of a library is searched.
Because a library is searched when its name is encountered, the placement of a
-l is
significant. By default, 32-bit libraries are located in
/usr/lib and
/usr/ccs/lib . 64-bit libraries are located in /usr/lib/pa20_64
.
If the environment variable
LPATH is present in the users environment, it should
contain a colon-separated list of directories to search. These directories are searched
instead of the default directories, but -L options can still be 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 specified. Similar to the -l option except the current state of the
-a option is not important. The library name can be any valid filename. (Note that
previous releases required that the library name contain the prefix lib and end with
asufxof.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
file with file type SHARE_MAGIC . This is the default. This option is incompatible
with -N and -q.
-noshared This option forces the linker to create a fully archive bound program.
-o outfile Produce an output object file named outfile (
a.out if -o outfile is not specified).
-q This option is ignored for 64-bit links. Generate an executable output file with file
type DEMAND_MAGIC . This option is incompatible with -n, -N, and -Q
.
-r Retain relocation information in the output file for subsequent re-linking. The ld
command does not report undefined symbols. This option cannot be used when build-
ing a shared library ( -b ) or in conjunction with -A or +ild incremental linking
options.
-s Strip the output file of all symbol table, relocation, and debug support information.
This might impair or prevent the use of a symbolic debugger or a profiler on the
resulting program. 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 -s
option.)
-t Print a trace (to standard output) of each input file as ld processes it.
-u symbol Enter symbol as an undefined symbol in the symbol table. The resulting unresolved
reference is useful for linking a program solely from object files in a library. More
than one symbol can be specified, but each must be preceded by -u.
-v Display verbose messages during linking. On 32-bit systems, for each module loaded,
the linker indicates which symbol caused that module to be loaded. For 64-bit sys-
tems, the linker indicates this information only for modules loaded from archive
libraries.
-x Strip local symbols from the output file. This reduces the size of the output file
without impairing the effectiveness of object file utilities. This option is incompatible
HP-UX 11i Version 2: December 2007 Update 3 Hewlett-Packard Company 521