Rod Evans: Surfing With a Linker Alien |
The elfdiff(1) utility analyzes two ELF files and reports the significant differences between them. This utility is targeted at diagnosing the underlying changes that occur within an ELF file through a series of development updates.
Symbol capabilities are capabilities that are associated with individual functions, or initialized data items, within an object. Symbol capabilities allow for the presence of multiple instances of a function within a single object. The runtime linker selects the best one for the running system. This is how Solaris provides optimized implementations of routines (e.g. memcpy) with a generic fallback.
The difference between the -z direct
and -B direct
options, and a useful technique for handling
the case where the lazy dependency is not present at runtime.
The core Solaris OS is now built with Direct Binding. A discussion of the benefits, and the process used to get there safely.
The link-editor, and associated utilities, have moved from
/usr/ccs/bin
utilities to /usr/bin
.
It's best not to use
How to restrict an application to only use the interfaces defined by specific ELF versions.
The crle utility replaces the system default library directories, and can easily brick your system if you are not careful. An explanation, and how to recover.
How "wrong ELFCLASS" errors can be caused by missing or inconsistent compiler flags.
The challenges of C++ symbol visibility in a dynamic linking environment, and singletons.
The limitations of runtime token processing.
People often assume far more from runtime .init/.fini processing than is actually provided, and use it far too casually. Such code runs in a limited environment, and with many caveats.
Techniques for avoiding the unexpected costs that can be incurred
Relocation "does not fit" usually result from forgetting to create position independent (PIC) code.
The limitations of using mapfiles for interface creation, particularly with languages like C++, and the alternative of using source visibility attributes.
Starting with Solaris 10 you can no longer build a completely static executable. A discussion of the underlying reasons, and of the resulting benefits.
Standard and Auxiliary filters
How to use the extensive built in linking debug facility to trace what your programs are doing at runtime.
The potential cost of debug options at runtime can be higher than you realize.
Examining ELF versioning within the core OS.
A discussion of the potentially expensive fall back mechanism that underlies lazy loading.
Consider using lazy loading to make your applications start faster and do less unnecessary work.
The costs of linking against libraries you don't use, and how to detect when you're doing it.
The many ways in which LD_LIBRARY_PATH will let you down. There are usually better answers.