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

l
ld(1) ld(1)
or +instrumenter caliper
, no additional linker options are needed.
-L dir Search for libx.a,
libx.sl, or libx.so, in dir before looking in default loca-
tions. You can specify more than one directory, but each must be preceded by the
-L option. The -L option is effective only if it precedes the
-l option on the com-
mand line.
-N In 32-bit mode only, cause the data to be placed immediately following the text, and
make the text writable. Files of this type cannot be shared.
-O Turn on linker optimizations. Currently the optimization includes 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 use the
+help option or see the HP-UX
Linker and Libraries User’s Guide manual.
-P Examine the profile database 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 +ild 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. Reordering is based on link
order file produced from flow.data by default. If you specify the -Pd option, the
linker does not use flow.data for reordering. This option is incompatible with +ild.
Note: Use of the
-Pd option might impair or prevent the use of a symbolic
debugger on the resulting program.
-PD filename Save link order file generated by fdp during linking with -P option into user-
specified file. This option is incompatible with the +ild option.
-PF filename Indicate to the linker to use the specified file for the link order file instead of gen-
erating it using /usr/ccs/bin/fdp
. This option is incompatible with the +ild
option.
-Q This option is ignored.
-R offset Set (in hexadecimal) the starting address of the text (i.e., code) segment. This
option is useful with kernel and embedded applications. The default address for
64-bit mode is 0x4000000000000000 and for 32-mode is 0x04000000. If the
-N
option is specified, the default is 0x1000.
-S This option is ignored and generates a warning message.
-T This option is ignored.
-V Output a message giving information about the version of ld being used.
-Z This is the default. Allow run-time dereferencing of null pointers. See the discus-
sions of -Z and pointers in cc(1). (This is the complement of the -z option.)
+allowdups Allows multiple symbol definitions. By default, multiple symbol definitions that
occur between relocatable objects will result in a fatal error condition. This option
suppresses the error condition and allows the first symbol definition to be taken.
+[no]allowunsats
Control unsatisfied symbol error reporting. +allowunsats does not flag errors if
the resulting output file has unsatisfied symbols. This is the default for relocatable
links and shared library builds. +noallowunsats flags an error if the resulting
output file has unsatisfied symbols. This is the default for program files.
+as mode Control the address space model to be used by the kernel. Possible values for mode
are default, share_magic, exec_magic, shmem_magic, and mpas. The
default value is currently equivalent to share_magic. In order to set the mode to
any value other than the default, this option must be used in conjunction with the
-N option to ensure that the text and data segments are contiguous.
HP-UX 11i Version 2: August 2003 6 Hewlett-Packard Company Section 1435