Linker and Libraries Guide

Overview

The following sections provide a simple overview, or cheat sheet, of the most commonly used link-editor scenarios (see "Link-Editing" for an introduction to the kinds of output modules generated by the link-editor).

The examples provided show the link-editor options as supplied to the compiler driver cc(1), this being the most common mechanism of invoking the link-editor (see "Using a Compiler Driver").

The link-editor places no meaning on the name of any input file. Each file is opened and inspected to determine the type of processing it requires (see "Input File Processing").

Shared objects that follow a naming convention of libx.so, and archive libraries that follow a naming convention of libx.a, can be input using the -l option (see "Library Naming Conventions"). This provides additional flexibility in allowing search paths to be specified using the -L option (see "Directories Searched by the Link-Editor").

The link-editor basically operates in one of two modes, static or dynamic.