$ a.out
dld.so: Unable to find library 'libfile2.1' $ export SHLIB_PATH=/var/tmp
$ a.out in file1 in file2
Library Example: IPF Compatibility Mode Link
This example builds a compatibility mode library and does a compatibility mode link. The +s option is not specified at link time, so the dynamic loader does not look at any environment variables to do dynamic path searching.
#build compatibility mode dlls
#libfile1.so is a dependent of libfile2.so
ld
ld
ld main.o +compat
#move dependent lib so dld can't find it. Even when we specify SHLIB_PATH dld won't be
#able to find the dependent because we didn't link with +s
mv libfile2.so /var/tmp
ln
dld.so: Unable to find library '1:./libfile2.1' export SHLIB_PATH=/var/tmp
a.out
dld.so: Unable to find library '1:./libfile2.1'
You can use chatr+s to enable a.out in file1 and file2:
$ chatr +s enable a.out
Library Example: Using IPF Compatibility and Standard Shared Libraries
This example mixes compatibility and standard mode shared libraries. It uses
#build standard mode dlls
#libfile1.so is a dependent of libfile2
$ ld
$ ld
# build compatibility mode dlls
# libfile3.so is a dependent of libfile4
$ ld
$ ld
$ ln
$ mv libfile3.so TMP $ cd TMP
$ ln
$ cd ..# link with +b so ld will use RPATH at link time to find
# libfile1.so (standard mode dll)
# the linker will not use RPATH to find libfile3.so
# (compatibility mode dll)
# Note that this is true in both a standard mode link and a
# compatibility mode link. The
# linker never uses RPATH to find any compatibility mode dlls
$ ld
$ ld
Comparing
For the following libraries with dependencies:
lib1.so has dependents lib2.so, lib3.so, and lib4.so lib2.so has dependents lib2a.so and lib2b.so
Using Shared Libraries in Default Mode 133