
l
ld(1)ld(1)
executable. ld recursively examines the dependencies of shared libraries used by a program that was created by ld. If ld does not ®nd 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
Environment Variables
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 de®nes the full execution path for the debug preprocessor pxdb. The default value is /opt/langtools/bin/pxdb. ld invokes pxdb on its output ®le if that ®le is executable and contains debug information. To defer invocation of pxdb until the ®rst debug session, set LD_PXDB to /bin/true.
The LPATH environment variable can be used to specify default directories to search for library ®les. See the
Options
The common ld options are listed ®rst, followed by the options supported only in a
Specify whether shared or archive libraries are searched with the | ||
| value of search should be one of archive, shared, archive_shared, | |
| shared_archive, or default. This option can appear more than once, inter- | |
| spersed among | |
| 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 speci®ed 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. |
|
Create a shared library rather than a normal executable ®le. Object ®les processed | ||
| with this option must contain | |
| 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. | |
Read ld options from a ®le. Each line contains zero or more arguments separated by | ||
| white space. Each line in the ®le, 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 de®nition of ``common'' storage; that is, assign addresses and sizes, for | ||
| put. |
|
Set the default entry point address for the output ®le to be that of the symbol epsym. | ||
| (This option only applies to executable ®les.) |
|
Prior to writing the symbol table to the output ®le, mark this name as ``local'' so that | ||
| it is no longer externally visible. This ensures that this particular entry will not clash | |
| with a de®nition in another ®le during future processing by ld. | |
| More than one symbol can be speci®ed, but | |
| building a shared library or program, this option prevents the named symbol from | |
| being visible to the dynamic loader. |
|
Search a library libx.a or libx.sl, where | x is one or more characters. The | |
| current state of the | |
| version of a library is searched. Because a library is searched when its name is | |
| encountered, the placement of a | |
| located in /usr/lib and /usr/ccs/lib . | |
| /usr/lib/pa20_64. If the environment variable LPATH is present in the user's | |
| environment, it should contain a | |
| directories are searched instead of the default directories, but | |
Section 1−424 | − 2 − | |