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

l
ld_ia(1) ld_ia(1)
(For Itanium(R)-based Systems)
running the executable. ld recursively examines the dependencies of shared libraries used by a pro-
gram 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 searchs all the directories that it would search for a library that was
specified with -l (see -L
and LPATH).
Options
-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
,ordefault. This option can appear more than once, inter-
spersed 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.
To create a statically-bound program, use the
-noshared option rather than -a
archive.
-b Create a shared library rather than a normal executable file. Object files processed
with this option must contain position-independent code (PIC), generated by
default by the compiler. See the discussion of position-independent code in cc(1),
aCC(1), f90(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 new-
line 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’’ symbols; that is, assign addresses and sizes, for
-r
output.
-dynamic This option is the default. Instructs the linker to produce a dynamically linked exe-
cutable (a program which can use shared libraries). This option is the complement
of -noshared.
If no shared libraries are linked in, the linker builds a dynamically linked execut-
able. However, in PA32-bit mode using the
+compat option, if no shared libraries
are linked in, the linker builds a statically bound executable (or archive bound exe-
cutable).
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
-noshared (or statically bound) programs, control does not pass to the
dynamic loader. See dld.so(5) for more information.
-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. If used when
building a shared library or program, this option prevents the named symbol from
being visible to the dynamic loader.
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
-h option.
-k filename Specify a mapfile that describes the output file memory map.
Please refer to HP-UX Linker and Libraries User’s Guide guide and the
+node-
faultmap for more information.
HP-UX 11i Version 2: September 2004 2 Hewlett-Packard Company Section 1451