The SunOS release 4.x software supported both major and minor version numbers on shared libraries. The Solaris 2.6 operating environment supports only the major version number. For binary compatibility support, major and minor version numbers are recognized on SunOS release 4.x shared libraries. These libraries are required to retain the same major and minor version number they had in the SunOS release 4.x software.
Table 15-4 shows versions of SunOS release 4.x and Solaris 2.6 shared libraries.
Table 15-4 Example Shared Libraries
SunOS release 4.x |
Solaris 2.6 |
---|---|
libc.so.1.7 |
libc.so.1 |
libdl.so.1.0 |
libdl.so.1 |
In SunOS release 4.x system software, when the -l option was specified, the build environment linker searched for a library with both major and minor numbers. For example, if -ldl was specified, the library, libdl.so.1.0 was linked. In the Solaris 2.6 environment, even though major numbers are still supported, the default behavior of the link editor is to ignore version numbers. Using the previous example, the build environment link editor now searches for libdl.so and a symbolic link points to a specific version file.
The recording of a dependency in a dynamic executable or shared object is, by default, the file name of the associated shared object as it is referenced by the link editor. To provide a more consistent means of specifying dependencies, shared objects can record within themselves the file name by which they should be referenced at runtime. This is specified with the -h option when linking the library file.
Symbolic links have been created for most libraries in this release. You should build any new shared libraries with major numbers, then create a symbolic link to the version of the library that is used most often.