A system program that separately compiled modules of a program into a...
Linking loader combines the function of a relocating loader with the ability to combine a no. of program segments that have been independently compiled into an executable program.
View all questions of this test
A system program that separately compiled modules of a program into a...
Linking Loader
A linking loader is a system program that combines separately compiled modules of a program into a form suitable for execution. It takes the object code generated by the assembler for each module and resolves external references between them, producing a load module that can be directly executed by the computer.
Process of Linking Loader
The process of linking loader involves several steps, which are as follows:
1. Module Compilation: Each module of a program is separately compiled using a compiler or an assembler. This process generates corresponding object code files for each module.
2. Object Code Generation: The object code files contain the machine instructions and data for each module, as well as information about unresolved external references. These references are placeholders that need to be resolved during the linking process.
3. Linking: The linking loader takes the object code files and resolves the unresolved external references. It searches for the definitions of these references in other object code files or in libraries, and updates the references with the correct memory addresses.
4. Relocation: After resolving the external references, the linking loader performs relocation. This involves adjusting the memory addresses of the instructions and data in the object code to reflect the actual memory layout of the program when it is loaded into memory for execution.
5. Load Module Generation: Once the linking and relocation processes are complete, the linking loader generates a load module. This is a binary file that contains the fully linked and relocated object code of the program. It is ready for execution by the computer.
6. Loading and Execution: The load module is loaded into memory by the operating system and the program is executed. All the modules are now combined into a single executable unit, allowing the program to run as intended.
Advantages of Linking Loader
- Modularity: Linking loaders allow programs to be developed and maintained in modular form. Each module can be separately compiled and tested, making it easier to isolate and fix bugs.
- Code Reusability: Linking loaders also enable code reusability. Modules can be shared among multiple programs, reducing redundancy and promoting code efficiency.
- Efficient Memory Usage: By resolving external references and performing relocation, linking loaders optimize memory usage. They ensure that each instruction and data element is located at the correct memory address, minimizing wastage.
- Time-saving: Linking loaders automate the process of combining modules and resolving references, saving time and effort for programmers.
In conclusion, a linking loader is a system program that performs the crucial task of combining separately compiled modules into a form suitable for execution. It resolves external references, performs relocation, and generates a load module ready for execution. This process promotes modularity, code reusability, efficient memory usage, and time-saving.
To make sure you are not studying endlessly, EduRev has designed Railways study material, with Structured Courses, Videos, & Test Series. Plus get personalized analysis, doubt solving and improvement plans to achieve a great score in Railways.