Skip to main content

Checkpoint: Reading the Linker's Mind

Challenge on lesson: Checkpoint: Reading the Linker's Mind

CHALLENGE
Difficulty: advanced+25 XP

Module integration: symbol-table forensics plus the link order rule, in one file. 1. char sym_class(const char *nm_line) โ€” classify one nm output line like "0000000000401100 T bump" or " U printf": return the type letter. (A single-letter first field means undefined โ€” no address column.) 2. int linker_resolves(const char *order) โ€” order is a string of "A" and "P" (Archive, Plain object) read left to right. Archives only satisfy symbols still pending when the scan reaches them. Given the archive defines what pending needs and plain objects only *demand*, return 1 iff at least one archive appears after the first P (the classic ordering pitfall), else 0.

Back to lesson: Checkpoint: Reading the Linker's Mind