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

l
ld(1) ld(1)
+help Starts the help window utility HP-UX Linker and Libraries Online User Guide which
comes with some HP compilers. (You must be running the X window system and your
DISPLAY environment variable must be set to the name of your workstation or X ter-
minal.) For more information, refer to the HP-UX Linker and Libraries User’s Guide
manual. See manuals(5) for ordering information.
+init function_name
Specify the initializer functions to be invoked in reverse order, the order the functions
appear right to left on the command line. Initializers are called in depth-first order.
For example, when a shared library is loaded, the initializers in all its dependent
libraries are called first.
Use this option while building a shared library, an incomplete executable, or fully
bound executable. Functions specified with this option should take no arguments and
return nothing (void functions). Terminators are invoked only if
main() calls
exit(). They are not called if main()
calls return().
Do not use
+init with the -r option. (The linker ignores the
+init option.)
You can specify more than one initializer function on the command line with multiple
option-symbol pairs, that is, each function you specify must be preceded by the
+init option.
For more details on the initializer function, use the +help option or see the HP-UX
Linker and Libraries User’s Guide.
+[no]inputmmap
+inputmap
enables the feature to use mmap for reading the contents of shared
libraries during linking. This is the default behavior. Linking is usually much faster
when input shared libraries are mmapped, as compared to buffered reading from disk.
+noinputmmap disables the mmap feature and tells the linker not to mmap text
segments of input shared libraries. The linker uses buffered disk i/o (fread
)to
access information from the text segments of input shared libraries.
NOTE: Use
+noinputmmap only in cases where the link fails because of mmap
failures due to lack of memory, as it can significantly increase the link time due to
disk I/O.
+interp file Change the dld path to use the argument as the "interpreter" program instead of
the dld.sl.
+k Direct the linker to only create an executable if there were no errors encountered dur-
ing the link. If there were errors found (system errors or unresolved references), the
output file will be removed.
+mergeseg Enables shared library segment merging feature. See description of shared library
segment merging in the HP-UX Linker and Libraries User’s Guide. This enables all
the data segments of the shared libraries loaded at program startup to be merged.
This increases run-time performance by allowing the kernel to use larger size page
table entries.
+mmap Enables the feature to use mmap for writing the output data. This is the default
behavior. Linker enabled with mmap is much faster.
+n Causes the linker to load all object modules before searching any archive or shared
libraries. Then it searches the archive and shared libraries specified on the command
line in left to right order. Repeats the left to right search of the libraries on the com-
mand line until there are no more unsatisfied symbols, or the last search added no
new definitions. This option is useful if two libraries are specified that have symbol
dependencies on each other.
+nocopyobjdebug
Do not copy objdebug space. Use this option (with -r object files on the link line) to
suppress the default behavior of copying LINKMAP space to the executable file.
+noobjdebug
Override the +objdebug compiler option, and copy all debug information to the
executable file.
Section 1444 Hewlett-Packard Company 8 HP-UX 11i Version 1: September 2005