HP-UX Reference (11i v3 07/02) - 5 Miscellaneous Topics (vol 9)
d
dld.sl(5) dld.sl(5)
(PA-RISC System Only)
mode. See the +help option to ld(1) or the HP-UX Linker and Libraries User’s Guide manual for more
details.
PA-RISC 64-bit Dynamic Path List
For standard mode libraries (libraries built or linked with
ld +std ), the dynamic loader will use dynamic
path searching to find shared libraries whose names appear in the shared library list of the program or
loaded shared libraries with no embedded
/
character. Dynamic path searching is enabled by default for
these standard mode libraries or executables. If
ld +noenvvar is specified, the dynamic loader will not
look at any dynamic path environment variables to find dependent shared libraries. This limits the
dynamic path searching to the value of
rpath
and the default directories /usr/lib/pa20_64
and
/usr/ccs/lib/pa20_64
.
For compatibility mode libraries (libraries built or linked with
ld +compat
), the dynamic loader will only
do dynamic path searching for these libraries if they were linked with
-l or -l: and one of these were
specified:
•
ld +s
• ld +b
• chatr +s enable
There are several ways to specify a dynamic path list :
• By storing a directory path list in the executable using the +b path_list option to ld
.
• By not specifying
ld +b and letting the linker set the rpath value to a concatenation of the
ld
-L
path_list followed by the value of the environment variable LPATH followed by the default direc-
tories /usr/lib/pa20_64
and /usr/ccs/lib/pa20_64. This is for standard mode shared
libraries only.
• By storing a directory path list in the environment variables
LD_LIBRARY_PATH
and/or
SHLIB_PATH . For compatibility mode shared libraries and executables, the directory path_list
should only be put in the
SHLIB_PATH environment variable.
The path list is a list of one or more path names separated by colons (:
). The dynamic path list will work
only for libraries specified with the
-l or -l: options to ld. However, it can be enabled for libraries
specified with a full path name using the -l option to chatr (see chatr(1)). If both
+s and +b are used,
their relative order on the command line indicates which path list will be searched first in compatibility
mode. See the
+help option to ld(1) or the HP-UX Linker and Libraries User’s Guide manual for more
details.
The dynamic loader will use these rules when determining which dynamic path list to use:
• If
ld +noenvvar was specified and ld +b and ld +compat were not specified, then the only
dynamic path searching that can be done is to look at the path list in
rpath
followed by the default
directories
/usr/lib/pa20_64
and /usr/ccs/lib/pa20_64.
• If
ld +compat was specified and ld +b and ld +s were not specified, no shared library is subject
to dynamic path searching.
• If the
ld +compat and ld +b options are not specified, then the path_list in the
LD_LIBRARY_PATH environment variable is searched, followed by the path_list in the
SHLIB_PATH environment variable, followed by the path_list in rpath, followed by the default
directories /usr/lib/pa20_64 and /usr/ccs/lib/pa20_64
.
• If the
ld +compat, ld +b, and ld +s are specified, then use the relative ordering of ld +b and
ld +s to determine if the dynamic loader should use the path_list in rpath before SHLIB_PATH
followed by the library as specified in the shared library list. If ld +b is specified first, use the
path_list in rpath first.
The rules change slightly when looking for dependent shared libraries.
• For standard mode libraries, the path_list in the LD_LIBRARY_PATH environment variable is
searched first, followed by the path_list in the SHLIB_PATH environment variable, followed by the
value in the parent shared library’s rpath, followed by the default directories
/usr/lib/pa20_64 and /usr/ccs/lib/pa20_64. The ancestors of a parent shared library
may contain a path_list in rpath, but this is ignored when searching for dependent shared libraries
of this parent. Only the parent’s rpath is used. If a library with the same basename (library name
without a path) has already been loaded for the program, that library is used to resolve the dependent
112 Hewlett-Packard Company − 2 − HP-UX 11i Version 3: February 2007