HP-UX Linker and Libraries User's Guide
Version Control with Shared Libraries......................................................................................110
When to Use Shared Library Versioning..............................................................................110
Maintaining Old Versions of Library Modules......................................................................111
Library-Level Versioning.....................................................................................................111
How to Use Library-Level Versioning ..............................................................................111
Creating a New, Incompatible Version of the Library ......................................................112
Migrating an Existing Library to Use Library-Level Versioning.............................................112
The +h Option and Internal Names...............................................................................112
File System Links to Shared Libraries...................................................................................112
Using shl_load(3X) with Library-Level Versioning...................................................................113
Intra-Library Versioning (PA-RISC only).................................................................................113
The Version Number Compiler Directive.........................................................................113
Shared Library Dependencies and Version Control...........................................................114
Adding New Versions to a Shared Library......................................................................114
Specifying a Version Date............................................................................................115
Switching from Archive to Shared Libraries...............................................................................115
Relying on Undocumented Linker Behavior ..........................................................................115
Absolute Virtual Addresses................................................................................................116
Stack Usage....................................................................................................................116
Version Control................................................................................................................116
Debugger Limitations........................................................................................................116
Using the chroot Command with Shared Libraries.................................................................117
Profiling Limitations..........................................................................................................117
Summary of HP-UX Libraries...................................................................................................117
Caution When Mixing Shared and Archive Libraries.................................................................118
Example 1: Unsatisfied Symbols.........................................................................................118
Example 2: Using shl_load(3X)..........................................................................................120
Example 3: Hidden Definitions..........................................................................................122
Using Shared Libraries in Default Mode...................................................................................124
Internal Name Processing.................................................................................................125
Dynamic Path Searching for Shared Libraries.......................................................................126
Shared Library Symbol Binding Semantics...........................................................................126
Link-Time Symbol Resolution in Shared Libraries ..............................................................126
Resolution of Unsatisfied Shared Library References.........................................................127
Promotion of Uninitialized Global Data Items.............................................................128
Symbol Searching in Dependent Libraries..................................................................129
Mixed Mode Shared Libraries............................................................................................130
IPF Library Examples........................................................................................................131
Library Example: Creating an IPF Compatibility Mode Shared Library................................131
Library Example: Creating an IPF Standard Mode Shared Library......................................132
Library example: IPF Dynamic Path Searching.................................................................132
Library Example: IPF Compatibility Mode Link.................................................................133
Library Example: Using IPF Compatibility and Standard Shared Libraries............................133
Comparing Breadth-first and Depth-first Search in IPF/PA-64 Mode....................................133
Library Example: Using RPATH with Standard Mode Shared Library...................................134
Linking Libraries with +b pathlist....................................................................................134
Library Example: Linking to Libraries with +b path_list in IPF/PA-64 Mode..........................134
Library Example: Linking to Libraries with +b path_list in PA-32 Mode................................135
7 Shared Library Management Routines.......................................................136
Shared Library Management Routine Summaries.......................................................................136
The dlopen Routines Summary...........................................................................................136
The shl_load Routine Summary..........................................................................................137
Related Files and Commands.............................................................................................137
Shared Library Header Files...................................................................................................137
Contents 7