Skip to content
Official PYQ · 1998

GATE CS 1998 Q1.28 — Runtime Environments

Explain with AI

A linker reads four modules whose lengths are 200,800,600200, 800, 600 and 500500 words, respectively. If they are loaded in that order, what are the relocation constants?

Choose one option
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 00).

Given the four modules with lengths L1=200L_1 = 200, L2=800L_2 = 800, L3=600L_3 = 600, and L4=500L_4 = 500 words, loaded sequentially in that order:

  • Module 1: Starts at address 00.
    Relocation Constant1=0\text{Relocation Constant}_1 = 0
  • Module 2: Starts immediately after Module 1.
    Relocation Constant2=0+L1=0+200=200\text{Relocation Constant}_2 = 0 + L_1 = 0 + 200 = 200
  • Module 3: Starts immediately after Module 2.
    Relocation Constant3=200+L2=200+800=1000\text{Relocation Constant}_3 = 200 + L_2 = 200 + 800 = 1000
  • Module 4: Starts immediately after Module 3.
    Relocation Constant4=1000+L3=1000+600=1600\text{Relocation Constant}_4 = 1000 + L_3 = 1000 + 600 = 1600

Thus, the relocation constants are 0,200,1000,16000, 200, 1000, 1600.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Runtime Environments questions