Assdcdd
Assdcdd
CH- 4
Loader and linker
Loader
Loader is the part of an operating system that is responsible for
loading programs and libraries. It is one of the essential stages in
the process of starting a program, as it places programs into
memory and prepares them for execution.
Functions of Loader
linking
Relocation
• Program relocation is the process of modifying the addresses
used in the address sensitive instruction of a program such
that the program can execute correctly from the designated
area of memory.
• Linker performs relocation if – Linked Origin ≠ Translated
Origin
• • Loader performs relocation if – Load Origin ≠ Linked Origin
• Type of Loader
1. Assemble and Go loader
2. General loading scheme
3. Absolute Loader
4. Direct linking Loader
Design of Absolute loader
TRANSFER Card
1 0
DLL : Direct Linking Loader
• It is Re-locatable type of loader.
• It has advantage of allowing programmer with multiple
procedure segments and giving them complete freedom of
referring data contained in some other segment.
• Input to the loader is set of object programs to be linked
together
• This provides flexible Intersegment Referencing, for doing
all this, DLL required following modules.
– ESD-External Symbol Directory
– TXT-Actual assembled program
– RLD-Relocation and Linkage directory module
– END-End module
• ESD-External Symbol Directory
• ESD card contains information about all symbols that are define in a
program that may be referred somewhere else and vice versa.
There are 3 types of symbols
• Segment Definition (SD):-It is name of the program which return prior to
start keyword.
• Local Definition (LD):-This are the symbols which are define in the
program.
• External Reference(ER):- This are symbols which are referred in the
program but are defining somewhere else.
• ID: – Giving unique no. to all segment definition and external reference.
Relative Address:- It is address at which those symbols are define.
Length: – Size of the symbol.
• TXT Card
Count Relative Add content