Loaders and relocation — self-relocating program: Which option best describes a self-relocating program during program loading and execution?

Difficulty: Easy

Correct Answer: can itself performs the relocation of its address-sensitive portions.

Explanation:


Introduction / Context:
Relocation is the process of adjusting address dependent code and data so a program can execute correctly at a memory location different from where it was originally assembled or compiled. Some programs include logic to relocate themselves during load time.



Given Data / Assumptions:

  • Address-sensitive portions (such as absolute references) must be corrected if the load base changes.
  • Self-relocation implies code inside the program performs adjustments.
  • Relocation information may be provided by the compiler or assembler.


Concept / Approach:

A self-relocating program contains relocation routines and tables it uses to adjust its own addresses when loaded. This enables the loader to place the program at varying memory locations. By contrast, absolute programs (option a) cannot relocate. Option b describes a relocatable program generally, not necessarily self-relocating (the loader could do it).



Step-by-Step Solution:

Identify the property “self” — the program performs relocation itself.Match to the description where the program adjusts its address-sensitive sections.Exclude absolute-only execution and generic relocatable descriptions.Select the option stating the program itself performs relocation.


Verification / Alternative check:

Classic loaders and OS texts distinguish absolute, relocatable, and self-relocating programs; the latter includes code to walk relocation entries and patch addresses post-load.



Why Other Options Are Wrong:

  • (a) Describes an absolute program — the opposite of relocatable.
  • (b) Could describe a relocatable module handled by an external loader, not necessarily self-relocating.
  • (d) Cannot be true because (a) contradicts the definition.
  • (e) Not applicable because (c) is correct.


Common Pitfalls:

Confusing “relocatable” with “self-relocating.” Many relocations are performed by linkers/loaders; “self” indicates in-program logic.


Final Answer:

can itself performs the relocation of its address-sensitive portions.

More Questions from Operating Systems Concepts

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion