Linker and Loader
Linker and Loader
Today's Agenda
OVERVIEW
• Conclusion.
Compiler Design
PCC-CSD504
INTRODUCTION
• Linker
A linker is an important utility program that takes the object files, produced by the
assembler and compiler, and other code to join them into a single executable file.
• Loader
It is special program that takes input of executable files from linker, loads it to main
memory, and prepares this code for execution by computer. Loader allocates memory
space to program.
Compiler Design
PCC-CSD504
• The Linker performs several tasks :
1. Symbol resolution
2. Code optimization
3. Memory management
4. Library management
PCC-CSD504
Source code to Assembly Code
Actual
C code
Source Code Compiler Assembly Code
Pure
C code
Preprocessor
Compiler Design
PCC-CSD504
Object Code
Assembly Code
Assembler
Compiler Design
PCC-CSD504
Assembly Code to Object Code
Target
Actual assembly
C code code
Source Code Compiler Assembler Object Code
Pure
C code
Preprocessor
Compiler Design
PCC-CSD504
LINKER
Target
Actual assembly Object
C code code Code
Source Code Compiler Assembler Linker .exe file
Pure
C code
Preprocessor
Compiler Design
PCC-CSD504
.exe file
Compiler Design
PCC-CSD504
LOADER
Target Loader
Actual assembly Object
C code code Code
Linker .exe file
Source Code Compiler Assembler
Pure
C code
Memory
Preprocessor
Compiler Design
PCC-CSD504
CONCLUSION
Linker and Loader are both important components in the software development process.
The Linker is used during the compilation process to link object files into a single
executable file. The Loader is used at runtime to load the executable file into memory
and prepare it for execution.
Compiler Design
PCC-CSD504
T h a n k
y o u !
Sources : Class Notes , YouTube , Google