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

l
ld_pa(1) ld_pa(1)
(For PA-RISC Systems)
See the +help option or the HP-UX Linker and Libraries User’s Guide manual for
more information on the uses of binding modes.
-D offset Set the origin (in hexadecimal) for the data segment.
When used with the
+ild option, if you change the offset after the initial incremen-
tal link, the linker performs an initial incremental link automatically.
-E Mark all symbols defined by a program for export to shared libraries. In a 32-bit
link or +compat mode 64-bit link, ld
marks only those symbols that are actually
referenced by a shared library seen at link time. In a 64-bit +std link, all symbols
are exported by default, so
-E is not necessary to make symbols visible. However, it
has an additional side effect of identifying all exported symbols as necessary, so that
they will not be removed when using dead code elimination (
+Oprocelim).
-Fl lib Force load all member objects of the archive library lib. If you do not use
-Fl, the
linker only loads the needed archive members from lib. This option is useful for
creating a shared library from an archive library (if the member objects are
position-independent code), or when you need to load archive member that define
symbols needed by shared libraries.
You can specify more than one library on the command line with multiple option-
library pairs; that is, each library you specify must be preceded by the -Fl option.
-G Strip all unloadable data from the output file. This option is typically used to strip
debug information.
-I Instrument the code to collect profile information upon execution. The profile data
gathered during program execution can be used in conjunction with the -P option.
32-bit programs linked with this option should use the startup file
/opt/langtools/lib/icrt0.o
. This option should not be used with the -P,
-A, -O, +ild,or+O options.
-L dir Search for libx.a or libx.sl in dir before looking in default locations. More
than one directory can be specified, but each must be preceded by -L. The
-L
option is effective only if it precedes the -l option on the command line.
-O Turn on linker optimizations. Currently the optimizations include the elimination
of unnecessary ADDIL instructions from the code in the executable file (32-bit
only), and the removal of dead procedures.
-O is passed to the linker by the compilers when the +O4 compiler option is
selected.
This option is incompatible with the
+ild option.
For more details on linker optimizations refer to the
+help option or the HP-UX
Linker and Libraries User’s Guide manual.
-P Examine the data file produced by an instrumented program (see the -I option) to
perform profile based optimizations on the code. This option should not be used
with the -A or +ild options.
-Q Ignored for 64-bit links. Generate an executable output file with file type
EXEC_MAGIC or SHARE_MAGIC, depending on whether -N or -n is specified.
This is the default. This option is incompatible with -q.
-R offset Set the origin (in hexadecimal) for the text (i.e., code) segment.
When used with the
+ild option, if you change the offset after the initial incre-
mental link, the linker performs an initial incremental link automatically.
-V Output a message giving information about the version of ld being used.
-Z Allow run-time dereferencing of null pointers. See the discussions of -Z and
pointers in cc(1). (This is the complement of the -z option.)
-Pd Reorder debuggable functions. Ordinarily -P does not reorder functions from .o
files with debugging information, because reordering renders them non-debuggable.
This option overrides this and reorders the functions.
HP-UX 11i Version 2: September 2004 − 5 − Hewlett-Packard Company Section 1−−473