A system program that combines separately compiled modules of a progra...
In order execute two programs separately a linking loader is used. That is link loader creates a link between two programs.
View all questions of this test
A system program that combines separately compiled modules of a progra...
Linking Loader
A linking loader is a system program that combines separately compiled modules of a program into a form suitable for execution. It performs the critical task of resolving external references and generating an executable program. Let's understand the process and role of a linking loader in detail:
1. Module Compilation:
- When a program is written, it is divided into multiple modules or source files.
- Each module is compiled separately by the compiler, resulting in object code files (e.g., .obj or .o files).
- These object code files contain machine instructions and data specific to each module.
2. Object Code and External References:
- Object code files may contain references to symbols or functions defined in other modules.
- Such references are called external references or unresolved symbols.
- External references cannot be directly resolved as the required code or data may be present in other modules.
3. Linking Loader Process:
- The linking loader takes the object code files generated by the compiler and combines them into a single executable program.
- It resolves the external references by searching for the required symbols in other object code files or libraries.
- The linking loader performs the following tasks:
- Symbol Resolution: It resolves the external references by matching them with the symbol definitions present in other modules.
- Relocation: It adjusts the memory addresses of instructions and data in the object code files to reflect the final memory layout of the executable program.
- Memory Allocation: It assigns memory addresses to different sections of the program, such as code, data, and stack.
- Optional Tasks: It may also perform additional tasks like loading libraries, handling dynamic linking, and generating debug information.
4. Executable Program:
- Once all the external references are resolved and necessary adjustments are made, the linking loader generates an executable program file.
- This file contains the complete program code and data in a format suitable for direct execution by the operating system.
In conclusion, a linking loader is a crucial system program that combines separately compiled modules, resolves external references, and generates an executable program. It plays a vital role in the overall process of compiling and executing programs.
To make sure you are not studying endlessly, EduRev has designed Computer Science Engineering (CSE) study material, with Structured Courses, Videos, & Test Series. Plus get personalized analysis, doubt solving and improvement plans to achieve a great score in Computer Science Engineering (CSE).