Difference Between Linker and Loader

MemoryComputersHardware

In this post, we will understand the difference between a linker and a loader −

Linker

  • The main function of the linker is to generate executable files.

  • The linker takes the input as the object code which would be generated by a compiler/assembler.

  • The process of linking can be understood as a method to combine different snippets of code in order to obtain executable code.

  • There are two types of linkers available: Linkage Editor and Dynamic Linker.

  • Linker also helps combine all the object modules.

  • Linker is responsible to arrange the objects in the program’s address space.

Loader

  • The main function of a loader is to load executable files to the main memory.

  • It takes the executable files (generated by linker) as its input.

  • It can be understood as a process of loading the executable codes into main memory where it is execute further.

  • There are 3 types of loaders: Absolute loading, Relocatable loading and Dynamic run-time loading.

  • It helps allocate the addresses to executable codes or files.

  • It is also responsible to adjust the references that are used within the program.

raja
Published on 19-Apr-2021 06:06:49
Advertisements