C语言文件编译成可执行文件过程
#include <stdio.h>
int main(){
printf("Hello world!");
return 0;
}
在liunx环境下执行该命令
linux> gcc -o hello hello.c
hello.c文件–>hello可执行文件经历了四个过程:
hello.c—>hello.i (预处理)
hello.i—>hello.s (编译)
hello.s—>hello.o (汇编)
hello.o—>hello (链接)
参考:CSAPP.pdf