We must know that GCC contains a series of compilers which are useful for compiling programs written in C, C ++, Java and Objective C among others.
GCC was originally written as the compiler for the GNU operating system.
GCC has four stages Preprocessing, compilation, assembly and connection
- Preprocess: Generate .i file
The C language code is first preprocessed with the include “include” functions and performs a conditional compilation handling the declarations keeping the ones that meet the compilation conditions and removing the others.
In this process, the result of the preprocessing is taken and an assembly language file with an “.s” extension is generated; in this process the syntax is checked, paying attention to external functions and variables.
After the compiler delivers the assembly file, it carries out a process for it to be translated into machine language and it is called an object file and its extension is “.o”
The file generated by the “.o” extension handler cannot be used directly. The process of converting the target file into a form that is finally usable is called binding. When using a library, library loading is handled at this stage.