HP-UX Reference (11i v2 07/12) - 5 Miscellaneous (vol 9)
d
dld.sl(5)
PA-RISC Systems Only
dld.sl(5)
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 shared library.
• For compatibility mode libraries, the search is the same as for parent shared libraries, except
rpath
can be passed from parent shared libraries to child dependent shared libraries to that child’s depen-
dents, et cetera.
Binding
The dynamic loader also resolves symbolic references between the executable and libraries. By default,
function calls are trapped via the linkage table and bound on first reference. References to data symbols
and other absolute address references cannot be trapped. They are bound on the first resolution of a func-
tion call that could potentially reference the object.
If the -B immediate option to ld
is used, the loader binds all necessary references at startup time.
This increases the startup cost of a program, but ensures that no more binding operations will be required
later. Thus, better real-time response may result, and the risk of a later abort due to unresolved externals
is eliminated.
The
fastbind tool can be used to improve the start-up time of programs that use shared libraries (incom-
plete executables). The fastbind
tool performs analysis on the shared library routines and data used to
bind the symbols and stores this information in the executable file. The dynamic loader will notice that this
information is available, and it will use this fastbind information to bind the symbols instead of the stan-
dard search method.
For more details refer to fastbind(1) and the
+help option to ld(1) or the HP-UX Linker and Libraries
User’s Guide manual.
Breadth-first Searching
This is only available on PA-RISC 64-bit systems. By default, the dynamic loader will do breadth-first
searching when binding symbols. If the incomplete executable was linked with
+compat or if a
shl_load() is being executed, then depth-first searching is used.
Breadth-first searching specifies that the dynamic loader will look for symbols starting with the incomplete
executable followed by all loaded shared libraries in a left to right order until the symbol is found. For
example, the incomplete executable is searched followed by all libraries in its shared library list. Then the
dependent shared libraries of the first library in the shared library list is searched, followed by the depen-
dent shared libraries of the second library in the list, et cetera.
Depth-first Searching
This is the only search behavior on PA-RISC 32-bit systems and is used on PA-RISC 64-bit systems if doing
a shl_load() or if the incomplete executable was linked with +compat. The dynamic loader will
search the incomplete executable followed by the first library in its shared library list. The first dependent
library of this library is then searched, followed by the first dependent of this dependent, and so on. When
there are no more dependents, the siblings and their dependents are searched until eventually the second
library in the program’s shared library list is searched, followed by the first dependent of this library, et
cetera.
Version Control
Since code from a shared library is mapped at run time from a separate shared library file, modifications to
a shared library may alter the behavior of existing executables. In some cases, this may cause programs to
operate incorrectly. Two means of version control is provided to solve this problem.
Intra-Library Versioning
This is available on PA-RISC 32-bit systems only. Whenever an incompatible change is made to a library
interface, both versions of the affected module or modules are included in the library. A mark indicating
the date (month/year) the change was made is recorded in the new module via the pragma
HP_SHLIB_VERSION in C, or the compiler directive SHLIB_VERSION
in Fortran and Pascal.
This date applies to all symbols defined within the module. A high water mark giving the date of the latest
incompatible change is recorded in the shared library, and the high water mark for each library linked with
the program is recorded in the incomplete executable file.
HP-UX 11i Version 2: December 2007 Update − 3 − Hewlett-Packard Company 113