In execution of the program, major role is played by two utility programs known as Linker and Loader.
1. Linker :
A linker is special program that combines the object files, generated by compiler/assembler, and other pieces of codes to originate an executable file have. exe extension. In the object file, linker searches and append all libraries needed for execution of file. It regulates memory space that code from each module will hold. It also merges two or more separate object programs and establishes link among them. Generally, linkers are of two types :
1. Linkage Editor 2. Dynamic Linker
2. Loader :
The loader is special program that takes input of object code from linker, loads it to main memory, and prepares this code for execution by computer. Loader allocates memory space to program. Even it settles down symbolic reference between objects. It in charge of loading programs and libraries in operating system. The embedded computer systems don’t have loaders. In them, code is executed through ROM. Generally, loader has three types of approach :
1. Absolute loading 2. Relocatable loading 3. Dynamic run-time loading
Difference Between Linker and Loader :
|1||The main function of Linker is to generate executable files.||Whereas main objective of Loader is to executable files to main memory.|
|2||The linker takes input of object code generated by compiler/assembler.||And the loader takes input of executable files generated by linker.|
|3||Linking can be defined as process of combining various pieces of codes and source code to obtain executable code.||Loading can be defined as process of loading executable codes to main memory for further execution.|
|4||Linker is of 2 types: Linkage Editor and Dynamic Linker.||Loader is of 3 types: Absolute loading, Relocatable loading and Dynamic run-time loading.|
|5||Another use of linker is to combine all object modules.||It helps in allocating the address to executable codes/files.|
|6||Linker is also responsible for arranging objects in program’s address space.||Loader is also responsible for adjusting references which are used within the program.|
Attention reader! Don’t stop learning now. Get hold of all the important CS Theory concepts for SDE interviews with the CS Theory Course at a student-friendly price and become industry ready.
- Loader in C/C++
- Difference and Similarities between PHP and C
- Difference between node.js require and ES6 import and export
- Difference between Stop and Wait protocol and Sliding Window protocol
- Similarities and Difference between Java and C++
- Difference between Yaacomo and and XAP
- Difference between VoIP and and POTS
- Difference between ++*p, *p++ and *++p
- Difference Between DOS and Windows
- Difference between User Level thread and Kernel Level thread
- What’s difference between The Internet and The Web ?
- Difference between Priority Inversion and Priority Inheritance
- What’s difference between Linux and Android ?
- What’s difference between header files "stdio.h" and "stdlib.h" ?
- Difference between HTML and HTTP
- Difference between http:// and https://
- What's difference between MMU and MPU?
- What's difference between Microcontroller (µC) and Microprocessor (µP)?
- What's the difference between Scripting and Programming Languages?
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.