Master the fundamental concepts of linkers & loaders through this focused micro-challenge.
Each .o file exports defined symbols and imports undefined ones. The linker's job is to match undefined call foo relocations with global foo definitions. nm, objdump -t, and LLD's verbose mode show the same tables.
Name, value (address), size, type (FUNC, OBJECT), binding (LOCAL, GLOBAL, WEAK), and section index. Undefined symbols have section index 0 and value 0 until resolved.
cLoading…
T/t: text (code), defined/localU: undefined, needs linker resolutionProduction compilers embed this step inside a longer pipeline. GCC flows through cpp, cc1, assembly, and ld; Clang uses the driver, Sema, LLVM IR passes, and a target backend. LLVM bitcode, JVM bytecode, and WASM are other familiar IRs at the same layer. The exercise isolates one pass so you can test it alone before chaining it to the next stage.
You will parse and display symbol tables from object files. This exercise requires reading symbol entries and reporting name, address, type, and binding for each symbol.
Implement symbol table parser and display.
Requirements:
Three hints are available for this task, revealed one at a time inside the code workspace so you can struggle productively before seeing them.
All starter code and reference implementations are available for your local setup.
View on Github