A linker reads four modules whose lengths are and words, respectively. If they are loaded in that order, what are the relocation constants?
View worked solution
Answer: B
The relocation constant of a module is the starting (base) address assigned to it when loaded into memory relative to the start of the memory space (typically assumed to begin at address ).
Given the four modules with lengths , , , and words, loaded sequentially in that order:
- Module 1: Starts at address .
- Module 2: Starts immediately after Module 1.
- Module 3: Starts immediately after Module 2.
- Module 4: Starts immediately after Module 3.
Thus, the relocation constants are .
Free practice · Your answers on this page are not saved.
