ld_pa(1) ld_pa(1)
For PA-RISC Systems
NAME [Toc] [Back]
ld_pa: ld - link editor
SYNOPSIS [Toc] [Back]
The link editor. Common options:
ld [-bdmnqrstvxzEGIOPQVZ] [-a search] [-c filename] [-dynamic]
[-e epsym] [-h symbol]... [-lx | file]... [-l: library]
[-m] [-noshared] [-o outfile] [-u symbol]... [-y symbol]...
[-B bind] [-D offset] [-Fl lib] [-L dir]... [-R offset] [-Pd]
[-PD file] [-PF file] [+afs func_sym_x=func_sym_y]...
[+b path_list] [+compat] [+copyobjdebug] [+df file] [+e symbol]
[+ee symbol] [+fb] [+fbu] [+filter shared_library_path]
[+fini function] [+gst] [+gstsize size] [+h internal_name] [+help]
[+init function] [+interp file] [+k] [+n] [+[no]mergeseg]
[+[no]mmap] [+nocopyobjdebug] [+noobjdebug] [+objdebugonly]
[+origin shared_library_path] [+pd size] [+pgm name] [+pi size]
[+s] [+std] [+tools] [+v[no]shlibunsats] [+vallcompatwarnings]
[+v[no]compatwarnings] [+FP flag] [+I symbol] [+O[no]fastaccess]
[+O[no]procelim] [+Oreusedir=dir] [+Oselectivepercent n]
[+Oselectivesize size] [+OselectiveO3] [+Ostaticprediction]
[+profilebucketsize size] [+allowdups]
PA-RISC 32-Bit (SOM) Link Editor Options:
ld [-NST] [-A name] [-C n] [-Fw] [-Fz] [+cdp oldpath:newpath]
[+cg pathname] [+dpv] [+ea filename] [+gstbuckets size]
[+nosmartbind] [+plabel_cache flag]
PA-RISC 64-Bit (ELF) Link Editor Options:
ld [+allowrorelocs] [+[no]allowunsats] [+[no]forceload]
[+hideallsymbols] [+ild] [+ildnowarn] [+ildpad percentage]
[+ildrelink] [+interposer] [-k filename] [+[no]lazyload]
[+linkersyms]
[+nodefaultmap] [+noenvvar] [+nodynhash] [+nosectionmerge]
[+paddata pagesize] [+padtext pagesize] [+pdzero] [+stripunwind]
[+vtype type]
DESCRIPTION [Toc] [Back]
ld 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, ld produces an
executable file that can be run by the HP-UX loader exec() (see
exec(2)). Alternatively, the linker can generate a relocatable file
that is suitable for further processing by ld (see -r below). It can
also generate a shared library (see -b below). The linker marks the
output file non-executable if there are any duplicate symbols or any
unresolved external references remain. ld may or may not generate an
output file (see +k option) if any other errors occur during its
operation.
Hewlett-Packard Company - 1 - HP-UX 11i Version 2: Sep 2004
ld_pa(1) ld_pa(1)
For PA-RISC Systems
ld recognizes three kinds of input files: object files created by the
compilers, assembler, or linker (also known as .o 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 symbols from its component object files. (The
archiver command ar(1) creates and maintains this index.) ld uses this
table to resolve references to external symbols.
ld 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 or shared library or
dependent shared library. 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. The dynamic loader /usr/lib/dld.sl on 32-bit links is
invoked at startup time by the startup file crt0.o if a program uses
shared libraries. Identical copies of crt0.o can be found in either
/usr/ccs/lib/crt0.o or /opt/langtools/lib/crt0.o. For 64-bit mode,
the dynamic loader is /usr/lib/pa20_64/dld.sl and is invoked by exec
for those programs that use shared libraries. crt0.o is not required
in shared bound links. The dynamic loader attaches each required
library to the process and resolves all symbolic references between
the program and its libraries.
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 pxdb -s on 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.
ld recursively examines the dependencies of shared libraries used by a
program that was created by ld. If ld 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 -l argument used
when the shared library was created, ld will search all the
directories that it would search for a library that was specified with
-l (see -L and LPATH).
Environment Variables [Toc] [Back]
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.
The LD_PXDB environment variable defines the full execution path for
the debug preprocessor pxdb. The default value is
/opt/langtools/bin/pxdb. ld invokes pxdb on its output file if that
file is executable and contains debug information. To defer
invocation of pxdb until the first debug session, set LD_PXDB to
/bin/true.
Hewlett-Packard Company - 2 - HP-UX 11i Version 2: Sep 2004
ld_pa(1) ld_pa(1)
For PA-RISC Systems
The LPATH environment variable can be used to specify default
directories to search for library files. See the -l option.
Link Editor Common Options [Toc] [Back]
The common ld options are listed first, followed by the options
supported only in a 32-bit linker, and then the options only supported
in a 64-bit linker.
-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.
-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. In 32-bit
mode, the linker creates a static executable if
there are no shared libraries on the link line.
Hewlett-Packard Company - 3 - HP-UX 11i Version 2: Sep 2004
ld_pa(1) ld_pa(1)
For PA-RISC Systems
-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.
Hewlett-Packard Company - 4 - HP-UX 11i Version 2: Sep 2004
ld_pa(1) ld_pa(1)
For PA-RISC Systems
-noshared This option forces the linker to create a fully
archive bound program.
-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 or +ild incremental linking
options.
-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 or a profiler on the resulting program.
This option is incompatible with -r. (The
strip(1) command also removes this information.)
This option is incompatible with +ild. (The
incremental linking requires the parts of the
output load module which are stripped out with -s
option.)
-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. On 32-
bit systems, for each module loaded, the linker
indicates which symbol caused that module to be
loaded. For 64-bit systems, the linker indicates
this information only for modules loaded from
archive libraries.
-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. This option is incompatible with the
+ild option. The incremental linking requires the
Hewlett-Packard Company - 5 - HP-UX 11i Version 2: Sep 2004
ld_pa(1) ld_pa(1)
For PA-RISC Systems
parts of the output load module which are stripped
out with the -x option.
Note: use of -x might affect the use of a
debugger or profiler.
-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:
direct
Create a direct link between symbol
references and shared libraries by recording
the name of the resolved shared libray during
symbol resolution. This information is used
during runtime to quickly resolve symbols
without searching through all currently
loaded libraries.
-B direct implicitly turns on symbolic
binding (see -B symbolic) and disables
dependent shared library processing.
You can disable direct binding can be
disabled during runtime by setting the
LD_NODIRECTBIND environment variable.
deferred
Bind addresses on first reference rather than
at program start-up time. This is the
default.
group
Mark the shared library so that it behaves as
if loaded with RTLD_GROUP flag to dlopen().
This does not affect the dependent shared
libraries.
Note: The -B group binding mode is currently
supported only for 64-bit applications.
Hewlett-Packard Company - 6 - HP-UX 11i Version 2: Sep 2004
ld_pa(1) ld_pa(1)
For PA-RISC Systems
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.
lazydirect
Only record direct bind information to shared
libraries marked for lazy loading. See
+[no]lazyload.
nodelete
Mark the shared library so that an explicit
unload using dlclose() or shl_load() returns
success silently without detaching the shared
library from the process. Subsequently, the
shared library handle is valid only for
shl_findsym(). It stays invalid for dlsym(),
dlclose(), and shl_unload() until the next
explicit load using shl_load() or dlopen().
nodirect
Disallow direct binding. Only a "direct hint"
is recoreded for references to libraries
marked for lazy loading. This is the default
behaivor.
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
Hewlett-Packard Company - 7 - HP-UX 11i Version 2: Sep 2004
ld_pa(1) ld_pa(1)
For PA-RISC Systems
(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.
When used with the +ild option, if you change the
offset after the initial incremental link, the
linker performs an initial incremental link
automatically.
-E Mark all symbols defined by a program for export
to shared libraries. In a 32-bit link or +compat
mode 64-bit link, ld marks only those symbols that
are actually referenced by a shared library seen
at link time. In a 64-bit +std link, all symbols
are exported by default, so -E is not necessary 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
(+Oprocelim).
-Fl lib Force load all member objects of the archive
library lib. If you do not use -Fl, the linker
only loads the needed archive members from lib.
This option is useful for creating a shared
library from an archive library (if the member
objects are position-independent code), or when
you need to load archive member that define
symbols needed by shared libraries.
You can specify more than one library on the
command line with multiple option-library pairs;
that is, each library you specify must be preceded
by the -Fl option.
Hewlett-Packard Company - 8 - HP-UX 11i Version 2: Sep 2004
ld_pa(1) ld_pa(1)
For PA-RISC Systems
-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, +ild, 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.
This option is incompatible with the +ild option.
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 or +ild options.
-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.
When used with the +ild option, if you change the
offset after the initial incremental link, the
linker performs an initial incremental link
Hewlett-Packard Company - 9 - HP-UX 11i Version 2: Sep 2004
ld_pa(1) ld_pa(1)
For PA-RISC Systems
automatically.
-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 functions. Ordinarily -P does
not reorder functions from .o files with debugging
information, because reordering renders them nondebuggable.
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.
This option is incompatible with the +ild option.
-PF filename Indicate to the linker to use the specified file
for the linker file instead of generating it using
/usr/ccs/bin/fdp. This option is incompatible
with the +ild option.
+afs func_sym_x=func_sym_y...
Instruct the linker to replace the function symbol
with an alternate function symbol in shared
library and executable file links.
The +afs option supports function symbol aliasing.
Often user programs have functions that exactly
match the functionality of optimized library
functions with a different name. These userdefined
functions are usually called frequently in
the program. With the +afs option, you can make
significant gains in performance by replacing all
references to a user-defined function with
references to a tuned library function during link
time, thus optimizing these functions with just a
relink.
Both functions must define the same number and
type of parameters, and return a value of the same
type. If they do not match, the results are
unpredictable, and the linker does not generate a
warning message.
Example:
$ ld ... +afs func_sym1=func_sym2 ...
Hewlett-Packard Company - 10 - HP-UX 11i Version 2: Sep 2004
ld_pa(1) ld_pa(1)
For PA-RISC Systems
In the example, the linker replaces all references
to the function symbol func_sym1 with references
to func_sym2. The func_sym2 symbol should be an
normal unaliased symbol. It cannot appear on the
left-hand side of "=" on another +afs option.
You can specify more than one function symbol
alias on the command line with multiple optionsymbol
pairs, that is, each symbol pair you
specify must be preceded by the +afs option.
+allowdups 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.
+b path_list Specify a colon-separated list of directories
(embedded path) 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 is ignored for 32-bit links. This
option turns on compatibility mode in the linker -
64-bit links mimic behavior of 32-bit links).
+copyobjdebug 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. This option is
incompatible with the +ild option.
+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
Hewlett-Packard Company - 11 - HP-UX 11i Version 2: Sep 2004
ld_pa(1) ld_pa(1)
For PA-RISC Systems
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. This option is incompatible with the +ild
option.
+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. This option is incompatible with the +ild
option.
+filter shared_library_path
Enables the shared library filter mechanism, which
allows you divide a large library into a "filter"
and several "implementation" libraries for more
efficient organization of shared libraries.
shared_library_path specifies the location of the
filter library. See the HP-UX Linker and
Libraries User's Guide for more information.
+fini function_name
Specify the terminator (finalizer) functions to be
invoked in forward order, the order the functions
appear left to right on the command line. The
terminator functions are called in reverse of the
depth-first order of initializers.
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().
Hewlett-Packard Company - 12 - HP-UX 11i Version 2: Sep 2004
ld_pa(1) ld_pa(1)
For PA-RISC Systems
Do not use +fini with the -r option. (The linker
ignores the +fini option.)
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 +fini option.
For more details on the terminator function, use
the +help option or see the HP-UX Linker and
Libraries User's Guide.
+gst Enable the global symbol table hash mechanism,
used to look up values of symbol import/export
entries. The +gst and related options provide
performance 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 by setting the _HP_DLDOPTS environment
variable to the value -symtab_size prime number.
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.
That is, if +h is not used, the shared library
does not have an internal name and when an
executable is built with the shared library, the
linker records the library name that it looks at.
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.
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.
Hewlett-Packard Company - 13 - HP-UX 11i Version 2: Sep 2004
ld_pa(1) ld_pa(1)
For PA-RISC Systems
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.
+init function_name
Specify the initializer functions to be invoked in
reverse order, the order the functions 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 multiple 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.
Hewlett-Packard Company - 14 - HP-UX 11i Version 2: Sep 2004
ld_pa(1) ld_pa(1)
For PA-RISC Systems
+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 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. 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 information 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
Hewlett-Packard Company - 15 - HP-UX 11i Version 2: Sep 2004
ld_pa(1) ld_pa(1)
For PA-RISC Systems
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 into
the executable file. You can leave debug
information in some object files and not in
others.
When archive members are not compiled with
+objdebug (and they contain debug information,
that is, they were compiled with -g), the debug
information from the archive members is copied
into the a.out by default. The linker does not
copy debug information from shared libraries into
the a.out, regardless of whether they are compiled
with +objdebug or +noobjdebug.
Use the +noobjdebug option when linking to
explicitly tell the linker to copy all debug
information to the executable file, even from
files compiled with +objdebug.
+nomergeseg Disables the shared library segment merging
feature. This is the default.
+nommap Disables the mmap feature and uses the normal
buffering method to write into the output file.
NOTE: Do not use +nommap unless in cases like the
system has very low memory and the linker fails
because of this.
+objdebugonly Ignore debug information from non-objdebug objects
or archives and proceed in +objdebug mode. This
option can be passed from the C or C++ compiler
command line as -Wl,+objdebugonly. If you are
debugging only files compiled with the +objdebug
option, +objdebugonly can improve link time by
instructing the linker to bypass the processing of
debug information from files compiled with
+noobjdebug. With the +objdebugonly option, the
linker suppresses the call to pxdb.
+origin shared_library_name -lx
(Use only before the -l option or the name of a
shared library.) Cause the linker to add $ORIGIN
before the shared library name in the shared
library list. At runtime, the dynamic loader
Hewlett-Packard Company - 16 - HP-UX 11i Version 2: Sep 2004
ld_pa(1) ld_pa(1)
For PA-RISC Systems
determine the current directory of the parent
module (shared library or executable) and replaces
$ORIGIN for that directory name.
Example:
$ ld -dynamic main.o +origin libx.sl -L /usr/lib/
-lc
While the +origin option is available, the
recommended way to specify $ORIGIN is in the
embedded path with the +b option, for example,
$ ld -dynamic main.o -L /usr/lib/ -lc +B $ORIGIN
For more details on $ORIGIN, use the +help option
or see the HP-UX Linker and Libraries User's
Guide.
+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.) This option is incompatible with the
+ild 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).
Hewlett-Packard Company - 17 - HP-UX 11i Version 2: Sep 2004
ld_pa(1) ld_pa(1)
For PA-RISC Systems
+std This option is ignored for 32-bit links. Turns on
standard mode, which is the default in 64-bit
mode. 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
+vn
|