Machine-translated by Google. Questions are authored in English.
Top

Discussion

The linker is required because

  • A.the assembler cannot produce machine code without assistance
  • B.the operating system refuses to load any single object file
  • C.optimisation can only be performed once every module is present at last
  • D.a program is usually built from several separately compiled modules

Answer: D

Correct answer: a program is usually built from several separately compiled modules

Separate compilation is what makes the linker necessary. A module referring to a routine defined elsewhere cannot have that address filled in when it is compiled, since the other module may not yet exist.

The linker combines the object files, resolves those external references, and produces a single executable. Libraries are brought in the same way. The assembler produces perfectly good relocatable code on its own, and the operating system loads what the linker has produced.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.