03-10-2012, 11:39 AM
Linker & Loader
Loader_1.pptx (Size: 118.09 KB / Downloads: 24)
Loader:
System program that prepares Object Program for Execution by loading them into Main Memory
Functions:
Linking:
Single Program may include references between different segments
May refer to external program data and Functions as well
Important job of Loader is to Resolve these inter segment/program references(link them)
Then generate single continuous piece of Code that can be directly Executed
Relocation:
As per need OS may move(i.e. Relocate) one or more segments of program from one area of memory to another
When program get relocated Instructions referring to code or data in the relocated segments must also be changed (Address Sensitive Instructions)
Loader has to adjust addresses of all such address sensitive Instructions when OS relocates one or more program segments
Linker:
System program that resolves all address references within each object module (several object module) and combines them to produce Executable(.exe) file
Linker performs linking and relocation function for Loader
Functions:
Linking Object Files:
Links multiple relocatable object files used by program and generates single .exe file which can be loaded and executed by Loader
Resolving External References:
While linking those object files Linker resolves inter segment/program references to generate single continuous executable Files
Relocate Symbol:
Linker relocates symbols from their relative locations in object files to new absolute positions in the executable file
Dynamic Linking Loader:
In this Loading and Linking are postponed until Execution time if external references found
Assembler produces Text, binding/relocation info From Source File
Loader loads only in main program
When main program should execute transfer Instruction to external address or reference external variable Loader is called
Only then segment containing external reference is loaded
Loader_1.pptx (Size: 118.09 KB / Downloads: 24)
Loader:
System program that prepares Object Program for Execution by loading them into Main Memory
Functions:
Linking:
Single Program may include references between different segments
May refer to external program data and Functions as well
Important job of Loader is to Resolve these inter segment/program references(link them)
Then generate single continuous piece of Code that can be directly Executed
Relocation:
As per need OS may move(i.e. Relocate) one or more segments of program from one area of memory to another
When program get relocated Instructions referring to code or data in the relocated segments must also be changed (Address Sensitive Instructions)
Loader has to adjust addresses of all such address sensitive Instructions when OS relocates one or more program segments
Linker:
System program that resolves all address references within each object module (several object module) and combines them to produce Executable(.exe) file
Linker performs linking and relocation function for Loader
Functions:
Linking Object Files:
Links multiple relocatable object files used by program and generates single .exe file which can be loaded and executed by Loader
Resolving External References:
While linking those object files Linker resolves inter segment/program references to generate single continuous executable Files
Relocate Symbol:
Linker relocates symbols from their relative locations in object files to new absolute positions in the executable file
Dynamic Linking Loader:
In this Loading and Linking are postponed until Execution time if external references found
Assembler produces Text, binding/relocation info From Source File
Loader loads only in main program
When main program should execute transfer Instruction to external address or reference external variable Loader is called
Only then segment containing external reference is loaded