Master the fundamental concepts of linkers & loaders through this focused micro-challenge.
A Linux process sees text, data, heap, mmap regions, stack, and kernel space in virtual memory. pmap, /proc/self/maps, and lldb's memory view show the same layout compilers and exploit mitigations depend on.
Low addresses: executable text, read-only rodata, writable data and BSS. Heap grows up via brk/mmap. Stack grows down from a high address. Libraries mmap between heap and stack.
cLoading…
mmap places shared libs and anonymous mappingsProduction 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 visualize process memory layout. This exercise asks you to model segment addresses, heap/stack growth, and how the loader places ELF sections in virtual memory.
Implement memory layout visualizer.
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