DLL Programmer's Guide for TNS/R Systems
Dynamic Use of DLLs
DLL Programmer’s Guide for TNS/R Systems—522203-002
3-3
dlopen’s Mode Parameter Values
a Localized Loadfile on page 4-5; whereas, the loader binds symbols imported by an
added globalized DLL to those offered by the entire new operating load set. To resolve
globalized symbols, the added load set’s search list is appended to the end of the old
operating load set’s globalized search list, which is described in The SearchList for a
Globalized Loadfile on page 4-8. dlopen can issue either warnings or errors as a result
of unresolved symbols, as described in Unresolved Symbols at Load Time on
page 2-17.
The old operating load set cannot have symbol references that must be bound to
symbol definitions in the added load set, because these would have caused errors
when the old operating load set was loaded. Instead, the old operating load set can
have pointers to procedures and data that are initially unused. Then after dlopen loads
the added load set, the old operating load set can call dlsym to fill in the pointers, as
described in Accessing Symbols (dlsym) on page 3-5.
dlopen’s Mode Parameter Values
dlopen() accepts any valid combination of the mode options described below. These
values are defined in the header file dlfcn.h. A mode value of zero is invalid. The
options are as follows:
RTLD_NOW:
This option performs all linking on the newly loaded library immediately.
RTLD_LAZY:
This option is accepted to provide compatibility for Unix , but is treated the same as
RTLD_NOW.
RTLD_GLOBAL:
This option specifies that the newly loaded DLLs should be added to the cumulative
loadList i.e. new libraries are added to the global set, which consists of the program
and libraries loaded initially by rld. This is the default.
RTLD_LOCAL:
This option is accepted to provide compatibility for Unix, but is treated the same as
RTLD_GLOBAL.
RTLD_NOLOAD:
This option specifies that dlopen() should not load the target library, but should provide
a unique handle to it, if it is already loaded. This option causes dlopen() to return a 0 if
the library is not already loaded. Note that any handle returned by dlopen() counts as a
usage of the target library and until it is closed, the library is not unloaded.
RTLD_VERBOSE(verbosity_level)
This option specifies the diagnostic output detail from calls to dynamic linking functions
regarding loading of library files, resolution of symbol names and search details for files
and symbols. The verbosity_level values are the same as rld’s and are as follows:
0 - default (as though this specification is absent)
1 - none (no output to hometerm/stderr)
2 - warnings and errors