rld Manual
RLD Overview
RLD Manual—528857-006
1-2
The Library Functions
their libraries. The rld functionality is provided through a function called RLD_Main in
the loader library that the operating system invokes when a PIC loadfile is specified for
process creation. The loader library is special in that it has an entry point address in its
ELF header, unlike ordinary SRLs and DLLs. That address is set at link time via the
linker -e RLD_Main option to specify the rld outer procedure, which requires no
passed parameters and returns no function value.
The ability to communicate with rld is limited, especially in the Guardian environment.
Run-time path specifications are provided via SEARCH DEFINES on the Guardian
platform and environment variables on the OSS platform.
rld and dlopen() write error and warning information to the hometerm of the
process using functions within the Loader Support Facilities. rld ignores any errors
returned from these functions because the only effect of an error is that it suppresses
output to the hometerm.
The Library Functions
rld is the facility that loads a program and its requisite libraries. It will load a preset
loadfile without rebinding ordinary symbols if the loadfile bindings are correct. This is
called FastLoad (TNS/E only). If rld has to rebind a loadfile and the loadfile import
control is localized, it will update the preset bindings in the loadfile with the cooperation
of the operating system. This is called automatic update (TNS/E only).
dlopen() loads libraries dynamically on demand and returns a handle
designating the library. The handle is used by dlsym() to access external
symbols in the library, and by dlclose() to unload any dynamically loaded
library brought in by dlopen() which obtained the handle.
dlsym() allows a process to obtain the address of an external symbol defined
within a loadfile via the handle that was provided by a previous call to dlopen().
dlclose() invalidates the handle of a loadfile previously opened by dlopen()and
unloads the loadfile if no other handle requires this loadfile.
dlresultcode() returns the error code for the last call to dlopen(), dlclose() or
dlsym().
dlerror() returns a character string which describes any error that occurred on
the immediately preceding call to dlopen(), dlclose() or dlsym().
How rld Operates
rld is invoked by the operating system when a PIC program is specified for process
creation. rld operates in five basic phases using the loader support facilities to load a
PIC main program and the libraries it needs:
1.rld initiates a session with the operating system