Dynamic Path Searching for Shared Libraries
Any library whose name has no "/" character in it becomes a candidate for dynamic path searching. Also, the linker always uses the LD_LIBRARY_PATH and the SHLIB_PATH environment variable to add directories to the run time search path for shared libraries, unless the ld +noenvvar option is set.
In
The following example shows dynamic path searching changes for default mode.
$ ld main.o \ | Subject to |
dynamic path searching. |
The dynamic loader searches for libfoo.so in the directories specified by the LD_LIBRARY_PATH and SHLIB_PATH environment variables.
Shared Library Symbol Binding Semantics
Symbol binding resolution, both at link time and run time, changes slightly in the IPF and
This section covers the following topics:
•
•Resolution of unsatisfied shared library references
•Promotion of uninitialized global variables
•Symbol searching in dependent libraries
In the IPF and
The
If you have function names that are duplicated in a shared and archive library, the IPF and
For example, given these source files:
sharedlib.c
void afunc()
{
printf("\tin SHARED library procedure 'afunc'\n");
}
unsat.c
void bfunc()
{
afunc();
}
archive.c
126 Creating and Using Libraries