ld_ia(1)ld_ia(1)NAME
ld_ia: ld - link editor for Integrity systems
SYNOPSIS
The link editor
search] filename] epsym] symbol]... filename] x | file]... library]
[bucketsizetype] outfile] symbol]... symbol]... symbol]...
name] bind]... n]
offset] dir]... file] file] offset] mode] path_list] old‐
path:newpath] path] file] filename] filename] symbol]... sym‐
bol]... shared_library_path] function]... size] size] inter‐
nal_name] percentage] function]... filename] filename] sym‐
bol]... symbol]... shared_library_name] pagesize] pagesize]
size] name] size] flag] type]
flag] symbol]... ] n] size]
Remarks
This manpage describes on Integrity systems. For on PA-RISC systems,
see ld_pa(1).
DESCRIPTION
takes one or more object files or libraries as input and combines them
to produce a single (usually executable) file. In doing so it resolves
references to external symbols, assigns final addresses to procedures
and variables, revises code and data to reflect new addresses (a
process called "relocation") and updates symbolic debug information
when present in the file.
By default, produces an executable file that can be run by the HP-UX
loader (see exec(2)). Alternatively, the linker can generate a relo‐
catable file that is suitable for further processing by (see below).
It can also generate a shared library (see below). The linker marks
the output file non-executable if there are any duplicate symbols or
any unresolved external references remain.
may or may not generate an output file (see option) if any other errors
occur during its operation.
recognizes three kinds of input files:
· object files created by the compilers, assembler, or linker (also
known as files),
· shared libraries created by the linker, and
· archives of object files (called archive libraries).
An archive library contains a table of all the externally-visible sym‐
bols from its component object files. (The archiver command ar(1) cre‐
ates and maintains this index.) uses this table to resolve references
to external symbols.
processes files in the same order as they appear on the command line.
It includes code and data from an archive library element if and only
if that object module provides a definition for a currently unresolved
reference within the user's program (see It is common practice to list
libraries following the names of all simple object files on the command
line.
Code and data from shared libraries is never copied into an executable
program.
For 32-bit mode: is found at
For 64-bit mode:
is found at
You should include in a link.
For 32-bit mode: the dynamic loader is found at
For 64-bit mode:
the dynamic loader is found at
The dynamic loader attaches each required library to the process and
resolves all symbolic references between the program and its libraries.
NOTE: For information on linking secure programs with shared libraries,
see the section below.
The text segment of a shared library is shared among all processes that
use the library; each process using the library receives its own copy
of the data segment. If has been run on the executable that loads the
library, the text segment of a shared library is mapped privately for
each process running the executable. recursively examines the depen‐
dencies of shared libraries used by a program that was created by If
does not find a supporting shared library at the path recorded in the
dependency list of a shared library, and if the dependency is the
result of an argument used when the shared library was created, searchs
all the directories that it would search for a library that was speci‐
fied with (see and
Options
Specify whether shared or archive libraries are searched
with the option. The value of search should be
one of or This option can appear more than once,
interspersed among options, to control the
searching for each library. The default is to
use the shared version of a library if one is
available, or the archive version if not.
If either or is active, only the specified
library type is accepted.
If is active, the archive form is preferred, but
the shared form is allowed.
If is active, the shared form is preferred but
the archive form is allowed.
To create a statically-bound program, use the
option rather than
Create a shared library rather than a normal executable file.
Object files processed with this option must con‐
tain (PIC), generated by default by the compiler.
See the discussion of position-independent code
in cc(1), aCC(1), f90(1), as(1), and
Read ld options from a file.
Each line contains zero or more arguments sepa‐
rated by white space. Each line in the file,
including the last line, must end with a newline
character. A character implies that the rest of
the line is a comment. To escape a character,
use the sequence
Force definition of "common" symbols; that is, assign
addresses and sizes, for output. This option
also strips COMDAT information from the output.
This option is the default.
Instructs the linker to produce a dynamically
linked executable (a program which can use shared
libraries). This option is the complement of
If no shared libraries are linked in, the linker
builds a dynamically linked executable. However,
in PA32-bit mode using the option, if no shared
libraries are linked in, the linker builds a
statically bound executable (or archive bound
executable).
For dynamically linked executables, the dynamic
loader is involved in the process of loading the
executable, regardless of whether it was linked
with shared libraries. For (or statically bound)
programs, control does not pass to the dynamic
loader. See dld.so(5) for more information.
Set the default entry point address for the output file to be
that of
the symbol epsym. (This option only applies to
executable files.)
Preserve compiler generated relocation sections in output
file
Prior to writing the symbol table to the output file,
mark this name as "local" so that it is no longer
externally visible. This ensures that this par‐
ticular entry will not clash with a definition in
another file during future processing by If used
when building a shared library or program, this
option prevents the named symbol from being visi‐
ble to the dynamic loader.
You can specify more than one symbol on the com‐
mand line with multiple option-symbol pairs, that
is, each symbol you specify must be preceded by
the option.
Specify a mapfile that describes the output file memory map.
Please refer to guide and the for more informa‐
tion.
Search a library
or where x is one or more characters. The cur‐
rent state of the option determines whether the
archive or shared or version of a library is
searched.
Because a library is searched when its name is
encountered, the placement of a is significant.
By default, 32-bit libraries are located in
64-bit libraries are located in
If the environment variable is present in the
user's environment, it should contain a colon-
separated list of directories to search. These
directories are searched instead of the default
directories, but options can still be used.
If a program uses shared libraries, the dynamic
loader, for 32-bit, or for 64-bit, attempts to
load each library from the same directory in
which it was found at link time (see the and
options).
Search the library specified.
Similar to the option except the current state of
the option is not important. The library name
can be any valid filename.
Produce a load map on the standard output.
This option is ignored.
Specify the to optimize the hash table size (number of hash
buckets). The valid values for bucketsizetype
are:
Sets the number of hash buckets to half the num‐
ber of dynamic symbols in the library.
Sets the number of hash buckets to the highest
power of 2 that is less than the number of
dynamic symbols in the library.
Sets the number of hash buckets to the largest
prime number that is less than the number of
dynamic symbols in the library. (This option is
the default.)
Force the linker to create a fully archive bound program
(also called statically-bound executable).
Specify or (or equivalent startup code) on the
command line when you use this option.
This option is the complement of
For dynamically linked executables, the dynamic
loader is involved in the process of loading the
executable, regardless of whether it was linked
with shared libraries. For statically linked
programs, control does not pass to the dynamic
loader.
Create a dynamically linked program if shared libraries are
linked in.
If no shared libraries are linked in, the linker
creates a fully archive bound program. This
option is the default in compatibility mode (with
the options. See also the and options.
Produce an output object file named
outfile if is not specified).
This option is ignored.
Retain relocation information in the output file for subsequent
re-linking.
The command does not report undefined symbols.
This option cannot be used when building a shared
library or in conjunction with the or the incre‐
mental linking options.
Strip the output file of all symbol table, relocation,
and debug support information. (The strip(1)
command also removes this information.) This
option is incompatible with the option and the
option.
NOTE: Use of the option might impair or prevent
the use of a symbolic debugger on the resulting
program.
When building a shared library, causes the linker to resolve all
references
to the specified symbol to the symbol defined in
the library. This option is similar to but oper‐
ates on a per symbol basis.
You can specify more than one symbol on the com‐
mand line with multiple option-symbol pairs, that
is, each symbol you specify must be preceded by
the option.
symbol can also be a regular expression that
matches multiple symbol names. Regular expres‐
sions are described in regexp(5).
Print a trace (to standard output) of each input file as
processes it.
Enter symbol as an undefined symbol in the symbol ta‐
ble. The resulting unresolved reference is use‐
ful for linking a program solely from object
files in a library.
You can specify more than one symbol on the com‐
mand line with multiple option-symbol pairs, that
is, each symbol you specify must be preceded by
the option.
Display verbose messages during linking.
This option is equivalent to (see the option for
more information).
Suppress all warnings.
Strip local symbols from the output file.
This reduces the size of the output file without
impairing the effectiveness of object file utili‐
ties. This option is incompatible with the
option and the options. (The incremental linker
requires the parts of the output load module
which are stripped out with the option.)
NOTE: Use of the option might impair or prevent
the use of a symbolic debugger on the resulting
program.
Indicate each file in which
symbol appears. You can specify more than one
symbol on the command line with multiple option-
symbol pairs, that is, each symbol you specify
must be preceded by the option.
Arrange for run-time dereferencing of null pointers to produce a
signal. (This is the complement of the option.
is the default.)
This option is ignored and generates a warning message.
Select run-time binding behavior of a program using shared
libraries or
the binding preference in building a shared
library. The most common values for bind are:
Create direct link between symbol references and
shared libraries by recording the name of the
resolved shared library during symbol resolution.
This information is used during runtime to
quickly resolve symbols without searching through
all currently loaded libraries.
will implicitly turn on symbolic binding
(see and disable dependent shared library
processing.
Direct binding can be disable during run‐
time by setting the environment variable.
Bind addresses on first reference
rather than at program start-up time.
This is the default.
Mark the shared library so that it behaves as if
loaded with
flag to This does not affect the dependent
shared libraries.
Bind addresses of all symbols immediately upon
loading the library.
Commonly followed by to allow procedure
calls that cannot be resolved at program
start-up to be resolved on first refer‐
ence.
Since suppresses messages about unresolved
symbols, also specify to display those
messages.
See the example below.
Only record direct bind information to shared
libraries marked for
lazy loading. See
Mark the shared library so that an explicit
unload using
or returns success silently without
detaching the shared library from the
process. Subsequently, the shared library
handle is valid only for It stays invalid
for and until the next explicit load using
or
Disallow direct binding.
Only a "direct hint" is recorded for ref‐
erences to libraries marked for lazy load‐
ing. This is the default behavior.
If also using
for code symbols that could not be bound
at program startup, defer binding them
until they are referenced. See descrip‐
tion of above.
Since suppresses messages about unresolved
symbols, also specify to display those
messages.
Causes the search for a symbol definition to be
restricted to
those symbols that were visible when the
library was loaded.
Used only when building a shared library.
This option causes all references in a
shared library to be resolved internally
if possible. Such internally-resolved
symbols are still externally visible.
By default (without the option), refer‐
ences are either resolved to a symbol def‐
inition in the same compilation unit or to
the most visible definition. The first
load module or shared library) that
exports that symbol contains the most vis‐
ible definition. More than one load mod‐
ule can define and export the same symbol.
References to a symbol in a shared library
can be resolved to a definition in another
shared library even if that symbol is
defined in the shared library. You can
use this option to enforce that all refer‐
ences in the shared library use their own
definitions, if defined in the shared
library.
See the and options for more information
about using with those options.
Display verbose messages when binding symbols.
This is the default except when is speci‐
fied. In that case, must be explicitly
specified to get verbose messages.
Use the option or see the manual for more infor‐
mation on the uses of binding modes.
This option is ignored and generates a warning message.
Set (in hexadecimal) the starting address of the data segment.
This option is useful with kernel and embedded
applications. The default address for 64-bit
mode is 0x6000000000000000 and the default
address for 32-bit mode is 0x40008000.
Mark all symbols defined by a program for export
to shared libraries. In a mode link, marks only
those symbols that are actually referenced by a
shared library seen at link time. In a link, all
symbols are exported by default, so is not neces‐
sary to make symbols visible. However, it has an
additional side effect of identifying all
exported symbols as necessary, so that they will
not be removed when using dead code elimination
Force load the archive library.
Equivalent to
This option is ignored and generates a warning.
This option is accepted and ignored.
Strip all unloadable data from the output file.
This option is typically used to strip debug
information and is incompatible with the option.
NOTE: Use of the option might impair or prevent
the use of a symbolic debugger on the resulting
program.
Instrument the code to collect profile information upon execu‐
tion.
When an instrumented program is executed, a pro‐
file database file is output (by default, named
The profile data gathered during program execu‐
tion can be used in conjunction with the option.
The default instrumenter is the dynamic instru‐
menter but the option can be used to invoke the
static instrumenter instead.
This option should not be used with the or
options.
NOTE: If using the recommended method to instru‐
ment your programs is to use your compiler's
option, rather than the option. If you invoke
the linker directly, you must pass the and
options to the linker. If you have both an
instrumented shared library and an instrumented
shared executable that you want to link with that
library, you must include the and options in
addition to the options. If using the default or
no additional linker options are needed.
Search for or in dir before looking in default locations.
You can specify more than one directory, but each
must be preceded by the option. The option is
effective only if it precedes the option on the
command line.
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.
Turn on linker optimizations.
Currently the optimization includes the removal
of dead procedures.
is passed to the linker by the compilers when the
compiler option is selected.
This option is incompatible with the option.
For more details on linker optimizations use the
option or see the manual.
Examine the profile database file produced by an instrumented
program
(see the option) to perform profile based opti‐
mizations on the code. This option should not be
used with the option.
Reorder debuggable functions.
This option is enable by default.
Reordering is based on link order file produced
from by default. If you specify the option, the
linker uses the specified link order file,
instead of for reordering.
This option is incompatible with
Save link order file generated by
during linking with option into user-specified
file. This option is incompatible with the
option.
Indicate to the linker to use the specified file for the link
order file
instead of generating it using This option is
incompatible with the option.
This option is ignored.
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 option is specified, the
default is 0x1000.
This option is ignored and generates a warning message.
Same as option.
Output a message giving information about the version of
being used.
This is the default.
Allow run-time dereferencing of null pointers.
See the discussions of and pointers in cc(1).
(This is the complement of the option.)
Force storage allocation for hidden "common" symbols in
output. This is similar to the option, which
allocates storage for all "common" symbols. If
is specified in combination with the option, will
take precedence.
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.
Control unsatisfied symbol error reporting.
does not flag errors if the resulting output file
has unsatisfied symbols. This is the default for
relocatable links and shared library builds.
flags an error if the resulting output file has
unsatisfied symbols. This is the default for
program files.
Control the address space model to be used by the kernel.
Possible values for mode are and The default
value is currently equivalent to In order to set
the mode to any value other than the default,
this option must be used in conjunction with the
option to ensure that the text and data segments
are contiguous.
Specify a colon-separated list of directories
to be searched at program run-time to locate
shared libraries needed by the executable output
file that were specified with either the or
options. This list of directories becomes the
embedded path. If the option appears more than
once, the default is to record the last one spec‐
ified. Use to change this default behavior.
If either is not used or if you specify a single
colon as the argument, builds an embedded path
using all the directories specified by the
option(s) and the environment variable (see the
option).
This option is ignored.
Turn on compatibility mode in the linker — mimic
behavior of PA-RISC 32-bit links.
[Disable] Enable concatenation of search path specified
using
When you use the
linker option to override the effect of the com‐
piler option, the linker omits the information
from the object files (in addition to copying
over the debug information to the output file).
However, if any object files were the result of
previous links, the information from these files
is not omitted. The option, when used in con‐
junction with the option, forces the linker to
omit information from all object files, including
objects generated with the option. is the
default.
is the default.
Include any paths that are specified with in the
embedded path, unless you specify the option. If
you use only the path list specified by is in the
embedded path.
The option removes all library paths that were
specified with the option from the embedded path.
The linker searches the library paths specified
by the option at link time. At run time, the
only library paths searched are those specified
by the environment variables and library paths
specified by the linker option, and finally the
default library paths.
Used together with the
option, this option specifies that file should be
used as the profile database file. The default
value is See the discussion of the environment
variable for more information. This option is
incompatible with the option.
Output information on procedures that were eliminated by proce‐
lim.
Equivalent to
Valid for executable and shared library links with
option. Instructs the linker to dump all debug
information in a separate file specified in file‐
name and not include them in the executable. The
HP debugger (WDB ver 6.2 and above) supports the
separate debug information file during debugging.
This option is useful to create an executable
without debug information and retain the debug
information for later use. It also helps to
reduce the size of the executable.
Valid for executables and shared library links.
Instructs the linker to dump all external symbols
into the file specified by filename. This dumps
all external symbols referred to within the load
module or shared library) but not defined within
the load module into the specified file. You can
pass this file back to your compiler using the
option. For more information, see the compiler
options, and
When building a shared library or program,
mark the symbol for export to the dynamic loader.
Only symbols explicitly marked are exported.
When building a shared library, calls to symbols
that are not exported are resolved internally.
If you use the or option with references to the
symbol specified are resolved internally if
defined. The runtime behavior may be different
from using alone.
You can specify more than one symbol on the com‐
mand line with multiple option-symbol pairs, that
is, each symbol you specify must be preceded by
the option.
This option is similar to the
option in that it exports a symbol. However,
unlike the option, the option does not alter the
visibility of any other symbol in the file. When
building a mode executable, by default exports
only those symbols that are actually referenced
by a shared library seen at link time.
The option when specified with has the effect of
exporting the specified symbol without hiding any
of the symbols exported by default.
In a mode link, all symbols are exported by
default, so is not necessary to make a symbol
visible. However, it has the additional side
effect of identifying the symbol as necessary, so
that it will not be removed when using dead code
elimination The option still retains its export
behavior if an option such as is also given.
You can specify more than one symbol on the com‐
mand line with multiple option-symbol pairs, that
is, each symbol you specify must be preceded by
the option.
Instruct the linker to run the fastbind tool
on the executable it has produced. The exe‐
cutable should be linked with shared libraries.
For more details about fastbind(1), use the
option, or see the manual. This option is incom‐
patible with the option.
Pass the option to the fastbind tool. For more details
about fastbind(1), use the option, or see the
manual. This option is incompatible with the
option.
Enables the shared library filter mechanism, which allows you to
divide a large library into a "filter" and sev‐
eral "implementation" libraries for more effi‐
cient organization of shared libraries.
shared_library_path specifies the location of the
filter library. See the for more information.
Specify the terminator function to be invoked in forward order,
the order
the functions appear left to right on the command
line.
You can specify more than one terminator function
on the command line with multiple option-symbol
pairs, that is, each function you specify must be
preceded by the option.
The default is The option loads all object files from archive
libraries. loads only the required object files
from archive libraries. The selected mode,
either explicitly or by default, remains in
effect until you explicitly change it.
Enable the global symbol table hash mechanism,
used to look up values of symbol import/export
entries. The and related options provide perfor‐
mance enhancements through use of global symbol
table which improves searching for exported sym‐
bols. See dld.so(5) and the for more informa‐
tion.
This option is ignored.
Request a particular hash array size using the global symbol
table hash mechanism. The default value is 1103.
The value can be overridden at runtime by setting
the environment variable to the value prime num‐
ber. You can set the value using size file.
When building a shared library, record
internal_name as the name of the library. When
the library is used to link another executable
file (program or shared library), this inter‐
nal_name is recorded in the library list of the
resulting output file instead of the pathname of
the input shared library. That is, if is not
used, the shared library does not have an inter‐
nal name and when an executable is built with the
shared library, the linker records the library
name that it looks at.
If more than one option is seen on the link line,
the linker uses the first one and emits a warning
message.
Start the help browser utility
which comes with the HP-UX operating system. For
more information, see to the manual. See manu‐
als(5) for ordering information.
Prevent all the symbols from being exported unless explicitly
exported
with the This option marks all symbols as "local"
in the symbol table. See also the and options.
Specify incremental linking.
If the output file does not exist, or if it was
created without the option, the linker performs
an initial incremental link. The output file
produced is suitable for subsequent incremental
links. The incremental link option is valid for
both executable and shared library links.
The following options are incompatible with the
option. If you specify one of the following
incompatible option with the linker emits a warn‐
ing message and ignores the option.
· The option: create a relocatable object file.
· Strip options: and strip the output file.
· Optimization options: file, name, and
The following options are compatible with the
option with limitations:
·
Set the origin for the data and text segments.
If you change the offset after the initial
incremental link, the linker performs an ini‐
tial incremental link automatically.
·
Provide a non-default mapfile. The user speci‐
fied mapfile specifications are permitted with
the option. But you should not modify the map‐
file after the initial incremental link. If
the mapfile is modified after the initial link,
an initial incremental link is performed auto‐
matically.
Suppress incremental-linking related warnings.
By default, the linker issues all incremental-
linking related warnings. This option is ignored
if used without or
Control the amount of padding
percentage the incremental linker allocates, rel‐
ative to sizes of object file structures being
padded. By default the linker allocates less
than 20% of padding space. This option is
ignored if used without or
Perform an initial incremental link, regardless of the output
load
module.
In certain situations (for example, internal pad‐
ding space is exhausted) the incremental linker
is forced to perform an initial incremental link.
The option allows you to avoid such unexpected
initial incremental links by periodically
rebuilding the output file.
Specify the initializer function to be invoked in reverse order,
the
order the functions appear right to left on the
command line.
You can specify more than one initializer func‐
tion on the command line with multiple option-
symbol pairs, that is, each initializer function
you specify must be preceded by the option.
Specify which instrumenter to use.
Only or are recognized. Default is
If is specified, the linker invokes automati‐
cally. If is specified, is automatically invoked
by the dynamic loader when the program is exe‐
cuted.
Change the path to use the program specified by filename for
the "interpreter" program as the dynamic loader.
This is useful when using special versions of for
debugging.
The default path for 32-bit programs is: and for
64-bit programs is:
Used only when building a shared library.
This will create a shared library that can be
used for interposition. When resolving refer‐
ences for an application with direct bind infor‐
mation (see the dynamic loader will search inter‐
poser libraries first. If the symbol cannot be
resolved to any interposing libraries, the direct
binding information will be used.
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.
Enable [disable] lazy loading of shared libraries.
For libraries, loading is deferred until a refer‐
ence is made to that library during execution.
Both the and options may appear on the link line
at the same time. The mode that is specified,
either explicitly or by default, remains on for
all subsequent libraries on the link line until
the next occurrence of the one of these two
options.
Libraries satisfying one or more of the following
conditions are ineligible for lazy loading:
· is a filter library
· is accessed via a data reference from another
module
· is accessed via an indirect function call
The linker will silently convert such libraries
into libraries.
Dependent libraries of shared libraries will not
be processed during link time, unless they are
explicitly specified on the link line.
Lazy loading can be disabled at runtime by set‐
ting the environment variable.
Sets a flag in the executable which causes the dynamic loader to
merge
all data segments of shared libraries loaded at
startup time into one block. Data segments for
each dynamically loaded library will also be
merged with the data segments of dependent
libraries. This increases run-time performance
by allowing the kernel to use larger size page
table entries.
Enables the feature to use
for writing the output data. This is the default
behavior. Linker enabled with is much faster.
Cause the linker to load all object modules before searching
any archive or shared libraries. The linker then
searches the archive and shared libraries speci‐
fied on the command line in left to right order.
It 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.
Pads the data segment with zeros, so that the data segment can
be mapped
with a single call to at runtime. Normally, data
segments require one call for file-backed storage
and a second call for blank static storage (bss).
Use of this option increases your output file
size.
Do not use the default memory map.
You must supply a mapfile through the linker
option.
Disable the default linker behavior of the
option to create the .dynhash section for exe‐
cutables or shared libraries. Use this option to
eliminate generation of pre-computed hash table
information for a library or an executable that
is rarely used with the global symbol table
lookup scheme or for which the overhead of stor‐
ing pre-computed hash values is too high. This
option has no effect when used with the option.
Instruct the dynamic loader to ignore the dynamic path searching
environment
variables, and at runtime. By default, or if you
specify the option, the dynamic loader looks at
the environment variables, that is, the environ‐
ment variables are enabled. If you specify the
option or the option, the option takes effect and
the dynamic loader ignores the variables (the
environment variables are disabled). See the or
options.
You can display the status of this option in an
executable or shared library from the "shared
library dynamic path search" output of the com‐
mand. See chatr(1) for more information. Gener‐
ally, this option is used for secure programs.
Disables the feature and uses the normal buffering method to
write into the output file. NOTE: Do not use
unless in cases like the system has very low mem‐
ory and the linker fails because of this.
Override the compiler option, and copy all debug information
to the executable file. When you use the com‐
piler option with any of the options, linker
leaves the debug information in the object files
instead of copying it over to the output file.
You can use the option at link time to force the
linker to copy the debug information over to the
output file and negate the effect of the compiler
option. See also
Do not remove symbol when using dead code elimination This
option can be used for hidden symbols as well as
exported symbols.
You can specify more than one symbol on the com‐
mand line with multiple option-symbol pairs, that
is, each symbol you specify must be preceded by
the option.
With the option, allow procedures to be positioned inde‐
pendently. The default is to merge all proce‐
dures into a single section.
This option is ignored.
The compiler option
is the default. causes the compiler to generate
part of the debug information even when the com‐
piler option is not specified. The default
option also causes part of the debug information
to be always copied over to the executable file,
resulting in larger executables. enables the
users to profile programs using tools like and
even in the absence of compilation.
The linker option can be used to override the
default compiler option, and strip these debug
information during link time. can also be used
with to fully enforce the mode (i.e., leaving the
debug information in the object files).
When building a shared library with
causes the linker to exclude the specified symbol
from symbol resolution.
You can specify more than one symbol on the com‐
mand line with multiple option-symbol pairs, that
is, each symbol you specify must be preceded by
the option.
symbol can also be a regular expression that
matches multiple symbol names. Regular expres‐
sions are described in regexp(5).
Ignore debug information from non-objdebug objects or
archives and proceed in mode. If you are debug‐
ging only files compiled with the option, can
improve link time by instructing the linker to
bypass the processing of debug information from
files compiled with
(Use only before the
option or the name of a shared library.) Cause
the linker to add before the shared library name
in the shared library list and set the flag for
the output module. At runtime, the dynamic
loader determines the current directory of the
parent module (object module, shared library, or
executable) and replaces for that directory name.
For example,
While the option is available, the recommended
way to specify is in the embedded path with the
option, for example,
For more details on use the option or see the
manual.
Pads the data segment to a multiple of
pagesize with zeros. This can improve page allo‐
cation, thus reduce TLB misses by allowing the
kernel to allocate fewer, larger data pages. Use
of this option increases your output file size.
Pads the text segment to a multiple of
pagesize with zeros. This can improve page allo‐
cation, thus reduce TLB misses by allowing the
kernel to allocate fewer, larger data pages. Use
of this option increases your output file size.
Request a particular virtual memory page size that should be
used for data.
Sizes of and are supported.
A size of allows the kernel to choose what page
size should be used. A size of results in using
the largest page size available. The actual page
size may vary if the requested size cannot be
fulfilled.
This option is ignored.
With the option, specify that name should be used as the
look-up name in the profile database file. The
default is the basename of the output file (spec‐
ified by the option.) This option is incompati‐
ble with the option.
Request a particular virtual memory page size that
should be used for instructions. See the option
for additional information.
This option is ignored.
Specifies the size of the profiling sample counter buckets.
Valid values are 16 or 32. See gprof(1) for more
details.
This option turns on the linkage table protection mode.
When this option is used, the linker aligns the
linkage table within page boundaries so that no
other data resides in the same page. At runtime,
the pages containing the linkage table are marked
READ_ONLY.
This option turns on immediate binding. For more
information about immediate binding, see binding
under option
The options incompatible with this option are:
and
This option is the default.
Indicate that at run-time, the dynamic loader can
use the environment variables and to locate
shared libraries needed by the executable output
file that allow dynamic library searching.
Shared libraries that allow dynamic library
searching either contain an internal name without
the slash character (for example, the base name
of the shared library pathname) or have no inter‐
nal name and were specified with either or or
just the base name of the shared library path‐
name. The environment variables should be set to
a colon-separated list of directories.
In compatibility mode using the option, if both
and are used, their relative order on the command
line indicates which path list is searched first
(see the option). In standard mode (default mode
or using the option), the order of and does not
affect the dynamic loader search order and the
environment variables are always searched first.
This option will cause the paths specified in
(embedded path) to be used before the paths spec‐
ified in or in searching for shared libraries.
This changes the default search order of and
(embedded path).
This option is the default.
Turn on standard mode of the linker. This option
is the complement of the option. Options set on
with this option are: Options set off or ignored
when this option is specified are:
Do not output the unwind table.
This creates smaller executable sizes. Use this
option if you do not need the unwind table for
debugging or aC++ exception handling.
NOTE: Use of the option might impair or prevent
the use of a symbolic debugger on the resulting
program.
This option is ignored.
This option is ignored.
This option is ignored.
Enable [disable] printing a list of unsatisfied
symbols used by shared libraries. The default
behavior in shared library build is and the
default in executable build is Some unsatisfied
symbols reported by the linker are not required
at run time because the modules which reference
the symbols are not used.
Produces verbose output about the link operation.
type can have the following values:
Dumps all of the information from the options.
Same as
Dump info about each object file loaded.
Dump info about the size of the heap used by a
link.
Dump info about libraries searched.
Dump info about sections that have been elimi‐
nated by the
option
Dump info about each input section added to the
output file.
Dump info about global symbols referenced/defined
from/in the input files.
Specify how the environment for floating-point
operations should be initialized at program
start-up. By default, modes are specified by the
IEEE floating-point standard: all traps dis‐
abled, gradual underflow, and rounding to near‐
est. The option supports the following modes
(upper case flag enables; lower case flag dis‐
ables):
Enable sudden underflow (flush to zero) of denor‐
malized values.
Trap on floating-point operations that produce
inexact results.
Trap on Denormal|Unnormal operand floating-point
operation.
Trap on floating-point overflow.
Trap on floating-point underflow.
Trap on invalid floating-point operations.
Trap on divide by zero.
Enable rounding upward (toward +Infinity).
Enable rounding downward (toward -Infinity).
Enable rounding toward zero (truncate, chop).
Enable rounding to nearest (the default).
More than one mode can be specified with a comma
separated list. For example:
specifies sudden underflow, trapping on overflow
and invalid, and rounding toward zero. The com‐
mas and the space between and the modes may be
omitted. Thus, is equivalent to
To dynamically change these settings at run-time,
see fesettrapenable(3M), fesetflushtozero(3M),
and fesetround(3M).
Specify the name of the initializer function when building a
shared library.
A shared library may have multiple initializers
specified. Initializers are executed in the
order that they are specified on the command
line.
You can specify more than one initializer func‐
tion on the command line with multiple option-
symbol pairs, that is, each initializer you spec‐
ify must be preceded by the option.
This option is supported for compatibility. Use
of the and options is recommended. For more
details on the initializer function, use the
option or see the manual.
Enable [disable] dynamic optimization for this load module. The
default
setting allows the run-time environment to enable
or disable dynamic optimization. This is a
unique setting that is only used when neither
option is specified.
This option is ignored.
Enable [disable] the elimination of procedures and data that are
not
referenced by the application. The default is
Procedure and data elimination can occur at any
optimization level, including level 0. The elim‐
ination occurs on a per section basis; the sec‐
tion is removed only if all procedures/data in
the section are unreferenced. For more details
use the option or see the manual. This option is
incompatible with the option.
Note that compilers may pass to the linker for
higher optimization levels; refer to compiler
documentation for detail.
This option is ignored and generates a warning message.
Instructs the interprocedural optimizer driver to pass the first
n percent of the object files to the high level
optimizer for interprocedural optimizations such
as inlining. This option is designed to work at
optimization level 4 in the presence of dynamic
profiling.
This option is accepted and ignored.
This option is accepted and ignored.
This option is ignored and generates a warning message.
Defaults
Unless otherwise directed, names its output file The option overrides
this. The default is to create a dynamically linked program unless you
specify the option. The default state of is to search shared libraries
if available, archive libraries otherwise. The default bind behavior
is
The default value of the option is
The +objdebug Compiler Option
The compiler option, when used with any of the 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 option, the HP WDB debugger
must have access to the object files. (Note that for object files
built with the option, the individual object files must be available to
the debugger.) If you move the object files, use HP WDB's command to
specify the location of these objects.
The compiler option causes the debug information to be copied over to
the output file. is the compile-time default.
If the linker detects any object files that were compiled with the
option, it leaves the debug information in those files. Any object
files not compiled with have their debug information copied into the
output file.
You can use the option at link time to continue to place the debug
information into the output file, even if some objects were compiled
with
Incremental linking
In the edit-compile-link-debug development cycle, link time is a sig‐
nificant component. The incremental linker (available through the and
can reduce the link time by taking advantage 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 regu‐
lar 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 As object files increase in size during successive incremen‐
tal links, the incremental linker can exhaust the available padding.
If this occurs, it displays a warning message and does a complete ini‐
tial 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 incre‐
mental links. When this occurs, the incremental linker automatically
performs an initial incremental link to restore the process. In the
following 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 excep‐
tions of the verbose and tracing options)
· Any of the padding spaces have been exhausted.
· Modules have been modified by the or 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 ver‐
sion.
· New working directory, where the incremental linker performs an ini‐
tial 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 option or see the for more information.
The incremental linker searches an archive library if there are unsat‐
isfied 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.
In an initial incremental link, the linker scans shared library symbol
tables and resolves unsatisfied symbols the same way it would in a reg‐
ular 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 detection of unsatisfied symbols is
left to 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 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 padding space, modules created by the
incremental linker are considerably larger than those created in regu‐
lar links.
Security Restrictions
On a system that supports fine-grained privileges, if a process gains
any privileges from the binary's extended attributes, dynamic path
lookup is disabled. Similarly, on a system that supports compartments,
if a process changes compartment due to the binary's extended
attributes, the dynamic path lookup is disabled.
See setfilexsec(1M) on how to set extended attributes on a binary. See
privileges(5) and compartments(5) for more information on privileges
and compartments. Secure programs are programs that are commonly run
by privileged users, such as or programs that run with elevated privi‐
leges due to or protection. Yous should take special precautions when
linking secure programs that use shared libraries. The default linker
behavior may be sufficient for secure PA-RISC 32-bit applications, but
not for PA-RISC 64-bit or Integrity system applications.
Secure programs should be linked with the option to disable the use of
and for locating shared library dependencies. Secure programs should
also link with to prevent the automatic construction of an embedded
search path based on search directories specified with options. Most
directories searched at link time don't need to be searched at run
time, and if these directories are specified as relative paths, they
expose the program to the same security risks as the use of and
Programs built with are linked as if and were specified. However,
additional PA-RISC 32-bit compatibility features are also enabled by
Normal programs that depend on libraries that only exist in a directory
specified in or must not be linked with and if is used, must also be
used to enable searching and Programs that depend on or cannot be pro‐
tected as or programs.
uses the dynamic path lookup (with and only if the following conditions
are satisfied:
That is, if the or does not match its effective counterpart, does not
check the directories specified in and which causes the runtime error
"".
EXTERNAL INFLUENCES
Environment Variables
Arguments can be passed to the linker through the environment variable
as well as on the command line. The linker gets the value of and
places its contents before any arguments on the command line.
Specifies default directories
to search for library files. See the option.
Specifies, at runtime, directories
to search for library files. See the option and the option for
the for more information.
The following internationalization variables affect the execution of
Determines the locale category for native language, local customs and
coded character set in the absence of and other environment variables.
If is not specified or is set to the empty string, a default of (see
lang(5)) is used instead of
Determines the values for all locale categories and has precedence over
and other environment variables.
Determines the locale that should be used to affect the format
and contents of diagnostic messages written to standard error.
Determines the locale category for numeric formatting.
Determines the locale category for character handling functions.
Determines the location of message catalogs for the processing
of
If any internationalization variable contains an invalid setting,
behaves as if all internationalization variables are set to See envi‐
ron(5).
In addition, the following environment variable affects
Specifies a directory for temporary files (see tmpnam(3S)).
Specifies the pathname of the browser to display the
when you use the option.
RETURN VALUES
returns the following values:
Successful completion.
The link is successful.
Failure.
An error has occurred.
EXAMPLES
Link part of a C program for later processing by (Note the suffix for
the output object file; this is an HP-UX convention for indicating a
linkable object file):
Link a shared bound program in standard mode. Note that is not speci‐
fied because for shared links, it is no longer necessary.
Link a simple Fortran program to use with a symbolic debugger (see
wdb(1)). Because the option is not specified on the command line, the
output file name is
Create a shared library:
Create a shared library with an internal name, and this shared library
allows dynamic library searching:
If you do not use the shared library does not have an internal name.
The linker does not check whether is a symbolic link. It records the
library name that it looks at, if it does not have the internal name.
Add before the shared library name in the shared library list.
WARNINGS
recognizes several names as having special meanings. The symbol is
reserved by the linker to refer to the first address beyond the end of
the program's address space. Similarly, the symbol refers to the first
address beyond the initialized data, and the symbol refers to the first
address beyond the program text. The symbols and are also defined by
the linker, but only if the program contains a reference to these sym‐
bols and does not define them (see end(3C) for details).
The linker treats a user definition of any of the symbols listed here
as an error.
Through its options, the linker gives users great flexibility. How‐
ever, those who invoke the linker directly must assume some added
responsibilities.
There is no guarantee that the linker will pick up files from archive
libraries and include them in the final program in the same relative
order that they occur within the library.
The linker emits warnings wherever it detects any compatibility issues.
Among other things, these issues include architectural ones, as well as
functionality that may change over time. Some of these include:
· Checking of unsatisfied symbols by the linker, which some‐
times skips certain object files from an archived library.
This warning is only given if the option is also provided.
As noted in the section, this release of the linker no longer supports
certain options.
The linker accepts the following options and issues a warning message.
·
·
·
·
·
·
·
·
The following options are supported for compatibility. They are
accepted and ignored:
·
·
·
· (Ignored only in 64-bit mode)
·
·
·
·
·
·
·
·
·
·
·
·
AUTHOR
was developed by AT&T, the University of California, Berkeley, and HP.
FILES
32-bit system archive and shared libraries
64-bit system archive and shared libraries
output file
32-bit dynamic loader
64-bit dynamic loader
32-bit run-time startup file
64-bit run-time startup file
32-bit millicode library automatically searched by
64-bit millicode library automatically searched by
64-bit millicode library automatically searched by ld for embedded sys‐
tems
message catalog
temporary files
file containing profile data generated by running an
instrumented executable
program for creating the procedure link order from
a profile database file created by an instrumented executable;
forked by the option
static instrumenter to instrument an executable or a shared library.
It is invoked if you use the option.
SEE ALSO
Profiling and Debugging Tools
adb(1) absolute debugger
gprof(1) display call graph profile data
prof(1) display profile data
wdb(1) C, C++, Fortran symbolic debugger
System Tools
aCC(1) invoke the HP-UX aC++ compiler
ar(1) create archived libraries
cc(1) invoke the HP-UX C compiler
chatr(1) change program's internal attributes
elfdump(1) dump information contained in an object file
exec(2) execute a file
f90(1) invoke the HP-UX Fortran 90 compiler
fastbind(1) invoke the fastbind tool
lorder(1) find ordering relation for an object library
nm(1) print name list of object file
size(1) print section sizes of object files
strip(1) strip symbol and line number information from an
object file
Miscellaneous
a.out(4) assembler, compiler, and linker output
ar(4) archive format
setfilexsec(1M)crt0(3) execution startup routine
compartments(5)privileges(5)dld.so(5) dynamic loader
end(3C) symbol of the last locations in program
uld.so(5) microloader
Texts and Tutorials
(Use the option)
(See manuals(5) for ordering information)
STANDARDS CONFORMANCEIntegrity Systems Onlyld_ia(1)