- -a search
Specify whether shared or archive libraries are searched
with the
-l
option.
The value of
search
should be one of
archive,
shared,
archive_shared,
shared_archive,
or
default.
This option can appear more than once,
interspersed among
-l
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
archive
or
shared
is active, only the specified library type is accepted.
If
archive_shared
is active, the archive form is preferred, but
the shared form is allowed.
If
shared_archive
is active, the shared form is preferred but the archive form is allowed.
- -b
Create a shared library rather than a normal executable file.
Object files processed with this option must contain
position-independent code
(PIC).
See the discussion of
PIC
in
cc(1),
CC(1)
(part of the optional C++ compiler documentation),
f77(1),
pc(1),
as(1),
and
Linker and Libraries Online User Guide.
- -c filename
Read ld options from a file.
Each line contains zero or more arguments separated 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
##.
- -d
Force definition of ``common'' storage; that is, assign addresses and
sizes, for
-r
output.
- -e epsym
Set the default entry point address for the output file to be that of
the symbol
epsym.
(This option only applies to executable files.)
- -h symbol
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 particular entry will not clash
with a definition in another file during future processing by
ld.
More than one
symbol
can be specified, but
-h
must precede each one.
If used when building a shared library or program,
this option prevents the named symbol from being visible
to the dynamic loader.
- -lx
Search a library
libx.a
or
libx.sl,
where
x
is one or more characters.
The current state of the
-a
option determines whether the archive
(.a)
or shared
(.sl)
version of a library is searched.
Because a library is searched when its name is encountered,
the placement of a
-l
is significant.
By default, 32 bit libraries are located in
/usr/lib
and
/usr/ccs/lib.
64 bit libraries are located in
/usr/lib/pa20_64.
If the environment variable
LPATH
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
-L
options can still be used.
If a program uses shared libraries, the dynamic loader
/usr/lib/dld.sl
for 32 bit or
/usr/lib/pa20_64/dld.sl
for 64 bit
will attempt to load each library from the same directory
in which it was found at link time (see the
+s
and
+b
options).
- -l: library
Search the library specified. Similar to the
-l
option except the current state of the
-a
option is not important. The library name
can be any valid filename. (Note that previous
releases required that the library name
contain the prefix
lib
and end with a suffix of
.a
or
.sl.)
- -m
This option produces a load map on the standard output.
- -n
This option is accepted but ignored by the 64 bit
ld.
Generate an
executable output file with file type
SHARE_MAGIC.
This is the default.
This option is incompatible with
-N
and
-q.
- -o outfile
Produce an output object file named
outfile
(a.out
if
-o
outfile
is not specified).
- -q
This option is ignored for 64 bit links. Generate an executable output file
with file type
DEMAND_MAGIC.
This option is incompatible with
-n,
-N,
and
-Q.
- -r
Retain relocation information in the output file for subsequent re-linking.
The
ld
command does not report undefined symbols.
This option cannot be used when building a shared library (
-b
) or in conjunction with
-A.
- -s
Strip the output file of all symbol table, relocation,
and debug support information.
This might impair or prevent the use of a symbolic debugger
on the resulting program.
This option is incompatible with
-r.
(The
strip(1)
command also removes this information.)
- -t
Print a trace (to standard output) of each input file as
ld
processes it.
- -u symbol
Enter
symbol
as an undefined symbol in the symbol table.
The resulting unresolved reference is useful
for linking a program solely from object files in a library.
More than one
symbol
can be specified, but each must be preceded by
-u.
- -v
Display verbose messages during linking.
For each library module that is loaded,
the linker indicates which symbol caused that module to be loaded.
- -x
Strip local symbols from the output file. This reduces
the size of the output file without
impairing the effectiveness of object file utilities. This option is
incompatible with the
-r
option .
Note: use of
-x
might affect the use of a debugger.
- -y symbol
Indicate each file in which
symbol
appears. More than one
symbol
can be specified, but each must be preceded by
-y.
- -z
Arrange for run-time dereferencing of null pointers to produce a
SIGSEGV
signal. (This is the complement of the
-Z
option.)
- -B bind
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:
- deferred
Bind addresses on first reference
rather than at program start-up time. This is the default.
- immediate
Bind addresses of all symbols immediately upon loading the library.
Commonly followed by
-B nonfatal
to allow procedure calls that cannot be resolved at program start-up
to be resolved on first reference.
Since
-B nonfatal
suppresses messages about unresolved symbols, also specify
-B verbose
to display those messages.
See the example below.
- nonfatal
If also using
-B immediate,
for code symbols that could not be bound at program startup,
defer binding them until they are referenced. See description of
-B immediate
above.
Since
-B nonfatal
suppresses messages about unresolved symbols, also specify
-B verbose
to display those messages.
- restricted
Causes the search for a symbol definition to be restricted to
those symbols that were visible when the library was loaded.
- symbolic
Used only when building a shared library (with the
-b
option), this option causes all unresolved symbols inside a library to be
resolved internally if possible. By default, unresolved symbols are
resolved to the most visible definition in the library or outside of the
library.
- verbose
Display verbose messages when binding symbols. This is the default
except when
-B nonfatal
is specified. In that case,
-B verbose
must be explicitly specified to get verbose messages.
See the
+help
option or the
HP-UX Linker and Libraries User's Guide
manual for more information on the uses of binding modes.
- -D offset
Set the origin (in hexadecimal) for the data segment.
- -E
This option is accepted but ignored by the 64 bit
ld.
Mark all symbols defined by a program for export
to shared libraries.
By default,
ld
marks only those symbols that are actually referenced by a shared library
seen at link time.
- -G
Strip all unloadable data from the output file.
This option is typically used to strip debug information.
- -I
Instrument the code to collect profile information upon execution.
The profile data gathered during program execution can be used in
conjunction with the
-P
option.
32 bit programs linked with this option should use the startup file
/opt/langtools/lib/icrt0.o.
This option should not be used with the
-P,
-A,
-O,
or
+O
options.
- -L dir
Search for
libx.a
or
libx.sl
in
dir
before looking in default locations.
More than one directory can be specified,
but each must be preceded by
-L.
The
-L
option is effective only if it precedes the
-l
option on the command line.
- -O
Turn on linker optimizations.
Currently the optimizations include the elimination of unnecessary
ADDIL
instructions from the code in the executable file (32 bit only), and the
removal of dead procedures.
-O
is passed to the linker by the compilers
when the
+O4
compiler option is selected.
For more details on linker optimizations refer to the
+help
option or the
HP-UX Linker and Libraries User's Guide
manual.
- -P
Examine the data file produced by an instrumented program
(see the
-I
option) to perform profile based optimizations on the code.
This option should not be used with the
-A
option.
- -Q
Ignored for 64 bit links. Generate an executable output file with file type
EXEC_MAGIC
or
SHARE_MAGIC,
depending on whether
-N
or
-n
is specified. This is the default. This option is incompatible with
-q.
- -R offset
Set the origin (in hexadecimal) for the text (i.e., code) segment.
- -V
Output a message giving information about the version of
ld
being used.
- -Z
Allow run-time dereferencing of null pointers.
See the discussions of
-Z
and
pointers
in
cc(1).
(This is the complement of the
-z
option.)
- -Pd
Reorder debuggable funcitons. Ordinarily
-P
does not reorder functions from
.o
files with debugging information, because reordering renders them
non-debuggable. This option overrides this and reorders the functions.
- -PD filename
Save link order file generated by Fdp during linking with
-P
option into user-specified file.
- -PF filename
Indicate to the linker to use the specified file for the linker file
instead of generating it using
/usr/bin/fdp.
- -dynamic
This allows the linker to create a program which can use shared libraries.
This is the default for 64 bit links unless
+compat
is used.
- -noshared
This option forces the linker to create a fully archive bound program.
- +b path_list
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
-l
or
-l:
option.
An argument consisting of a single colon
(:)
indicates that
ld
should build the list using all the directories specified by the
-L
option and the
LPATH
environment variable (see the
+s
option).
- +compat
This option turns on compatibility mode in the linker — 64 bit links mimic
behavior of 32 bit links.
- +copyojbdebug
Copy objdebug space.
- +df file
Used together with the
-P
option, this option specifies that
file
should be used as the profile database file.
The default value is
flow.data.
See the discussion of the
FLOW_DATA
environment variable for more information.
- +e symbol
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.
- +ee symbol
This option is similar to the
+e
option in that it exports a
symbol. However, unlike the
+e
option,
+ee
does not alter the
visibility of any other symbol in the file. In a 32 bit link or
+compat
mode 64 bit link, it has the effect of exporting the specified
symbol without hiding any of the symbols exported by default.
In a 64
+std
link, all symbols are exported by default, so
+ee
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
(+Oprocelim).
Of course,
+ee
still retains its
export behavior if an option such as
+hideallsymbols
is also given.
- +fb
Instructs the linker to run the fastbind tool
on the executable it has
produced. The executable should be linked with shared libraries. For more
details refer to
fastbind(1),
the
+help
option, or the
HP-UX Linker and Libraries User's Guide
manual.
- +fbu
Pass the
-u
option to the fastbind tool. For more details refer to
fastbind(1),
the
+help
option, or the
HP-UX Linker and Libraries User's Guide
manual.
- +gst
Enable the global symbol table hash mechanism,
used to look up values of symbol import/export entries.
The
+gst
and related options provide proformance enhancements through use
of global symbol table which improves searching for exported symbols.
See
dld.sl(5)
and the
HP-UX Linker and Libraries Online User Guide
for more information.
- +gstsize size
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 with the
STMTAB_DEFAULT_SIZE
environment variable.
You can set the value using
chatr +gstsize
size
file.
- +h internal_name
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
internal_name
is recorded in the library list of the resulting output file instead of the
file system pathname of the input shared library.
If
internal_name
is a fully-qualified pathname, it is recorded
as is
in the library list of any executable file it is subsequently linked against.
If
internal_name
is a relative pathname or no directory component was specified,
internal_name
is
appended
to the file system directory component of the input shared library in the
library list of any executable file it is
subsequently linked against.
If more than one +h option is seen on the link line, the first
one is used and a warning message is emitted.
- +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 terminal.) For more information, refer to the
HP-UX Linker and Libraries User's Guide
manual.
See
manuals(5)
for ordering information.
- +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.
- +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 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.
- +noobjdebug
Use old debugging information model and format rather than new debugging
format. This option overrides the
+objdebug
compiler options, which generates debugging information in ELF output.
- +pd size
Request a particular virtual memory page size that should be used for data.
Sizes of
4K,
16K,
64K,
256K,
1M,
4M,
16M,
64M,
256M,
D,
and
L
are supported. A size of D allows the kernel to choose what page size should
be used.
A size of
L
will result in using the largest page size available.
The actual page size may vary if the requested size cannot
be fulfilled.
- +pgm name
Used together with the
-P
option, this option specifies that
name
should be used as the look-up name in the profile database file.
The default is the basename of the output file (specified by the
-o
option.)
- +pi size
Request a particular virtual memory page size that
should be used for instructions. See the
+pd
option for additional information.
- +s
Indicates that at run-time, the shared library loader
can use the environment variable
SHLIB_PATH
and
LD_LIBRARY_PATH
(64 bit only) to locate shared libraries needed by the executable
output file that were specified with either the
-l
or
-l:
option. The
environment variables should be set to a colon-separated list of
directories. If both
+s
and
+b
are used, their relative order on the command line
indicates which path list will be searched first (see the
+b
option).
- +std
This option is ignored for 32 bit links. Turns on standard mode, which is the default. Options turned on with
this option are:
-dynamic.
Options turned off or ignored when this option is specified are:
+compat,+noenvvar,-noshared.
+vallcompatwarnings
This option is accepted but ignored by the 64 bit
ld.
Show more detail for any warnings about
compatibility issues. By
default, only a terse message is printed. See the
WARNINGS
section below for further details.
- +v[no]compatwarnings
This option is accepted but ignored by the 64 bit
ld.
Enable [disable] printing warnings about compatibility
issues between systems. This includes any functionality which may
change in future releases. The default is
+vcompatwarnings.
See the
WARNINGS
section below for further details.
- +v[no]shlibunsats
Enable [disable] printing a list of unsatisfied
symbols used by shared
libraries. The default is
+vnoshlibunsats.
Some unsatisfied symbols reported by the linker are not required at run
time because the modules which reference the symbols are not used.
- +FP flag
Specify how the environment for floating-point
operations should be initialized at program
start-up.
By default, all behaviors are disabled.
The following flags are supported
(upper case flag enables; lower case flag disables):
- V (v)
Trap on invalid floating-point operations
- Z (z)
Trap on divide by zero
- O (o)
Trap on floating-point overflow
- U (u)
Trap on floating-point underflow
- I (i)
Trap on floating-point operations that produce inexact results.
- D (d)
Enable sudden underflow (flush to zero) of denormalized values.
Note:
Enabling sudden underflow is an undefined operation on
PA-RISC
1.0-based systems,
but it is defined on all subsequent versions of
PA-RISC.
Selecting this flag enables sudden underflow
only if it is available on the processor being used at run-time.
To dynamically change these settings at run-time, see
fesettrapenable(3M).
- +I symbol
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.
For more details on the initializer function, refer to the
+help
option or the
HP-UX Linker and Libraries User's Guide
manual.
- +O[no]fastaccess
Enable [disable] fast access to global data. The linker rearranges the
data to further reduce the number of
ADDIL
instructions in the executable.
This optimization may reveal some subtle programming errors related to
assumptions about data layout. This optimization can occur at optimization
levels 2, 3 and 4. The default is
+Onofastaccess
at optimization levels 2 and 3, and
+Ofastaccess
at optimization level 4.
Using the
+Ofastaccess
option
in the presence of debug information generates
a warning message and can cause corruption of the debug information.
Avoid using
+Ofastaccess
with the
-g
option.
This option is accepted but ignored by the 64 bit
ld.
- +O[no]procelim
Enable [disable] the elimination of procedures that are not referenced by
the application. The default is
+Onoprocelim.
Procedure elimination can occur at any optimization level, including level 0.
For more details refer to the
+help
option or the
HP-UX Linker and Libraries User's Guide
manual.
- +Oreusedir=dir
Specify the name of the directory to use as the reuse repository for
the object code reuse feature. This directory holds the compiled object
files for reuse.
dir
can be an absolute or relative path to directory where you invoked the
linker. The
+Oreusedir
option shortens link time by not recompiling intermediate object
code to object code when using
+O4
or profile-based optimization.
- +Oselectivepercent n
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.
- +Oselectivesize size
Instructs the interprocedural optimizer driver to
pass the first k routines to the high level optimizer for
interprocedural optimization where the size of k
routines are approaching but less than
size.
- +OselectiveO3
Instructs the interprocedural optimizer driver to
compile the routines not
included in the +O4 list to be compiled at +O3.
- +Ostaticprediction
Meaningful only on PA 2.0 architecture, this option
sets the branch prediction bit in the output executable file's auxiliary
header.
- +pd size
Request a particular virtual memory page size that should be used for data.
Sizes of
4K,
16K,
64K,
256K,
1M,
4M,
16M,
64M,
256M,
D,
and
L
are supported. A size of D allows the kernel to choose what page size should
be used.
A size of
L
will result in using the largest page size available.
The actual page size may vary if the requested size cannot
be fulfilled.
- +pi size
Request a particular virtual memory page size that
should be used for instructions. See the
+pd
option for additional information.