rld Manual
RLD Overview
RLD Manual—528857-006
1-6
Loader Path Specifications
C++ generates local functions to invoke static constructors and destructors for global
variables that are instances of classes.The linker (eld) builds two iniTerm lists and
places pointers (ctors and dtors addresses) to them in the tandeminfo segment
of the object file. The loader (rld) explicitly relocates the function pointer addresses
within the lists when the loadfile is rebased.
__INIT__ and __TERM__
Apart from the functions from runtime-library, the user program itself might contain
functions with these names (for example, __INIT__< name>). These functions need
not be called by the program explicitly; they are executed in alphabetical order of the
function names in case of __INIT__ functions and reverse alphabetical order in case of
__TERM__ functions. The linker builds two iniTerm lists corresponding to these
functions and places pointers (initz and termz addresses) to them in the
tandeminfo segment of the object file.
For PIC programs and libararies, a function in the rld library traverses the Loadlist
using rld data structures, locating the requested iniTerm lists in each loadfile. For
dynamic libraries, dlopen() must run the initializations and dlclose() must run the
destructors and terminators.
Loader Path Specifications
Users can specify the search path that rld must use to find libraries with unqualified
file names. Search sites can be specified to rld through path lists, either at link time or
at runtime. The path list (colon separated sequence of path names) supplied to rld at
link and load time also applies to any dlopen() invocations in that process.
The path names are subvolumes for Guardian processes and directories for OSS
processes.
The search method that rld and dlopen() uses for finding libraries does not apply
to public libraries. Instead, the operating system makes the public libraries available to
rld and dlopen() through the Loader Support Facilities.
Link-time Path Specifications
When building a loadfile, users can specify a runtime path list at link-time using an
option to linker. This information is stored in the ".dynamic" section of the object file as
rpath and rpath_first for use at load time by rld.
By default, if rpath is absent or null, the runtime path list is as follows:
Public libraries
Program's location
Default locations for a 32-bit process:
On OSS: /lib, /usr/lib, /usr/local/lib, /G/SYSTEM/ZDLL
On Guardian: $SYSTEM.ZDLL