//hello.c #include <stdio.h> int main (void) { printf ("Hello, world!\n"); return 0; }
预处理:替代宏,引入头文件
cpp hello.c > hello.i
编译:
gcc -Wall -S hello.i
(生成hello.s)
汇编:
as hello.s -o hello.o
(生成hello.o)
链接:
复杂ld版:
ld -dynamic-linker /lib/ld-linux.so.2 /usr/lib/crt1.o /usr/lib/crti.o
/usr/lib/gcc/i486-linux-gnu/4.3/crtbegin.o -L/usr/lib/gcc/i486-linux-gnu/4.3
hello.o -lgcc -lgcc_eh -lc /usr/lib/gcc/i486-linux-gnu/4.3/crtend.o
/usr/lib/crtn.o
利用gcc完成:
gcc hello.o
(生成a.out)
标签:GCC,lib,gcc,hello,编译,ld,usr,linux,预处理 From: https://www.cnblogs.com/woodx/p/17340197.html