100% found this document useful (1 vote)
728 views6 pages

What Is Linking Loader

The document discusses linking loaders and linkage editors. A linking loader performs linking and relocation operations when loading a program into memory for execution. This is suitable when a program is frequently reassembled. A linkage editor produces a linked version of a program before execution, which is more efficient when a program will be executed many times without reassembly. It performs linking only once, while a linking loader performs linking at each load.

Uploaded by

Waleed Zebary
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
100% found this document useful (1 vote)
728 views6 pages

What Is Linking Loader

The document discusses linking loaders and linkage editors. A linking loader performs linking and relocation operations when loading a program into memory for execution. This is suitable when a program is frequently reassembled. A linkage editor produces a linked version of a program before execution, which is more efficient when a program will be executed many times without reassembly. It performs linking only once, while a linking loader performs linking at each load.

Uploaded by

Waleed Zebary
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

Software system report

[Linking Loader VS Linkage Editor]

MAHMOUD BASHAR
WALEED ALL
Supervision of Dr. Azzam
What is linking loader:
is a system program, which takes the object code of a program as input and prepares it for
execution.
• Programmers usually define the Program to be loaded at some predefined location in the
memory.
• But this loading address given by the programmer is not be coordinated with the OS.
• The loader does the job of coordinating with the OS to get initial loading address for the .EXE
file and load it into the memory.
Diagram

How does a loader work?


Loader is the program of the operating system which loads the executable from the disk into
the primary memory (RAM) for execution. It allocates the memory space to the executable
module in main memory and then transfers control to the beginning instruction of the
program

What is loader in application?


An application that uses loaders typically includes the following: An Fragment Activity or
Fragment. An instance of the Loader Manager. A Cursor Loader to load data backed by a
Content Provider. Alternatively, you can implement your own subclass of Loader to load data
from some other source.

Function of Loader:
1) Allocation
2) Linking

1
3) Relocation
4) Loading
Allocation:
• Allocates the space in the memory where the object program would be loaded for Execution.
• It allocates the space for program in the memory, by calculating the size of the program.
This activity is called allocation.
• In absolute loader allocation is done by the programmer and hence it is the duty of the
programmer to ensure that the programs do not get overlap.
• In reloadable loader allocation is done by the loader hence the assembler must supply the
loader the size of the program.
Linking:
• It links two or more object codes and provides the information needed to allow references
between them.
• It resolves the symbolic references (code/data) between the object modules by assigning all
the user subroutine and library subroutine addresses. This activity is called linking.
• In absolute loader linking is done by the programmer as the programmer is aware about the
runtime address of the symbols.
• In relocatable loader, linking is done by the loader and hence the assembler must supply to
the loader, the locations at which the loading is to be done.
Relocation:
• It modifies the object program by changing the certain instructions so that it can be loaded
at different address from location originally specified.
• There are some address dependent locations in the program, such address constants must
be adjusted according to allocated space, such activity done by loader is called relocation.
• In absolute Loader relocation is done by the assembler as the assembler is aware of the
starting address of the program.
• In relocatable loader, relocation is done by the loader and hence assembler must supply to
the loader the location at which relocation is to be done.
Loading:
• It brings the object program into the memory for execution.

2
• Finally it places all the machine instructions and data of corresponding programs and
subroutines into the memory.

The Linkage Editor:


The linkage editor performs relocation of all control sections relative to the start
of the linked program. Thus, all items that need to be modified at load time have
values that are relative to the start of the linked program. This means that the
loading can be accomplished in one pass with no external symbol table
required.

If a program is to be executed many times without being reassembled, the use


of a linkage editor substantially reduces the overhead required. Linkage editors
can perform many useful functions besides simply preparing an object program
for execution.

Functions of the linkage editor:


The process during which these external references are resolved (i.e. the additionally required
modules are linked with the generated module into an executable unit) is called linking; the utility
routine which performs this task is called a linkage editor.

Procedure linkage editor:


performs relocation of all control sections relative to the start of the linked program,
resolves all external reference, and output a relocatable module for later execution A
simple relocating loader can be used to load the program into memory

3
Dynamic Linking:
Comparison Linkage editors perform linking operations before the program is loaded
for execution Linking loaders perform linking operations at load time Dynamic linking
(dynamic loading, load on call) perform linking at execution time Delayed Binding Avoid
the necessity of loading the entire library for each execution, load the routines only
when they are needed Allow several executing programs to share one copy of a
subroutine or library

4
Difference Between Table for Linking loader and
Linkage Editor

Linking loader Linkage Editor


Performs all linking and relocation Produces a Linked version of the program,
operations, including automatic library which is normally written to a file or library
search, and loads the linked program into for later execution.
memory for execution.
Suitable when a program is reassembled Suitable when a program is executed
for nearly every execution. many times without being reassembled.
Resolution of external reference and library Resolution of external reference and library
searching is performed more than once. searching is performed only once.

Linking loaders perform linking operations Linkage editors perform linking operations
at load time. before the program is loaded for execution
There is no need of relocating loader. The relocating loader loads the load
module into the memory
The Loading may requires two passes. The Loading can be accomplished in one
pass.
When program is in development stage When the program development is
then at that time the linking loader can be finished or when the library is built then
used. linkage editor can be used.

You might also like