Linker and Libraries Guide

Invoking the Support Interface

The link-editor accepts one or more support libraries provided by either the SGS_SUPPORT environment variable or with the link-editor's -S option. The environment variable consists of a colon separated list of support libraries:


$ SGS_SUPPORT=./support.so.1:libldstab.so.1 cc ...

The -S option specifies a single support library. Multiple -S options can be specified:


$ ld -S ./support.so.1 -S libldstab.so.1 ...

A support library is a shared object. The link-editor performs a dlopen(3X) on each shared object, in the order they are specified. If both the environment variable and -S option are encountered, then the shared objects specified with the environment variable are processed first. Each support library is then searched, using dlsym(3X), for any support interface routines. These support routines are then called at various stages of link-editing.


Note -

By default, the Solaris support library libldstab.so.1 is used by the link-editor to process, and compact, compiler-generated debugging information supplied within input relocatable objects. This default processing is suppressed if you invoke the link-editor with any support libraries specified using the -S option. If the default processing of libldstab.so.1 is required in addition to your support library services, then libldstab.so.1 should be explicitly added to the list of support libraries supplied to the link-editor.



Note -

In Solaris 7, ld is a 64-bit program when the 64-bit kernel is running, and a 32-bit program when the 32-bit kernel is running. The interface description below shows that the support interface for 64-bit ELF objects is similar to the 32-bit support interface, but all of the entry points end in a 64 suffix, for example ld_start() and ld_start64(). This allows both implementations of the support interface to reside in a single shared object libldstab.so.1 of each class, 32-bit and 64-bit.