Introduction To Linker and Loaders

LINKERS AND LOADERS

 Linker is a system program that performs loading operation and linker is a system program that performs linking operation.

Translator

Translates source program and outputs that program to object modules.

Linker

 Links object modules to a ready-to-execute program called binary program.

Loader

 Loads the program into memory for the purpose of execution.

FOUR FUNCTIONS OF A LOADER

• Allocation
• Linking
• Relocation
• Loading

LOADER DESIGN OPTIONS

 It deals with the organization of loading functions, relocation and linking.  Different options are :

 Linker Loader
 Linkage Editor
 Dynamic Linking
 Absolute Loader
 Bootstrap Loader

LINKING LOADER

 Source program is first translated producing object program. A Linking Loader performs linking and relocation operations at load time, Automatic Library Search (if any) and loads the linked program directly into memory for execution.

Advantages:

a) When program is infrequently used no need to store assembled version in the library.

Disadvantages:

a) Searches libraries and resolves External Reference every time program is executed.

LINKAGE EDITOR

 Produces a linked version of the program and is written to a file or library for later execution. When user is ready to run the linked program, a simple relocating loader loads the program into memory. Only object code is to be modified. ie: adding actual load address to relative values within program. This performs relocation.

Advantages:

a) If program is to be executed many times without being reassembled, use of 
Linkage editor reduces overhead requirements.
b) Resolution of external references and library searching is performed only once.

Disadvantages:

a) When program is used infrequently steps of writing and reading linked program increases.
 

DYNAMIC LINKING

 It is also known as Dynamic loading or load on call. It is the process of loading and linking a particular module at execution time. ie: postpones linking function until execution. E.g.: A subroutine is loaded and linked to a program when it is first called. It is used to allow several executing programs to share one copy of a subroutine or library.

E.g.: Run time support routines for a High Level Language like C could be stored in Dynamic Link Library (DLL).
One copy of routine could be loaded into memory. All programs currently executing can be linked to this copy, instead of linking a separate copy into each object.

Advantages:

a) If the program were completely linked before execution, these subroutines need to be loaded and linked every time program is run. It Provides loading of routines only when they are needed.

ABSOLUTE LOADERS

In this scheme translator outputs machine language translation file of source program and places the object file in secondary storage. Loader accepts this machine language file and places into memory location specified by assembler. Loader has to perform only loading. So it is simple to implement. Allocation and Linking is performed by programmer. Relocation is performed by Assembler.

Disadvantages:

a) Programmer must specify starting address in memory where program is to be loaded to the Assembler.
b) If multiple subroutines are used programmer has to remember all address of subroutine in order to link subroutines and use that address in subroutine.
c) Programmer must be careful not to assign same locations for subroutines. If it occurs, then it has to relocate the overlap subroutine to new location and reassemble them.

BOOTSTRAP LOADERS

 It is a special type of Absolute Loader. When computer is first turned ON or restarted this loader is executed. Usually OS. This loads the first program run by computer. They appear in 3 forms.

1. In some computers Absolute Loader program is permanently resident in ROM. While some Hardware signal occurs this program is executed.
2. In some other computers ROM program is copied from ROM to memory and executed there.
3. In some others a built-in hardware function is used. This function reads a fixed length record from some device into a memory at a fixed location. The control automatically transferred to the stored location. The fixed length record is selected by control switches. This contains machine instructions that load Absolute program. If loading process requires more instructions, first record cause reading of others. These in turn cause reading of others and so on. Thus the term BOOTSTRAP. First record is referred to as a BOOTSTRAP LOADER. This is added to the beginning of all object programs that are loaded to and empty or idle syst

An article send by a lecturer in computer science department .he is not intersted to publish his photo or any other identity proof.


AttachmentSize
loaders linkers architecture.JPG16.22 KB

Bookmark / Share


Most Visited Contents

Jobs for BE, Btech, Mtech, Msc, MCA, Bca, Bsc , Bcom & Other Professionals  .Jobs in Kerala - Job Vacancies in Techno Park -Trivandrum Jobs  Job Vacancies in Info Park - Jobs in Cochin - Kerala IT JobsJobs in Koratty Info park - Jobs in Thrissur - Koratty Info Park Job Vacancies

Syndicate content