gcc预处理、编译、汇编、链接

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/fengfeng0328/article/details/80504197

最简单的gcc命令:

$ gcc hello.c -o hello

背后细节:预处理、编译、汇编、链接

1.预处理

$ gcc -E hello.c -o hello.i

2.编译

$ gcc -S hello.i -o hello.s    //hello.s汇编文件

3.汇编

$ gcc -c hello.s -o hello.o   //hello.o目标文件

4.链接

$ gcc hello.o -o hello         

猜你喜欢

转载自blog.csdn.net/fengfeng0328/article/details/80504197