176 Chapter 5
Creating and Using Libraries
Using Shared Libraries in 64-bit mode
Using Shared Libraries in 64-bit mode
In the HP-UX 11.00 release, HP provides an industry-standard linker
toolset for programs linked in 64-bit mode. The new toolset consists of a
linker, dynamic loader, object file class library, and an object file tool
collection. Although compatibility between the current and previous
toolset is an important goal, some differences exist between these
toolsets.
The 64-bit mode linker toolset introduces different types of shared
libraries. (In SVR4 Unix, shared libraries are sometimes called dlls.)
Compatibility mode shared library: Using the 64-bit mode linker,
a compatibility mode shared library is basically a library built with
ld -b +compat that has dependent shared libraries. The +compat
option affects the way the linker and loader search for dependent
libraries of a shared library and records their names.
Standard mode shared library: A standard mode shared library is
a library built with ld -b or ld -b +std with dependent shared
libraries.
NOTE If you specifyld -b +compat with no dependent libraries, you create a
shared library that has no mode —neither compatibility mode nor
standard mode.
The linker handles these libraries in different way with regard to
internal naming and library search modes.

Internal Name Processing

For both 32-bit mode and 64-bit mode, you specify shared library internal
names using ld +h name However, their dependent libraries’ internal
names may not be recorded the same way in a standard mode link.
In an ld +compat link, the linker treats the internal names like it does
in 32-bit mode:
If the dependent library’s internal name is rooted (starts with “/”), it
is inserted as is in the DT_HP_NEEDED entry. If it was specified with
-l, the dynamic path bit is set to TRUE in the DT_HP_NEEDED entry.