The linker is the important topic of the Compiler Design. Moreover, Compiler Design is an important subject of the computer field.
So In addition to a compiler, several other programs may be required to create an executable target program.
Similarly, Preprocessor produces input to the compiler. They may perform the following functions,
- Macro processing: A preprocessor may allow the user to define macros that are shorthand for longer constructs.
- File inclusion: A preprocessor may include the header file into the program text.
- Rational preprocessor: Such a preprocessor provides the user with built-in macro for a construct like while statement or if statement.
- Language extensions: this processor attempt to add capabilities to the language by what amount to built-in macros. Ex: the language equal is a database query language embedded in C.So statement beginning with ## are taken by the preprocessor to be database access statement unrelated to C and translated into procedure call on routines that perform the database access.
– Skeletal source
– Source program
– Target assembly
– Relocatable M/C code
– Linker / Loader
– Absolute M/C code
Assembler is a translator which takes the assembly program as an input and generates the machine code as an output.So An assembly is a mnemonic version of machine code, in which names are instead of binary codes for operations.
After that Linker allows us to make a single program from several files of relocatable machine code. Moreover, This file may have been the result of several different compilations, and one or more may be library files of routinely provided by a system.
Again The process of loading consists of taking relocatable machine code, altering the relocatable address and placing the altered instructions and data in memory at the proper location.