122 Chapter 5
Creating and Using Libraries
Overview of Shared and Archive Libraries
Overview of Shared and Archive
Libraries
HP-UX supports two kinds of libraries: archive and shared. A shared
library is also called a dll (dynamically linked library), particularly in
the context of the 64-bit mode linker. Archive libraries are the more
traditional of the two. The following table summarizes differences
between archive and shared libraries.
Comparing Archive Shared (or dll)
file name suffix Suffix is .a. Suffix is .sl or .number representing a
particular version of the library.
object code Made from relocatable
object code.
Made from position-independent object
code, created by compiling with the +z or
+Z compiler option. Can also be created in
assembly language (see Chapter 7,
“Position-Independent Code,” on page
259).
creation Combine object files with
the ar command
Combine PIC object files with the ld
command