
20 Compilers – Principles and Practice
c
pre-processing (invokes cpp),
c
compilation,
c
assembly (invokes as), see Fig. 1.17,
c
linking (invokes ld), see Fig. 1.18.
Fig. 1.18 gcc: The linker converts an obj file to an executable
myprog.c
myprog.o
gcc
X86 m/c code
myprog.o
myprog
Linker Id
X86 m/c code
myprog.c
myprog.s
gcc
X86 m/c code
myprog.s
myprog.o
Assembler as
X86 m/c code
Fig. 1.17 gcc converts from C to obj using assembler
In gcc, the level of attempted optimization controlled by -0 and other switches, but you have to be
careful, specially for embedded and Device-driver codes.
In the subsequent chapters, we shall refer to GCC for indicating how relevant ...