rld Manual

RLD Overview
RLD Manual528857-006
1-5
IniTerm Functions
The dlopen() function loads the specified DLL and all the libraries on its loadList.
This function shares the rld phases 2 to 5 previously described, with variations in
phase 2 and 5:
In phase 2, the function argument specifying the library to be dynamically loaded
provides the starting point for creating the loadList, rather than the program's libList. If
the designated library is already loaded, dlopen() returns an appropriate handle
without loading any of the libraries specified on the libList of this library.
Additional libraries are appended to the explicit loadList, forming the cumulative
loadList.
In phase 5, dlopen() uses appropriate functions in the Loader Support Facilities to
first report the presence of new libraries to the operating system and then executes the
initialization and static constructor functions before returning an appropriate handle to
the caller.
The dlclose() function will call a C++ Run-time Library function for each loadfile to
be dynamically unloaded, so object destruction can be accomplished. The loadfiles
are processed in the inverse order of their loading and all calls are made before
unmapping any of the loadfiles.
IniTerm Functions
Some programs and libraries require execution of special initialization and termination
functions, collectively called IniTerm functions. The NonStop operating system supports
four types of iniTerms, identified by distinctive name prefixes. These prefixes and their
order of execution are as follows:
As the names suggest, these functions are called during the initialization (__INIT__and
__sti__) and termination of a process (__std__ and __TERM__). These functions are
called without the program explicitly calling them. Initialization functions are an HP
innovation, intended to initialize run-time support libraries. Termination functions are
their inverse.
__sti__ and __std__
Functions Prefix Order of execution
Initialization
functions
__INIT__ Alphabetical order of function names
Static constructor
invocations
__sti__ The order in which eld sees the functions
Static destructor
invocations
__std__ The reverse of the order in which eld sees the
functions
Termination
functions
__TERM__ Reverse alphabetical order of function names