0% found this document useful (0 votes)
17 views12 pages

Linker and Loader

Uploaded by

anubhabb7
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views12 pages

Linker and Loader

Uploaded by

anubhabb7
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 12

LINKER AND LOADER

Today's Agenda
OVERVIEW

• Introduction to Linker and Loader.

• Several tasks performed by the Linker.

• Several tasks performed by the Loader.

• Diagram of Linker and Loader process.

• 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

• The Loader performs several tasks :


1. Loading
2. Relocation
3. Symbol resolution
4. Dynamic linking
Compiler Design

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

You might also like