Master the fundamental concepts of linkers & loaders through this focused micro-challenge.
Dynamic linking loads .so / .dylib / .dll at runtime. PLT and GOT on x86-64 redirect external calls through stubs resolved on first call. ld.so maps libraries and performs relocations. Most Linux programs dynamically link libc.
First call printf jumps through PLT stub to GOT entry pointing at resolver. Resolver patches GOT with real printf address; later calls go direct.
cLoading…
-fPIC generates position-independent code-shared builds shared objectsdlopen loads libraries at runtime manuallyProduction 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 understand and implement dynamic linking concepts. This exercise asks you to model GOT/PLT indirection and runtime symbol resolution for external function calls.
Implement dynamic linking simulation.
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