Compilation of C Prog
Compilation of C Prog
•Preprocessing
•Compilation
•Assembly
•Linking
Preprocessing
• This is the first phase through which source code
• is passed. This phase include:
• Removal of Comments
• Expansion of Macros
• Expansion of the included files.
Preprocessing
After
preprocessing, filename.i is
produced
Compilation
In this stage, the preprocessed code is
translated to assembly instructions
After compiling, filename.s is produced
Assembly
•During the assembly stage, an assembler is used to
translate the assembly instructions to machine code,
or object code.
After assemblinging, filename.o is produced
Linking
The linker will add the object code for
the built-in function and some extra work is
done here.
After linking, filename.exe is produced