Difficulty: Medium
Correct Answer: can itself perform the relocation of its address-sensitive portions
Explanation:
Introduction / Context:
Relocation is the process of adjusting address-sensitive code and data so that a program can execute correctly no matter where it is loaded in memory. Loaders, linkers, and sometimes programs themselves participate in relocation. This question distinguishes a self-relocating program from other relocation scenarios.
Given Data / Assumptions:
Concept / Approach:
A self-relocating program contains logic to adjust its own address-sensitive references when it starts (or as it loads). It computes the load-time delta and patches internal tables or code/data locations accordingly. This contrasts with non-relocatable programs (must reside at a fixed address) and relocatable programs that rely on an external relocating loader with relocation information.
Step-by-Step Solution:
1) Identify the essence of “self-relocating”: relocation performed by the program itself.2) Exclude fixed-location programs, which cannot relocate at all.3) Exclude programs that merely carry relocation info but depend on an external loader.4) Conclude: the correct description is that the program can itself relocate its address-sensitive parts.
Verification / Alternative check:
Bootstrapping code (e.g., certain loaders or resident monitors) historically demonstrated self-relocation: upon start, they compute the current load base, add offsets to pointers, and continue execution correctly regardless of placement.
Why Other Options Are Wrong:
Common Pitfalls:
Confusing “relocatable” (has info for an external loader) with “self-relocating” (performs its own relocation). The presence of relocation entries does not imply the program will patch itself at runtime.
Final Answer:
can itself perform the relocation of its address-sensitive portions.
Discussion & Comments