Chapter 5 177
Creating and Using Libraries
Using Shared Libraries in 64-bit mode
• If the dependent library’s internal name contains a relative path, the
internal name is inserted at the end of the path where the shared
library is found at link time, replacing the library’s filename in the
DT_HP_NEEDED entry. If the library is specified with -l, the dynamic
path bit is set to TRUE.
• If the dependent library’s internal name contains no path, it is
inserted at the end of the path where the shared library is found at
link time, replacing the library’s filename. If the library is specified
with -l, the dynamic path bit is set to TRUE.
• If the dependent shared library does not have an internal name, the
path where the library is found and the library filename is recorded
in the DT_HP_NEEDED entry. If specified with -l, the dynamic path
bit is set to TRUE.
• If the shared libraries are specified with a relative or no path in this
mode, the linker expands the current working directory when
constructing the DT_HP_NEEDED entry. So instead of getting
something like ./libdk.sl, you get /home/your_dir/libdk.sl.
• All DT_HP_NEEDED entries with the dynamic path bit set are subject
to dynamic path lookup.
In standard mode, the linker treats shared library names as follows:
• If the dependent shared library has an internal name, it is recorded
in the DT_NEEDED entry.
otherwise
• If the dependent shared library is specified with the -l or -l:
option, only the libname.ext is recorded in the DT_NEEDED entry.
otherwise
• The path of the dependent shared library as seen on the link line is
recorded in the DT_NEEDED entry.
• All DT_NEEDED entries with no "/" in the libname are subject to
dynamic path lookup.
Dynamic Path Searching for Shared Libraries
In the 64-bit mode of the linker toolset (selected by default or with the
+std option), any library whose name has no "/" character in it becomes
a candidate for dynamic path searching. Also, the linker always uses the