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

l
ld_ia(1) ld_ia(1)
(For Itanium(R)-based Systems)
presence of dynamic profiling.
+Oselectivesize
size
This option is accepted and ignored.
+OselectiveO3
This option is accepted and ignored.
+Ostaticprediction
This option is ignored and generates a warning message.
Defaults
Unless otherwise directed,
ld names its output file
a.out. The -o option overrides this. The default
is to create a dynamically linked program unless you specify the
-noshared option. The default state of
-a is to search shared libraries if available, archive libraries otherwise. The default bind behavior is
deferred.
The default value of the
-Z/-z
option is -Z.
The +objdebug Compiler Option
The
+objdebug compiler option, when used with any of the
-g options, causes the debug information to
be left in the object files instead of being placed in output file. This results in shorter link times and
smaller output files.
To debug the load modules compiled with
+objdebug option, the HP WDB debugger must have access to
the object files. (Note that for object files built with the -r option, the individual object files must be
available to the debugger.) If you move the object files, use HP WDB’s
objdir command to specify the
location of these objects.
The
+noobjdebug compiler option causes the debug information to be copied over to the output file.
+objdebug is the compile-time default.
If the linker detects any object files that were compiled with the
+objdebug option, it leaves the debug
information in those files. Any object files not compiled with +objdebug have their debug information
copied into the output file.
You can use the
+noobjdebug option at link time to continue to place the debug information into the
output file, even if some objects were compiled with +objdebug.
Incremental linking
In the edit-compile-link-debug development cycle, link time is a significant component. The incremental
linker (available through the
+ild and +ildrelink options) can reduce the link time by taking advan-
tage of the fact that you can reuse most of the previous version of the program and that the unchanged
object files do not need to be processed. The incremental linker allows you to insert object code into an
output file (executable or shared library) that you created earlier, without relinking the unmodified object
files. The time required to relink after the initial incremental link depends on the number of modules you
modify.
The linker performs the following different modes of linking:
normal link: the default operation mode in which the linker links all modules.
initial incremental link: the mode entered when you request an incremental link, but the output
module created by the incremental linker does not exist, or it exists but the incremental linker is
unable to perform an incremental update.
incremental link: the mode entered when you request an incremental link, an output module created
by the incremental linker exists, and the incremental linker does not require an initial incremental
link.
Incremental links are usually much faster than regular links. On the initial link, the incremental linker
requires about the same amount of time that a normal link process requires, but subsequent incremental
links can be much faster than a normal link. A change in one object file in a moderate size link (tens of
files, several megabytes total) normally is about 10 times faster than a regular
ld link. The incremental
linker perform as many incremental links as allocated padding space and other constrains permit. The
cost of the reduced link time is an increase in the size of the executable or shared library.
The incremental linker allocates padding space for all components of the output file. Padding makes
modules larger than those modules linked by
ld. As object files increase in size during successive incre-
mental links, the incremental linker can exhaust the available padding. If this occurs, it displays a
HP-UX 11i Version 2: September 2004 14 Hewlett-Packard Company Section 1463