Tuesday 12 February 2013

Differentiate linkers and loaders.


Linker: Linker is a program that takes one or more objects generated by a compiler and combines them into a single executable program. 
Linker is a program that takes one or more objects generated by a compiler and combines them into a single executable program.
Once a linker has scanned all of the input files to determine segment sizes, symbol definitions and symbol references, figured out which library modules to include, and decided where in the output address space all of the segments will go, the next stage the heart of the linking process, relocation is. We use relocation to refer both to the process of adjusting program addresses to account for non-zero segment origins, and the process of resolving references to external symbols, since the two are frequently handled together. The linker's first pass lays out the positions of the various segments and collects the segment-relative values of all global symbols in the program. Once the linker determines the position of each segment, it potentially needs to fix up all storage addresses to reflect the new locations of the segments. On most architecture, addresses in data are absolute, while those embedded in instructions may be absolute or relative. The linker needs to fix up accordingly, as we'll discuss later
Loaders: Loader is the part of an operating system that is responsible for loading programs from executable (i.e., executable files) into memory, preparing them for execution and then executing them.
Loader is the part of an operating system that is responsible for loading programs from executable (i.e., executable files) into memory, preparing them for execution and then executing them. In computing, a loader is the part of an operating system that is responsible for loading programs. It is one of the essential stages in the process of starting a program, as it places programs into memory and prepares them for execution. Loading a program involves reading the contents of executable file, the file containing the program text, into memory, and then carrying out other required preparatory tasks to prepare the executable for running. Once loading is complete, the operating system starts the program by passing control to the loaded program code.

No comments:

Post a Comment