hello.c gcc compiler four stages

hello.c

#include <stdio.h>

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

compilation

Phase 1. Pre-treatment: a pre-processor (CPP)

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

2. Compile stages: the compiler (ccl)

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

3. compilation stage: Assembler (as)

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

4. link phase: linker (LD)

$ gcc hello.o -o hello

frame

Guess you like

Origin www.cnblogs.com/typescript/p/11478937.html