What are linkers and loaders?

A loader is a program that places programs into main memory for execution. The assembler or compiler outputs the machine language translation of a program on a secondary storage device. The loader places this machine language into memory. Loader program is much smaller than assembler or compiler. Thus more memory space will be available for user programs because at the time of executing user programs assembler or compiler need not be in memory.

Typical user program consists of a number of modules. A function may be called from another function. Until the modules are the loaded into main memory, the address of various functions cannot be determined. The purpose of linker is to link various modules by placing proper address of functions at their calling point in other functions. After the linker links the modules, they are now ready to execute them.

Post a Comment