Difference between Linker and Loader

 

Back - C Language Notes By Vivek Sir email: vivekdubey22@gmail.com (w) 9826424484

·      The utility programmes Linker and Loader are essential to a program's execution.

·      A program's source code goes through the compiler, assembler, linker, and loader in that order before being executed.

·      On the one hand, the linker is responsible for combining the object codes produced by the assembler to create the executable module.

·      However, the loader instals this executable module into the system's main memory for use.

LINKER

LOADER

Basic:

It creates a source program's executable module.

Basic:

The executable module is loaded into the system's main memory.

Input:

It accepts the object code produced by an assembler as input.

Input:

It uses a linker-generated executable module.

Function:

To create an executable module, it integrates all of a source code's object modules.

Function:

It assigns the addresses to a main memory executable module so that it can run.

Type/Approach:

dynamic linker, linkage editor

Type/Approach:

three types of loading: absolute, relocatable, and dynamic run-time.

 

 

Definition of Linker

The linker receives the object code of a source programme from the assembler. The executable code for the programme is created using this object code by the linker, which then gives it to the loader.

Programs written in high-level languages often include header files and libraries. Some library functions whose definitions are kept in the built-in libraries may be found in the source code of the programme. These functions are linked to the built-in libraries by the linker. It notifies the compiler if the built-in libraries cannot be found, and the compiler then generates the error.

Linkers come in two varieties.

• Linkage Editor: This linker creates the executable module that can be relocated.

• The dynamic linker postpones or delays linking some external modules until the load module or executable module is produced. Linking takes place at this point during runtime or load time.

The meaning of loader

Since the programme that has to be run right now must be stored in the computer's main memory. The executable file or module of a programme, created by the linker, must be loaded to the main memory for execution by the loader, a programme in an operating system. It allots RAM in main memory for the executable module.

Different loading strategies:

Absolute and repositionable loading

Run-time dynamic loading

Back - C Language Notes By Vivek Sir email: vivekdubey22@gmail.com (w) 9826424484