dlopen shall behave as specified in ISO/IEC 9945:2003 Portable Operating System(POSIX)and The Single UNIX® Specification(SUS) V3, but with additional behaviors listed below.
If the file argument does not contain a slash character, then the system shall look for a library of that name in at least the following directories, and use the first one which is found:
The directories specified by the
DT_RPATH
dynamic entry.
The directories specified in the
LD_LIBRARY_PATH
environment variable (which is a colon separated list of pathnames).
This step shall be skipped for setuid
and setgid executables.
A set of directories sufficient to contain the libraries specified in this standard. [1]
[1] | Traditionally, /lib and /usr/lib. This case would also cover cases in which the system used the mechanism of /etc/ld.so.conf and /etc/ld.so.cache to provide access. Example: An application which is not linked against libm may choose to dlopen libm. |