LOGBOOK

HELP

Quiz Entry - updated: 2026.07.14

What is the role of the dynamic linker (ld-linux.so) in program execution?

It loads the executable and its shared libraries into memory, then resolves every symbol and relocation before main runs.

Process address space: kernel space, user stack, memory-mapped shared libraries, heap, read/write .data/.bss segment, and read-only .text/.rodata segment

* What the dynamic linker builds: code and read-only data map low, writable data and heap above, shared libraries in the middle, and the stack at the top. *

The kernel actually launches the dynamic linker first (its path is recorded in the ELF header); the linker then maps in the program and its .so dependencies and patches everything up so the code can find the functions and data it calls.

The dynamic linker handles:

  1. Load the executable into memory
  2. Find required shared libraries (.so files)
  3. Load shared libraries into the process address space
  4. Resolve symbols - connect function calls to their implementations
  5. Perform relocations for position-independent code

Process memory layout after dynamic linking:

Region Contents
Kernel virtual memory OS kernel space
User stack Function call frames
Memory-mapped region Shared libraries (.so)
Run-time heap malloc allocations
Read/write segment .data, .bss
Read-only segment .init, .text, .rodata

Tip: The dynamic linker itself is specified in the ELF header and loaded by the kernel before the program starts.

Go deeper:

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