【发布时间】:2019-04-16 10:05:21
【问题描述】:
我正在尝试链接一些文件。这是我的命令:
gcc -T linker.ld -o Stack\ Berry.bin -ffreestanding -O2 -nostlib kernel.o boot.o -fPIC -lgcc
但是,我得到了这个错误:
/usr/bin/ld: boot.o: relocation R_X86_64_32 against `.multiboot' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
我已经包含了-fPIC 参数,我是不是把它放错了地方?我试过把论点放在它编译的地方,但没有运气。我找不到任何关于这个标志的语法的东西。谢谢!
【问题讨论】: