Loaders and relocation: which statement correctly defines a non-relocatable program with respect to where it can execute in memory?
-
Acannot be made to execute in any area of storage other than the one designated for it at the time of its coding or translation
-
Bconsists of a program and relevant information for its relocation
-
Ccan itself perform the relocation of its address-sensitive portions
-
DAll Of the above
-
ENone of the above
Answer
Correct Answer: cannot be made to execute in any area of storage other than the one designated for it at the time of its coding or translation
Explanation
Introduction / Context:Executable images may be relocatable, position-independent, self-relocating, or non-relocatable. Understanding the differences is essential for linker/loader design and systems programming. This question asks you to identify the defining property of a non-relocatable program.
Given Data / Assumptions:
- The program contains absolute, address-sensitive references.
- No relocation information or runtime logic is available to adjust addresses.
- Execution must occur at the exact address range assumed during translation.
Concept / Approach:A non-relocatable program is bound to a fixed load address determined at coding/translation time. Any attempt to load it elsewhere will cause incorrect jumps or data accesses, because absolute addresses remain unadjusted. This contrasts with relocatable objects (loader adjusts addresses) and self-relocating code (program patches itself on startup).
Step-by-Step Solution:1) Identify absolute addressing in the image.2) Confirm lack of relocation info or position independence.3) Conclude the program must execute only at its designated memory location.
Verification / Alternative check:Historical fixed-address monitors and ROM-based firmware without relocation support exemplify non-relocatable code: moving them in memory breaks control flow and data references.
Why Other Options Are Wrong:
- Program plus relocation info: That defines a relocatable program.
- Self-relocation: Opposite of non-relocatable; implies runtime adjustment.
- All Of the above: Mutually inconsistent items cannot all be true.
Common Pitfalls:Confusing “relocatable” with “position-independent.” Relocatable needs a relocating loader; position-independent can run anywhere without relocation. Non-relocatable can run only at one specific address.
Final Answer:cannot be made to execute in any area of storage other than the one designated for it at the time of its coding or translation.