Object modules generated by an assembler that contain unresolved external…
2011
Object modules generated by an assembler that contain unresolved external references are resolved, for two or more object modules, by a/an ______
Answer: C. Linker — Concept: Translation of a program is done one translation unit at a time, so the object module an assembler or compiler emits is only partially complete:…
- A.
Operating system
- B.
Loader
- C.
Linker
- D.
Compiler
Attempted by 138 students.
Show answer & explanation
Correct answer: C
Concept: Translation of a program is done one translation unit at a time, so the object module an assembler or compiler emits is only partially complete: besides machine code it carries a symbol table listing external references — names it uses but does not itself define — and definitions it exports for others. Resolving an external reference means locating the module that defines that name, computing its address, and patching it into the referring code. In the language-processing chain the stage whose defined job is to take two or more object modules together and carry out this cross-module symbol resolution and relocation is linking; the program that performs it is the linker, and its output is one complete load module.
Application: Here the modules are produced by an assembler and still hold unresolved external references, and the resolution is required across two or more object modules. That is precisely cross-module symbol resolution: the external symbol table of every input module is read, each unresolved name is matched against the definition exported by some other module or library, the corresponding addresses are patched into the code, and a single load module is emitted. The linker performs this step, before the program is placed in memory or executed.
Cross-check — where each stage of the chain sits:
Compiler: analyses and translates one high-level translation unit into assembly or object code; it works within that unit, so cross-unit names remain unresolved in its output.
Loader: acts on a module that is already complete, bringing its image into main memory, binding addresses to the load-time origin and starting execution. A combined linking loader folds linking into this step, but among the components listed here the stage defined by resolving references across object modules is linking.
Operating system: manages processes, memory, files and devices while programs run; it invokes the loading machinery, and the symbol tables inside object modules are not its concern.
Hence the component that resolves the unresolved external references shared by two or more object modules is the linker.
Explore the full course: Mppsc Assistant Professor Computer Science Paper 2