This document summarizes the different stages of the compilation process from source code to executable program. It begins by showing sample C code for a simple function. It then walks through each step of compiling this code, including lexical analysis, parsing, semantic analysis, code generation, optimization, assembly, and linking. Key aspects like the abstract syntax tree and intermediate representations used at different stages are also outlined.
37. > nm main.o
U _calc
0000000000000000 T _main
U _printf
38. > nm main.o
U _calc
0000000000000000 T _main
U _printf
> ld -lc calc.o main.o -o main
> nm main
0000000000001f30 T _calc
0000000000001fc8 S _factor
0000000000001f60 T _main
U _printf