Linker (computing)

A simpler version that writes its output directly to memory is called the loader, though loading is typically considered a separate process.

While the process of linking is meant to ultimately combine these independent parts, there are many good reasons to develop those separately at the source-level.

Many operating system environments allow dynamic linking, deferring the resolution of some undefined symbols until a program is run.

This approach offers two advantages: There are also disadvantages: Contained or virtual environments may further allow system administrators to mitigate or trade-off these individual pros and cons.

In general, the substituted sequences are shorter, which allows this process to always converge on the best solution given a fixed order of objects; if this is not the case, relaxations can conflict, and the linker needs to weigh the advantages of either option.

In some cases, relaxation can also occur at load-time as part of the relocation process or combined with dynamic dead-code elimination techniques.

It also permits program updates to be distributed in the form of small files (originally card decks), containing only the object module to be replaced.

In later releases of OS/360 and in subsequent systems, load-modules contain additional data about versions of components modules, to create a traceable record of updates.

It is intended for batch-mode execution, with the editing commands being supplied by the user in sequentially organized files, such as punched cards, DASD, or magnetic tape.

Linkage editing (IBM nomenclature) or consolidation or collection (ICL nomenclature) refers to the linkage editor's or consolidator's act of combining the various pieces into a relocatable binary, whereas the loading and relocation into an absolute binary at the target address is normally considered a separate step.

Notable implementations: On Unix and Unix-like systems, the static linker is usually invoked via the command ld which is an abbreviation of LoaDer or Link eDitor.

A linker script may be passed to GNU ld to exercise fine grain control of the linking process.

An illustration of the linking process. Object files and static libraries are assembled into a new library or executable