This preview shows page 1. Sign up to view the full content.
Unformatted text preview: hello.c on the system, the individual C statements must be translated by other programs into a sequence of low-level machine-language instructions. These instructions are then packaged in a form called an executable object program, and stored as a binary disk ﬁle. Object programs are also referred to as executable object ﬁles. On a Unix system, the translation from source ﬁle to object ﬁle is performed by a compiler driver:
unix> gcc -o hello hello.c Here, the GCC compiler driver reads the source ﬁle hello.c and translates it into an executable object ﬁle hello. The translation is performed in the sequence of four phases shown in Figure 1.3. The programs that perform the four phases ( preprocessor, compiler, assembler, and linker) are known collectively as the compilation system.
printf.o hello.c source program (text) prehello.i processor (cpp) compiler (cc1) hello.s assembler hello.o (as)
relocatable object programs (binary) linker (ld) hello modified source program (text) assembly program (tex...
View Full Document