Difficulty: Easy
Correct Answer: All of the above
Explanation:
Introduction / Context:The loader bridges the gap between compiled/assembled object code and execution. It sets up memory, resolves addresses, and relocates code/data as needed. This question checks awareness of the loader’s concrete responsibilities.
Given Data / Assumptions:
Concept / Approach:
Step-by-Step Solution:
Allocate memory regions for code, data, stack/heap.Resolve external symbols among modules/libraries.Relocate address-dependent instructions/data to actual memory locations.Transfer control to program entry point.Verification / Alternative check:
Modern OS loaders (e.g., ELF/PE loaders) perform these steps routinely; dynamic linkers additionally bind shared libraries at load/run time.Why Other Options Are Wrong:
Common Pitfalls:
Final Answer:
All of the above
Discussion & Comments