Using Shared Libraries with cc and ld Options.........................................................................
138
Initializers for Shared Libraries................................................................................................
Styles of Initializers ..........................................................................................................
Init/Fini Style Initializers...............................................................................................
HP-UX-10.X Style Initializers...........................................................................................
139
Using Init/Fini Initializers..................................................................................................
Init and Fini Usage Example.........................................................................................
Ordering Within an Executable or Shared Library...........................................................
141
Ordering Among Executables and Shared Libraries.........................................................
142
Using HP-UX 10.X Style Initializers......................................................................................
143
Declaring the Initializer with the +I Option......................................................................
Order of Execution of Multiple Initializers.......................................................................
Initializer Syntax..........................................................................................................
144
Accessing Initializers' Addresses...............................................................................
Example: An Initializer for Each Library..........................................................................
Example: A Common Initializer for Multiple Libraries........................................................
146
The dlopen Shared Library Management Routines.....................................................................
148
The dlopen Routine .........................................................................................................
Syntax ......................................................................................................................
Return Values..............................................................................................................
149
Description.................................................................................................................
150
Using dlopen to load a shared library...........................................................................
152
The dlsetlibpath Routine....................................................................................................
153
Synopsis....................................................................................................................
Using dlsetlibpath to set the dynamic search path.......................................................
154
Multithread Usage.......................................................................................................
155
Return Value...............................................................................................................
Errors........................................................................................................................
The dlerrno Routine..........................................................................................................
The dlgetfileinfo Routine....................................................................................................
157
The dlerror Routine...........................................................................................................
Syntax.......................................................................................................................
Using dlerror to get diagnostic information.....................................................................
The dlsym Routine............................................................................................................
158
Usage.......................................................................................................................
Using dlopen and dlsym to access either function or data objects......................................
The dlget Routine.............................................................................................................
159
Using dlget to retrieve information about loaded modules.................................................
160
The dlmodinfo Routine......................................................................................................
8Contents