0% found this document useful (0 votes)
43 views2 pages

Linker - Loader - PDF 8

Uploaded by

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

Linker - Loader - PDF 8

Uploaded by

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

Linker and Loader

In the execution of the program, major role is played by two utility programs known
as Linker and Loader.

1. Linker
 A linker is a special program that combines the object files, generated by the
compiler/assembler and other pieces of code to originate an executable file that
has a .exe extension.
 In the object file, the linker searches and append all libraries needed for the
execution of the file.
 It regulates the memory space that will hold the code from each module. It also
merges two or more separate object programs and establishes links among
them.
Generally, linkers are of two types:
1. Linkage Editor
2. Dynamic Linker

2. 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. Even it settles down symbolic
reference between objects.
 It is 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.

There are following various loading schemes:


1. Absolute Loaders
2. Relocating Loaders
3. Direct Linking Loaders
4. Bootstrap Loaders
Differences between Linker and Loader are as follows:
LINKER LOADER

Whereas main objective of Loader is


The main function of Linker is to generate
to load executable files to main
executable files.
memory.

The linker takes input of object code And the loader takes input of
generated by compiler/assembler. executable files generated by linker.

Linking can be defined as process of Loading can be defined as process of


combining various pieces of codes and source loading executable codes to main
code to obtain executable code. memory for further execution.

Loaders are of 4 types: Absolute,


Linkers are of 2 types: Linkage Editor and
Relocating, Direct Linking,
Dynamic Linker.
Bootstrap.

Another use of linker is to combine all object It helps in allocating the address to
modules. executable codes/files.

Loader is also responsible for


Linker is also responsible for arranging
adjusting references which are used
objects in program’s address space.
within the program.

You might also like