This is the 53rd Step towards gaining the Programming Enlightenment series. If you didn’t learn the 52nd Step, read it.
What is Linker?
Wiki says, “ 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 file, library file, or another ‘object’ file.”
An illustration of the linking process is shown below. Object files and static libraries are assembled into a new library or executable
A linker is a very straightforward program. It concatenates the code and data sections of the object files, connect the references to symbols with their definitions, pull unresolved symbols out of the library and write out executable.
What is compiler?
Wiki says, ‘A compiler is computer software that transforms computer code written in one programming language (the source language) into another programming language (the target language).’
It’s primarily used to translate source code from high-level language (eg., C, Java, Python) to a lower level language (eg, assembly language, object code or machine code).
What a build process does is not magical. Try to understand it.
TL;DR Understand your compilation process.
Go to 52nd Step
Go to 54th Step.
References:
- 97 things Every Programmer Should Know ~ Git Book
- 97 Things Every Programmer Should Know ~ Paperback
- What is Linker? ~ Wiki
- What is Linker, Compiler, Loader? ~ Stackoverflow
- How Android app is built? ~ github