Linker and Libraries Guide

Link-Editing

Link-editing takes a variety of input files, from cc(1), as(1) or ld(1), and 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 produced is one of four basic types:

Relocatable object

A concatenation of input relocatable objects, which can be used in subsequent link-edit phases.

Static executable

A concatenation of input relocatable objects that has all symbolic references bound to the executable, and thus represents a ready-to-run process.

Dynamic executable

A concatenation of input relocatable objects that requires intervention by the runtime linker to produce a runable process. Its symbolic references might still need to be bound at runtime, and it might have one or more dependencies in the form of shared objects.

Shared object

A concatenation of input relocatable objects that provides services that might be bound to a dynamic executable at runtime. The shared object might also have dependencies on other shared objects.

These output files, and the key link-editor options used to create them, are shown in Figure 1-1.

Dynamic executables and shared objects are often referred to jointly as dynamic objects and are the main focus of this document.

Figure 1-1 Static or Dynamic Link-Editing

Graphic