LOGBOOK

HELP

Quiz Entry - updated: 2026.07.10

What are the two main steps a linker performs?

First symbol resolution (match every symbol reference to exactly one definition), then relocation (merge sections and patch references to their final addresses).

The linker's two steps: symbol resolution matches each reference to one definition, then relocation merges sections, assigns addresses and patches references

* Resolution must run first — addresses can't be assigned until every symbol's single definition is known. *

The order is forced: you can't compute final addresses until you know which symbols exist and where each is defined, so resolution must come before relocation.

Step 1: Symbol Resolution

  • Programs define and reference symbols (functions and variables)
  • Symbol definitions are stored in a symbol table
  • Each entry contains: name, size, and location
  • Goal: Associate each symbol reference with exactly one symbol definition

Step 2: Relocation

  • Merge separate code and data sections into single sections
  • Convert relative offsets from .o files to absolute addresses in the executable
  • Update all symbol references to reflect their new positions

Why this order? You can't calculate final addresses (relocation) until you know which symbols exist and where they're defined (resolution).

Go deeper:

From Quiz: REVE1 / Program Execution | Updated: Jul 10, 2026