Difficulty: Easy
Correct Answer: consists of a program plus relocation information so it can be placed at various addresses
Explanation:
Introduction / Context:
Object modules frequently need to be placed at different memory addresses at load time. To support this flexibility, a relocatable program includes metadata that enables a loader to adjust address-sensitive fields appropriately.
Given Data / Assumptions:
Concept / Approach:
A relocatable program has symbolic references and marked address fields. The loader, when choosing a load address, applies relocation by adding the chosen base to address-sensitive locations. This differs from absolute programs (fixed addresses) and self-relocating programs (which contain code to relocate themselves at runtime).
Step-by-Step Solution:
Verification / Alternative check:
Relocation maps demonstrate consistent adjustment of code and data references by an offset equal to the load base, confirming relocatability.
Why Other Options Are Wrong:
Common Pitfalls:
Assuming “relocatable” means the program moves itself; typically, the loader performs relocation using supplied metadata.
Final Answer:
consists of a program plus relocation information so it can be placed at various addresses.
Discussion & Comments