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)
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 func-
tions 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 multi-
ple 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.
+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
during 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 com-
mand line in left to right order. Repeats the left to right search of the libraries on
the command 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.
When used with
-g, +objdebug leaves debug information in the object files
instead of copying it to the executable file at link time, resulting in shorter link
times and smaller executables. The compile-time default, +noobjdebug,copies
the debug information to the executable file.
When you specify
-g when compiling, the compiler places symbolic debugging infor-
mation into the object files. By default, the linker calls pxdb which compacts this
debug information and copies it to the executable file. When +objdebug was used
at compile time, the linker leaves the debug information in the object files. To
debug the executable file, the HP WDB debugger must have access to the object
files. If you move the object files, use HP WDB’s objdir command to tell it where
the object files are. The +objdebug option reduces link time and the size of the
executable file by avoiding this copying of debug information.
The compile-time default is
+noobjdebug. If the linker detects any object files
that were compiled with +objdebug, it leaves the debug information in those files.
Any object files not compiled with +objdebug have their debug information copied
Section 1−−476 Hewlett-Packard Company − 8 − HP-UX 11i Version 2: September 2004