GCC 编译链接 以及相关参数

1) 预处理
gcc -E test.c -o test.i

2) 编译为汇编代码(Compilation)
gcc -S test.i -o test.s

3) 汇编(Assembly) 二进制文件
gcc -c test.s -o test.o

4) 连接(Linking)
gcc test.o -o test
//多文件链接
gcc test1 test2 test3  -o test

5)常用参数
 

-EL
-march
-mxgot
-mabi
-mlong
-calls
-Wall
-Werror
-O2
-G
-D
-ffunction-sections
-MMD
-MP
-MF
-MT

//
--oformat elf32
-tradlittlemips
--gc-sections -nostdlib
-T
-o
-Map

猜你喜欢

转载自blog.csdn.net/poject/article/details/84071197
今日推荐