/    /  OS – Dynamic Linking vs Dynamic Loading

Dynamic Linking vs Dynamic Loading

 

What is Linking?

Linking implies the process of connecting all the modules or the function of a program for program execution. The linker or the link editor takes object modules from the assembler and forms an executable file for the loader.

It can be done at both compile-time and load time.

The compile-time linking is done when the source code is translated to the machine code, and load-time linking is done when the program is loaded into the memory. 

 

Static Linking:

It is done at the time of the compilation of the program.

 

Dynamic Linking:

It is used to resolve the shortcomings of static linking. 

When the program executes, the linker binds the function calls to the shared library in the disk.

 

What is Loading?

Loading is defined as the process to load a program from the secondary memory to the primary memory so that it can be executed.

It is mostly used to implement software plugins.

 

Loading vs Linking

 

Loading

Linking

 

Loading loads the executable file from the linking to the main memory.

Linking generates an executable file of a program.

 

It allocates space to an executable module in the main memory.

It combines all object modules of a program to generate executable modules. It also links the library function in the object module to built-in libraries of the high-level programming language. 

 

It intakes the executable module generated by the linking.

It intakes the object module of a program generated by the assembler.

Reference

Dynamic Linking vs Dynamic Loading