HP-UX Reference (11i v2 03/08) - 1 User Commands A-M (vol 1)
l
ld(1) ld(1)
warning message and does a complete initial incremental link of the module.
On the initial incremental link, the linker processes the input object files and libraries in the same way as
the normal link. In addition to the normal linking process, the incremental linker saves information
about object files, global symbols, and relocations, and pads sections in the output file for expansion. On
subsequent incremental links, the linker uses timestamps to determine which object files have changed,
and updates those modules.
Under certain conditions, the incremental linker cannot perform incremental links. When this occurs, the
incremental linker automatically performs an initial incremental link to restore the process. In the fol-
lowing situations, the linker automatically performs an initial incremental link of the output file:
• Changed linker command line, where the linker command line does not match the command line
stored in the output file. (With the exceptions of the verbose and tracing options)
• Any of the padding spaces have been exhausted.
• Modules have been modified by the
ld -s or ld -x options or tools (for example, strip (1)).
• Incompatible incremental linker version, when you run a new version of the incremental linker on an
executable created by an older version.
• New working directory, where the incremental linker performs an initial incremental link if current
directory changes.
• Archive or shared libraries are added/removed to/from the linker command line.
• Object files are removed from the linker command line.
Use the
+help option or see the Linker and Libraries User’s Guide for more information.
Archive Library Processing
The incremental linker searches an archive library if there are unsatisfied symbols. It extracts all archive
members satisfying unsatisfied symbols and processes them as new object files. If an archive library is
modified, the linker replaces the modified archive library.
An object file extracted from an archive library in the previous link remains in the output load module
even if all references to symbols defined in the object file have been removed. The linker removes these
object files when it performs the next initial incremental link.
Shared Library Processing
In an initial incremental link, the linker scans shared library symbol tables and resolves unsatisfied sym-
bols the same way it would in a regular link. In incremental links, the linker does not process shared
libraries and their symbol tables at all and does not report shared library unsatisfied symbols. The detec-
tion of unsatisfied symbols is left to the The dynamic loader. If any of the shared libraries on the com-
mand line was modified, the linker reverts to an initial incremental link.
Performance
Performance of the incremental linker may suffer greatly if you change a high percentage of object files.
The incremental linker may not link small programs much faster, and the relative increase in size of the
executable is greater than that for larger programs.
Do not use the incremental linker to create final production modules. Because it reserves additional pad-
ding space, modules created by the incremental linker are considerably larger than those created in regu-
lar links.
EXTERNAL INFLUENCES
Environment Variables
LDOPTS
Arguments can be passed to the linker through the LDOPTS environment variable as well as on the
command line. The linker gets the value of LDOPTS and places its contents before any arguments
on the command line.
LPATH
Specifies default directories to search for library files. See the -l option.
LD_LIBRARY_PATH and SHLIB_PATH
Specifies, at runtime, directories to search for library files. See the -s option and the +help
option for the Online HP-UX Linker and Libraries User’s Guide for more information.
Section 1−−444 Hewlett-Packard Company − 15 − HP-UX 11i Version 2: August 2003