Guardian Native C Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)
Guardian Native C Library Calls (a - e) dlopen(3)
Symbol controls within the loadfiles affect a call to dlopen(); that is, the library designated by
object_pathname and each library it requires can be localized, globalized, or semi-globalized
itself, and its symbols are resolved accordingly.
dlopen( ) does not load licensed libraries.
Controlling the Loader Search Path
Users can specify the search path used to find libraries without fully qualified file names. The
search path can be specified through path lists, either at link time or at run time. The path list (a
colon-separated sequence of path list elements) supplied at link and load time also applies to any
dlopen( ) invocations when that process is running. Each path list element is an OSS directory
pathname (for OSS processes) or a Guardian subvolume name (for Guardian processes).
The search path for the libraries that rld and dlopen() use is not used to search for public
libraries. Instead, the operating system makes public libraries available to rld and dlopen().
When building a loadfile, users can specify a run-time path list at link time using the ld or eld
command. This information is stored in the .dynamic section of the object file as the values for
rpath and rpath_first for use by rld and dlopen( ) at load time.
If rpath is absent or null, the default run-time path list is:
1. Public libraries
2. Program location
3. Default locations for 32-bit processes:
For OSS: /lib, /usr/lib, /usr/local/lib, /G/SYSTEM/ZDLL
For Guardian: $SYSTEM.ZDLL
Default locations for 64-bit processes:
For OSS: /lib64, /usr/lib64, /usr/local/lib64, /lib, /usr/lib, /usr/local/lib,
/G/SYSTEM/YDLL, /G/SYSTEM/ZDLL in this order
The linker (ld or eld) can place path lists in the loadfile, using the following options:
-rld_l path_list[:path_list]...
This option specifies one or more path lists for the run-time loader to look for
libraries
-rld_first_l path_list[:path_list]...
This option is like -rld_l except that it specifies places to look before looking in
the public libraries. The resulting path list is placed as a separate rpath_first
item in the .dynamic section of the loadfile.
The loader uses these path lists in the target environment. Invalid path list elements or path list
elements for locations without libraries are ignored, so the list can contain a mix of Guardian
subvolume names and OSS directory names.
At link time, the ld or
eld command
option -limit_runtime_paths can be specified to limit the
loader’s path list at run time. When this option is specified, the items marked with an asterisk (*)
in the search lists described in this reference page are omitted from the search.
When the ld or eld loadfile options are used, the run-time search path list becomes:
527192-018 Hewlett-Packard Company 1−165