Linking and Loading are the utility programs that play a important role in the execution of a program. Linking intakes the object codes generated by the assembler and combines them to generate the executable module. On the other hand, the loading loads this executable module to the main memory for execution.
Bringing the program from secondary memory to main memory is called Loading.
Establishing the linking between all the modules or all the functions of the program in order to continue the program execution is called linking.
Differences between Linking and Loading:
- The key difference between linking and loading is that the linking generates the executable file of a program whereas, the loading loads the executable file obtained from the linking into main memory for execution.
- The linking intakes the object module of a program generated by the assembler. However, the loading intakes the executable module generated by the linking.
- The linking 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. On the other hand, loading allocates space to an executable module in main memory.
Loading and Linking are further categorized into 2 types:
|Loading the entire program into the main memory before start of the program execution is called as static loading.||Loading the program into the main memory on demand is called as static loading.|
|Inefficent utilization of memory because whether it is required or not required entire program is brought into the main memory.||Efficent utilization of memory.|
|Program execution will be faster.||Program execution will be slower.|
|Statically linked program takes constant load time every time it is loaded into the memory for execution.||Dynamic linking is performed at run time by the operating system.|
|If the static loading is used then accordingly static linking is applied.||If the dynamic loading is used then accordingly dynamic linking is applied.|
|Static linking is performed by programs called linkers as the last step in compiling a program. Linkers are also called link editors.||In dynamic linking this is not the case and individual shared modules can be updated and recompiled.This is one of the greatest advantages dynamic linking offers.|
|In static linking if any of the external programs has changed then they have to be recompiled and re-linked again else the changes won’t reflect in existing executable file.||In dynamic linking load time might be reduced if the shared library code is already present in memory.|
- Static and Dynamic Linking in Operating Systems
- Difference between JSP and ASP
- Difference between C and C++
- Difference between RAM and ROM
- Difference between LED and LCD
- Difference between CD and DVD
- Difference between C and C#
- Difference between OOP and POP
- Difference between LAN, MAN and WAN
- Difference Between SEO and SEM
- Difference between 1G and 2G
- Difference between LAN and WAN
- Difference between H.323 and SIP
- Web 1.0, Web 2.0 and Web 3.0 with their difference
- Difference between CPU and GPU
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.