Which of the following are the principles tasks of the linker ? I. Resolve…
2016
Which of the following are the principles tasks of the linker ?
I. Resolve external references among separately compiled program units.
II. Translate assembly language to machine code.
III. Relocate code and data relative to the beginning of the program.
IV. Enforce access-control restrictions on system libraries.
- A.
I and II
- B.
I and III
- C.
II and III
- D.
I and IV
Attempted by 338 students.
Show answer & explanation
Correct answer: B
Answer: The linker's principal tasks are to resolve external references among separately compiled program units and to relocate code and data relative to the program's load address.
Resolve external references (symbol resolution): combine object files and match undefined symbols to their definitions so all references are satisfied.
Relocate code and data: adjust addresses in the code and data sections so they refer to the correct locations when the program is placed at its final address.
What the linker does not do (brief):
Translate assembly language to machine code: this is the assembler's job; the linker works on object files produced by the assembler/compiler.
Enforce access-control restrictions on system libraries: security and access control are typically handled by the operating system, loader, or runtime environment, not by the linker itself.
Concise process summary: collect object files, perform symbol resolution, apply relocations, combine sections, and produce the final executable or library.