HP-UX Linker and Libraries User's Guide
compatibility-mode libraries even if they are really created as standard mode dependent
libraries.
• Does not use embedded paths at link time to find dependent libraries.
• Considers the order of ld, +b and +s.
The +b option first means dld looks at the RPATH first when searching for dependent
shared libraries. To get the default RPATH, you must specify ld +b. This instructs the
linker to construct a default RPATH consisting of the -L directories and LPATH.
◦
◦ The +s option first means the dynamic loader looks at the SHLIB_PATH environment
variable first when searching for dependent shared libraries. You must specify ld +s to
force the dynamic loader to use SHLIB_PATH to search for shared libraries at runtime.
At runtime, the dynamic loader does a PA-32 load for all compatibility-mode dependent shared
libraries. The dynamic loader:
• Does dynamic path searching for compatibility-mode dependent shared libraries that have
the dynamic path selected (set in the DT_HP_NEEDED entry if the shared library was specified
with -l).
• Uses SHLIB_PATH only if you specify ld +s (or chatr+s) for compatibility-mode shared
libraries.
• Allows RPATH inheritance from ancestors to children when searching for dependent
compatibility-mode shared libraries specified with ld -l. This is only allowed in an a.out
that was linked with +compat. If a.out was linked in standard mode with +std option,
no library (even a compatibility mode shared library) uses embedded RPATH inheritance.
• Allows dynamic path searching on shared libraries loaded by shl_load routines, if the
DYNAMIC_FLAG is passed to shl_load().
• Does a depth-first search of all compatibility-mode dependent libraries.
• Looks at RPATH or SHLIB_PATH first, depending on the ld +b/+s ordering for all ld -l
dependent shared libraries. Next, the dynamic loader looks at whichever has second
precedence, and then looks for the shared library as specified in the dynamic load entry.
• Looks for the dynamic table entry as if the dynamic path bit is not set.
Using the Linker with +std for Standard Mode
The +std option instructs the linker to do a standard mode PA-64 link. This is currently the default.
This default may change in future releases.
When you use +std, the linker:
• Assumes -dynamic was passed to ld. The linker looks for shared libraries first. The output
executable is a shared executable.
• All dependent shared libraries are output in the dynamic table in a DT_NEEDED entry. These
dependent shared libraries are recorded as standard mode shared libraries.
• The ld +b and +s ordering is ignored. The ld +s option is on by default.
• Uses de facto standard internal name processing for dependent shared libraries.
• Uses embedded RPATHs at link time to find dependent shared libraries.
• If you do not specify ld +b, the linker uses a default RPATH consisting of the -L directories,
LPATH, and the default directories /usr/lib/hpux32:/opt/langtools/lib/hpux32
for 32-bit applications and /usr/lib/hpux64:/opt/langtools/lib/hpux64 for 64-bit
applications.
Using Linker Commands 47