Difficulty: Easy
Correct Answer: Assembler or translator
Explanation:
Introduction / Context:During program preparation, tools produce metadata that enables code to be placed at varying memory locations. Relocation information (often called relocation bits/records) identifies addresses that must be adjusted when the program is loaded at a different base address.
Given Data / Assumptions:
Concept / Approach:Separate producers of relocation info from consumers. Assemblers/translators know which references are relocatable and mark them. Linkers/loaders read these marks to fix up addresses at link or load time.
Step-by-Step Solution:Source → assemble/compile → object file with relocation entries.Linker optionally resolves external symbols and performs partial relocation.Loader applies remaining relocation at load address.
Verification / Alternative check:Inspect an object file (e.g., with objdump) to view relocation sections created at assembly/compile time; observe how the loader/linker uses them later.
Why Other Options Are Wrong:Relocating loader (Option A) consumes relocation bits; it does not generate them.Linker (Option B) may create new relocation records when combining modules, but the original markings originate in the assembler/translator.Macro processor (Option D) simply expands macros before translation; it does not create relocation info.
Common Pitfalls:
Final Answer:Assembler or translator.
Discussion & Comments