Skip Navigation Links | |
Exit Print View | |
Oracle Solaris 11.1 Linkers and Libraries Guide Oracle Solaris 11.1 Information Library |
Part I Using the Link-Editor and Runtime Linker
1. Introduction to the Oracle Solaris Link Editors
32-Bit Environments and 64-Bit Environments
5. Link-Editor Quick Reference
7. Building Objects to Optimize System Performance
10. Establishing Dependencies with Dynamic String Tokens
Part IV ELF Application Binary Interface
13. Program Loading and Dynamic Linking
A. Linker and Libraries Updates and New Features
Link-editing takes a variety of input files, typically generated from compilers, assemblers, or ld(1). The link-editor concatenates and interprets the data within these input files to form a single output file. Although the link-editor provides numerous options, the output file that is produced is one of four basic types.
Relocatable object – A concatenation of input relocatable objects that can be used in subsequent link-edit phases.
Static executable – A concatenation of input relocatable objects that have all symbolic references resolved. This executable represents a ready-to-run process. See Static Executables.
Dynamic executable – A concatenation of input relocatable objects that requires intervention by the runtime linker to produce a runnable process. A dynamic executable might still need symbolic references bound at runtime. Dynamic executables typically have one or more dependencies in the form of shared objects.
Shared object – A concatenation of input relocatable objects that provide services that might be bound to a dynamic executable at runtime. The shared object can have dependencies on other shared objects.
These output files, and the key link-editor options used in their creation, are shown in Figure 1-1.
Dynamic executables and shared objects are often referred to jointly as dynamic objects. Dynamic objects are the main focus of this document.
Figure 1-1 Static or Dynamic Link-Editing
The creation of static executables has been discouraged for many releases. In fact, 64–bit system archive libraries have never been provided. Because a static executable is built against system archive libraries, the executable contains system implementation details. This self-containment has a number of drawbacks.
The executable is immune to the benefits of system patches delivered as shared objects. The executable therefore, must be rebuilt to take advantage of many system improvements.
The ability of the executable to run on future releases can be compromised.
The duplication of system implementation details negatively affects system performance.
Beginning with the Oracle Solaris 10 release, the OS no longer includes 32–bit system archive libraries. Without these libraries, specifically libc.a, the creation of a static executable is no longer achievable without specialized system knowledge. Note, that the link-editors ability to process static linking options, and the processing of archive libraries, remains unchanged.