Skip Navigation Links | |
Exit Print View | |
![]() |
Linker and Libraries Guide Oracle Solaris 11 Express 11/10 |
1. Introduction to the Oracle Solaris Link Editors
5. Application Binary Interfaces and Versioning
A. Link-Editor Quick Reference
C. Establishing Dependencies with Dynamic String Tokens
Capability Specific Shared Objects
Instruction Set Specific Shared Objects
Locating Associated Dependencies
Dependencies Between Unbundled Products
E. System V Release 4 (Version 1) Mapfiles
The dynamic tokens $OSNAME, $OSREL, $PLATFORM and $MACHINE are expanded at runtime to provide system specific information. These tokens are available for filters, runpath, or dependency definitions.
$OSNAME expands to reflect the name of the operating system, as displayed by the utility uname(1) with the -s option. $OSREL expands to reflect the operating system release level, as displayed by uname -r. $PLATFORM expands to reflect the underlying platform name, as displayed by uname -i. $MACHINE expands to reflect the underlying machine hardware name, as displayed by uname -m.
The following example shows how the auxiliary filter libfoo.so.1 can be designed to access a platform specific filtee libbar.so.1.
$ LD_OPTIONS='-f /platform/$PLATFORM/lib/libbar.so.1' \ cc -o libfoo.so.1 -G -K pic -h libfoo.so.1 -R. foo.c $ elfdump -d libfoo.so.1 | egrep 'SONAME|AUXILIARY' [2] SONAME 0x1 libfoo.so.1 [3] AUXILIARY 0x96 /platform/$PLATFORM/lib/libbar.so.1
This mechanism is used in the Oracle Solaris OS to provide platform specific extensions to the shared object /lib/libc.so.1.