Posts

Showing posts with the label linker

MA: Linker+Loader (explanation)

=====> COMPILATION PROCESS <====== | |----> Input is Source file(.c) | V +=================+ | | | C Preprocessor | | | +=================+ | | ---> Pure C file ( comd:cc -E <file.name> ) | V +=================+ | | | Lexical Analyzer| | | +-----------------+ | | | Syntax Analyzer | | | +-----------------+ | | | Semantic Analize| | | +-----------------+ | | | Pre Optimization| | | +-...

MA: Linker

In computer science , a linker or link editor is a computer program that takes one or more object files generated by a compiler and combines them into a single executable program. For most compilers, each object file is the result of compiling one input source code file. When a program comprises multiple object files, the linker combines these files into a unified executable program, resolving the symbols as it goes along. Linkers can take objects from a collection called a library . Some linkers do not include the whole library in the output; they only include its symbols that are referenced from other object files or libraries. Libraries exist for diverse purposes, and one or more system libraries are usually linked in by default. The linker also takes care of arranging the objects in a program's address space . This may involve relocating code that assumes a specific base address to another base. Since a compiler seldom knows where an object will reside, i...