Guardian Native C Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)
Guardian Native C Library Calls (a - e) dlopen(3)
For OSS: /lib64, /usr/lib64, /usr/local/lib64, /lib, /usr/lib, /usr/local/lib,
/G/SYSTEM/YDLL, /G/SYSTEM/ZDLL in this order
where the asterisk (*) marks those locations that are omitted when the ld or eld command
-limit_runtime_paths option was used.
Environment Variables and Diagnostic Output
If you do not specify RTLD_VERBOSE() for mode in the dlopen( ) call, the verbosity level
defaults to that specified by _RLDVERBOSE=n. For OSS programs, _RLDVERBOSE=n is
defined as the following 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
Disposing of Unresolved Symbols
Users can specify an option to the ld or eld 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; this is the default option set by the ld or eld 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 func-
tion 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.
NOTES
The rld dynamic loader is an unprivileged interface; it cannot be invoked from a program or
DLL that is licensed or has callable functions, or from a program with a priv entry point. Process
creation fails if such a file refers to dlopen(), dlsym(), dlclose(), dlerror(),ordlresultcode().
Depending upon the circumstances, process-creation error/detail value combinations of 77,11 or
78,7 can result.
RETURN VALUES
Upon successful completion, the dlopen() function returns a library handle valid for use with
other DLL functions. This handle is an arbitrary token, not an address; it cannot be assigned to a
pointer and dereferenced.
dlopen( ) returns a 0 (zero) if the file designated by object_pathname:
• Could not be found
527192-018 Hewlett-Packard Company 1−167