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

Discussion

The loader is responsible for

  • A.placing the executable in memory and adjusting relocatable addresses
  • B.combining separately compiled object modules into one single executable
  • C.expanding the macros written in the original source program
  • D.checking the types of the expressions appearing in the program

Answer: A

Correct answer: placing the executable in memory and adjusting relocatable addresses

The loader operates at run time, not build time. It reads the executable, allocates memory, copies the image in and adjusts any addresses that depend on where it was placed.

Combining object modules is the linker's work, done earlier; macro expansion is the preprocessor's, done earlier still; and type checking belongs to the compiler's semantic analysis. The loader is the last stage of the chain and the only one that runs each time the program is started.

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

Post your comment

Please log in or register to post a comment.