HP-UX Reference (11i v1 00/12) - 5 Miscellaneous Topics, 7 Device (Special) Files, 9 General Information, Index (vol 9)

__________________________________________________________________________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________________________________________________________________________
STANDARD Printed by: Nora Chuang [nchuang] STANDARD
/build/1111/BRICK/man5/!!!intro.5
________________________________________________________________
___ ___
d
dld.sl(5) dld.sl(5)
dependents, 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
(incomplete 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
standard 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 availableon PA64. 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 library load list. Then the dependent shared libraries of the first library in the library load
list list is searched, followed by the dependent shared libraries of the second library in the list, et cetera.
Depth-first Searching
This is the only search behavior on PA32 and is used on PA64 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 library load list. The first dependent library of this library is then searched, fol-
lowed 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 library load
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 PA32 only. Whenever an incompatible change is made to a library interface, both ver-
sions 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. At run time, the dynamic loader checks the high water mark of each library and
loads the library only if it is at least as new as the high water mark recorded at link time. When binding
symbolic references, the loader chooses the latest version of a symbol that is not later than the high water
mark recorded at link time. These two checks help ensure that the version of each library interface used at
run time is the same as was expected at link time. Intra-library versioning may be removed in a future
release.
Library-level Versioning
The second way for users to version their libraries is by using a new naming convention, libname.n where
n is a numeral that is incremented with every new release of the library. When using the new naming
scheme, users must specify an internal name for the shared library by using the
+h internal_name
option to ld when building the shared library. This internal name is recorded in each incomplete execut-
able or shared library that links with the shared library.
HP-UX Release 11i: December 2000 3 Section 543
___
___