码迷,mamicode.com
首页 > 其他好文 > 详细

gcc 编译 hello.c 的四个阶段

时间:2019-09-07 00:36:57      阅读:100      评论:0      收藏:0      [点我收藏+]

标签:技术   frame   pre   include   pil   ret   info   div   turn   

hello.c

#include <stdio.h>

int main()
{
    printf("hello, world!\n");
    return 0;
}

技术图片

1. 预处理阶段:预处理器(cpp)

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

2. 编译阶段:编译器(ccl)

$ gcc -S hello.i -o hello.s

3. 汇编阶段:汇编器(as)

$ gcc -c hello.s -o hello.o

4. 链接阶段:链接器(ld)

$ gcc hello.o -o hello

技术图片

gcc 编译 hello.c 的四个阶段

标签:技术   frame   pre   include   pil   ret   info   div   turn   

原文地址:https://www.cnblogs.com/typescript/p/11478937.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!