The linker is part of the toolchain for producing executables from source code written in compiled programming languages. It takes compiled object code in multiple files and produces a single, "linked", executable file from them.
Separately-compiled programming languages such as C and C++ rely on a linker to turn one or more object files and libraries into an executable. The linker resolves undefined symbol references in object files by linking them to symbol definitions in other object files and libraries. The linker also arranges variables and functions to assign them addresses in the final executable,
On Unix-like operating systems the linker is typically named ld
and is often invoked automatically by the compiler as the last step in the compilation process.
Books about linkers:
- Linkers and Loaders by John R. Levine, published by Morgan-Kauffman. October 1999. ISBN 1-55860-496-0.
- Assemblers, Linkers and Loaders, by David Solomon. Online PDF.