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

l
ld_ia(1) ld_ia(1)
(For Itanium(R)-based Systems)
-lx Search a library libx
.a, libx.so, or libx.sl, where x is one or more charac-
ters. The current state of the
-a
option determines whether the archive (.a)or
shared (
.sl or .so) 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/hpux32
. 64-bit libraries are located in
/usr/lib/hpux64
. If the environment variable LPATH is present in the user’s
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/hpux32/dld.so
for 32-bit, or
/usr/lib/hpux64/dld.so
for
64-bit, attempts 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.
-m Produce a load map on the standard output.
-n This option is ignored.
-noshared Force the linker to create a fully archive bound program (also called statically-
bound executable). Specify /usr/ccs/lib/hpux32/crt0.o
or
/usr/ccs/lib/hpux64/crt0.o
(or equivalent startup code) on the ld com-
mand line when you use this option. This option is the complement of
-dynamic.
For dynamically linked executables, the dynamic loader is involved in the process of
loading the executable, regardless of whether it was linked with shared libraries.
For statically linked programs, control does not pass to the dynamic loader.
-noshared_dynamic
Create a dynamically linked program if shared libraries are linked in. If no shared
libraries are linked in, the linker creates a fully archive bound program. This
option is the default in compatibility mode (with the
+compat) options. See also
the
-dynamic and -noshared options.
-o outfile Produce an output object file named outfile (
a.out if -o outfile is not specified).
-q This option is ignored.
-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
building a shared library ( -b ) or in conjunction with the -s, -x, or the
+ild
incremental linking options.
-s Strip the output file of all symbol table, relocation, and debug support information.
(The strip (1) command also removes this information.) This option is incompatible
with the -r option and the +ild option.
Note: Use of the
-s option might impair or prevent the use of a symbolic debugger
on the resulting program.
-symbolic symbol
When building a shared library, causes the linker to resolve all references to the
specified symbol to the symbol defined in the library. This option is similar to -B
symbolic, but operates on a per symbol basis.
You can specify more than one symbol on the command line with multiple option-
symbol pairs, that is, each symbol you specify must be preceded by the
-
symbolic 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.
You can specify more than one symbol on the command line with multiple option-
symbol pairs, that is, each symbol you specify must be preceded by the
-u option.
-v Display verbose messages during linking. This option is equivalent to +vtype
all (see the +vtype option for more information).
Section 1−−452 Hewlett-Packard Company − 3 − HP-UX 11i Version 2: September 2004