Difficulty: Easy
Correct Answer: Loader
Explanation:
Introduction / Context:
After code is compiled and linked, the resulting executable must be mapped into memory so the CPU can run it. This final step assigns memory, fixes addresses if needed, and transfers control to the program's entry point. The component that performs these tasks is the loader.
Given Data / Assumptions:
Concept / Approach:
The loader reads the program image, allocates memory, resolves relocations (if not already fixed), links with shared libraries at load time as necessary, sets up the stack and environment, and jumps to the entry point. Linkers combine modules; assemblers and compilers translate source code but do not run the program.
Step-by-Step Solution:
Verification / Alternative check:
Tracing a program start shows the OS loader reading the binary, mapping sections, and invoking the program's main entry after runtime initialization.
Why Other Options Are Wrong:
Common Pitfalls:
Confusing static linking with loading; even statically linked programs require a loader to map and start execution.
Final Answer:
Loader
Discussion & Comments