如何在没有CRT的情况下链接OBJ文件



如何实现链接2 .o文件,而无需crt。

编译.C文件:

gcc -ffreestanding -c file.c -o file.o

链接:

gcc  file1.o file2.o -o f.o

flags -nostartfiles和-nostdlib不帮助我。

我只是编译2 .C文件,我想在1个对象文件中链接它们

ld -r -o f.o file1.o file2.o