Kenwood HP 9000 Personal Computer User Manual


 
154 Chapter 5
Creating and Using Libraries
Version Control with Shared Libraries
Figure 5-6
With these links in place, the loader will load /X/libapp.0 when
running the a.out file created above. New applications will link and run
with /X/libapp.1.
NOTE Renaming the old version of the .0 version library only works for 32-bit
mode.
For 64-bit mode programs, the dynamic loader only loads the library
recorded in the dynamic load table. You should use library-lever
versioning and create your 64-bit shared library with an internal name
unless the library will not be versioned in the future.
Using shl_load(3X) with Library-Level Versioning
Once library level versioning is used, calls to shl_load(3X) should specify
the actual version of the library to be loaded. For example, if libA.sl is
now a symbolic link to libA.1, then calls to dynamically load this
library should specify the latest version available when the application is
compiled as shown below:
shl_load("libA.1", BIND_DEFERRED, 0);
This insures that when the application is migrated to a system that has
a later version of libA available, the actual version desired is the one
that is dynamically loaded.
Intra-Library Versioning
Intra-library versioning is a second method of maintaining multiple
incompatible versions of shared library routines. Library-level
versioning is recommended over intra-library versioning.
This section provides information on the following topics:
“The Version Number Compiler Directive”