Cbuild
Cbuild
The build-process in C
Abdelrahman Aboghanima
Refrences
Preprocessor
Example
1 $ gcc -E -P func1.c
Preprocessor Output
Compiler
1 $ avr-gcc -S func1.c
1 $ arm-none-eabi-gcc -S func1.c
Assembler
Linker
Definition
Linker: is a computer system program that takes one or more
object files (generated by a compiler or an assembler) and
combines them into a single executable file, library file, or another
”object” file.
Types of linking
I Static Linking
Details
The code for all routines called by your program becomes part of
the executable file.
Types of linking
I Static Linking
I Dynamic Linking
Details
Every dynamically linked program contains a small, statically linked
function that is called when the program starts. This static
function only maps the link library into memory and runs the code
that the function contains. The link library determines what are all
the dynamic libraries which the program requires along with the
names of the variables and functions needed from those libraries by
reading the information contained in sections of the library.
Locator
The locator main process is mapping the memory virtual addrsses
of the sections to the physical addresses with the aid of the linker
script file.
Refrences
Relocation (computing)
Object File
Linker
Static and Dynamic Linking
Dynamic and static linking, IBM
Linker, Bravegnu