小编kil*_*mat的帖子

编译错误:针对未定义的符号重新定位R_X86_64_PC32

我尝试用汇编语言创建函数并将它们放在动态库中,因此我使用此命令创建带有.S的.o
nasm -f elf64 hello.S -o hello.o
但是当我想用gcc创建lib时:
gcc -fPIC -shared hello.o -o libasm.so
它会显示以下错误:
/usr/bin/ld: hello.o: relocation R_X86_64_PC32 against undefined symbol printf@@GLIBC_2.2.5 can not be used when making a shared object; recompile with -fPIC

assembly makefile compilation dynamic relocation

6
推荐指数
1
解决办法
2806
查看次数

标签 统计

assembly ×1

compilation ×1

dynamic ×1

makefile ×1

relocation ×1