How software pieces find each other in a digital puzzle

How software pieces find each other in a digital puzzle
Image: Intellect (generated)

In short: Modern software is rarely built as one giant block of code. Instead, it is assembled from hundreds of independent modules. The linker is the invisible architect that stitches these fragments together, resolving addresses and mapping symbols so they can communicate as a single functional program.

At its core, a linker (or link editor) combines intermediate files—like object and library files—into a final executable. While developers prefer writing code in separate modules to manage complexity and maintainability, these pieces cannot run alone because they refer to each other using 'symbols' rather than fixed memory addresses. The linker resolves these symbols, mapping them into the correct locations so that a call from one module successfully reaches its destination in another.

The process involves sophisticated logistics regarding address space. Because compilers rarely know where an object will ultimately reside, they often assume a default base location like zero. Linkers must perform 'relocation,' which involves re-targeting absolute jumps, loads, and stores to the correct addresses. In some cases, linkers also perform 'automatic jump-sizing' (or relaxation). This optimizes machine code by replacing conservative, large instructions with shorter, more efficient ones once final addresses are known.

There is a significant distinction between static and dynamic linking. Static linking copies all required library routines directly into the executable image, making it highly portable but potentially bulky. Dynamic linking, however, defers symbol resolution until the program runs. This allows multiple programs to share a single copy of a system library in memory, saving space and allowing for easier updates—though it can lead to 'DLL hell,' where incompatible library versions break software. On some systems, like IBM's OS/360, this was historically handled by a 'linkage editor' capable of updating specific program sections without re-compiling the entire system.

Today, linkers are often part of automated toolchains, but they remain critical for performance and architecture. Modern alternatives to the traditional GNU ld include lld from the LLVM project and mold, which is designed for high parallelism.

Opens the Intellect+ feed with this card first. Swipe up for the next one.

Sources

To cite this card, link to https://intellectplus.co.uk/app/science-linker-computing.

How we source, check and correct cards: Editorial standards.

General information, not professional advice. Spotted an error? Flag the card or see corrections and complaints.

Intellect Plus is a visual educational discovery platform for exploring fascinating facts and ideas. Brain Food, Not Brain Rot. What is Intellect Plus?

Related

Finding something worth knowing…