HelloWorld life cycle

[https://pan.baidu.com/s/1bOfnYWg_GnskTc5V5VGeXg]

1. hello program from the beginning of the source file.

This phase of the mission is to complete editing hello.c file.

2. hello.c compiled driver converted into an executable file


After the source files edited and saved, GCC reads hello.c and hello to translate it into an executable file.
This process can be divided into four stages:

①. Pretreatment stage

Preprocessor (cpp) command beginning with # (# command usually are some of the things and copy and paste), modify the original C program, get a new C program (usually .i as the file extension).

②. Compilation phase

The compiler (ccl) text file hello.i translated into a text file hello.s, in fact, is the source code into C language source code into compiled it.

③. Compilation stage

Next, the assembler (as) will hello.s translated into machine language instructions, and these instructions packaged into a relocatable object program , and the results are stored in a binary file hello.o years (in the symbol table when redirection a lot can happen, such as initialization and the like, later supplemented). In fact, that is the assembly code into an executable.

Guess you like

Origin www.cnblogs.com/shing-virus/p/11449561.html