Friday October 13, 2006 | Surfing With a Linker Alien Rod Evans's Weblog |
|
Dynamic Object Versioning - specifying a version binding
After reading a previous posting on
versioning,
a developer asked
how they could specify what version to bind to when they built their
application. For example, from the version definitions
within
% pvs -d /lib/libelf.so.1
libelf.so.1;
SUNW_1.5;
SUNW_1.4;
....
SUNWprivate_1.1;
how could you restrict an application to only use the interfaces
defined by The Linker and Libraries Guide covers this topic in the section Specifying a Version Binding. In a nutshell, you can specify a version control mapfile directive:
% cat mapfile
libelf.so - SUNW_1.4;
Notice that the shared object name is the compilation environment name.
This is the name that gets resolved when you specify
Note, if you build against For example, this application is referencing gelf_getcap(3ELF).
% pvs -r prog
libelf.so.1 (SUNW_1.5);
....
% pvs -dos /lib/libelf.so.1 | fgrep SUNW_1.5
/lib/libelf.so.1 - SUNW_1.5: gelf_getcap;
/lib/libelf.so.1 - SUNW_1.5: gelf_update_cap;
Note also, binding to specific versions is not a panacea for building
software on release Of course, building on the latest release can provide a richer debugging environment in which to develop your software. I often try building things on the latest environment, and then fall back to the oldest environment for final testing and for creating final deliveries.
Technorati Tag: OpenSolaris Technorati Tag: Solaris (2006-10-13 10:48:22.0) Permalink Comments:
Post a Comment: Comments are closed for this entry. |
|
||||