rld Manual

Using the rld Loader Library
RLD Manual528857-006
2-5
dlopen()
The dlopen() function does not set the errno variable. For error information, call the
dlerror() or dlresultcode() function.
Unresolved Symbols
Unresolved symbols can cause dlopen() to generate warnings or errors, depending
on the user-specified option for treating unresolved symbols. If the option saved in the
object file specifies that unresolved symbols generate errors, dlopen() returns 0
(zero) without loading any DLLs. Otherwise, dlopen() returns a valid library handle.
In the case of an error, you can call dlerror() to retrieve a summary message.
Disposing of Unresolved Symbols
You can specify an option to the linker to control disposition of unresolved symbols in a
loadfile. The option is stored in the loadfile and determines whether rld or dlopen()
generates warnings or errors when it encounters unresolved procedure references in
the loadfile. For unresolved data symbols, dlopen() always reports an error.
For unresolved procedure symbols, the options are:
Report errors (the default option set by the linker).
Report warnings to the home terminal for references to unresolved procedures, but
report no errors (if RTLD_VERBOSE(1) is used, no warnings are reported).
Report no errors or warnings, despite references to unresolved procedures.
If any procedure symbol is unresolved when a loadfile is loaded, that symbol is bound
to a function named UNRESOLVED_PROCEDURE_CALLED_. The system (implicit)
library includes a default internal implementation of
UNRESOLVED_PROCEDURE_CALLED_. When called, it generates a nondeferrable
SIGILL signal. The run-time loader searches for
UNRESOLVED_PROCEDURE_CALLED_ using the import controls specified in the
loadfile, just as it searches for any other symbol. Therefore, a user’s definition for the
function takes precedence over the internal definition.
Environment Variables and Diagnostic Output
If you do not specify RTLD_VERBOSE for mode in a dlopen() call, the verbosity
level defaults to that specified by _RLDVERBOSE=n. For OSS programs,
_RLDVERBOSE=n is defined as this environment variable:
_RLDVERBOSE=n
where n has the possible values and meanings described for the RTLD_VERBOSE(n)
value for mode.
For Guardian programs, the CLASS MAP DEFINE =_RLDVERBOSE performs the
equivalent action. For example:
ADD DEFINE =_RLDVERBOSE, CLASS MAP, FILE #4