Linker and Libraries Guide

System Specific Shared Objects

The dynamic tokens $OSNAME, $OSREL and $PLATFORM 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 hardware implementation, as displayed by uname -i.

The following example shows how the auxiliary filter can be designed to access a platform specific filtee

$ LD_OPTIONS='-f /platform/$PLATFORM/lib/' \
cc -o -G -K pic -h -R. foo.c
$ dump -Lv | egrep "SONAME|AUXILIARY"
  [1]    SONAME
  [2]    AUXILIARY /platform/$PLATFORM/lib/

This mechanism is used in the Solaris OS to provide platform specific extensions to the shared object /lib/