无法编译:无法识别的重定位 [英] Unable to compile: unrecognized relocation
问题描述
我无法在linux pc中编译任何东西.我不知道为什么,可能我已经安装了一些软件包并弄得一团糟.我已经卸载并重新安装了gcc和其他软件包,但没有好消息..仍然是这个问题.
I'm unable to compile anything in my linux pc. I have no idea why, probably I've installed some package and made a mess. I've uninstalled and reinstalled gcc and other packages, but no good news.. still this problem.
这是消息:
/usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-
linux/bin/ld: /usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../lib64/crt1.o: unrecognized relocation (0x29) in section `.text'
关于这意味着什么以及如何解决此问题的任何想法?
Any idea of what does it mean and how to fix this problem?
欢呼
推荐答案
对于遇到此问题的其他人:我认为@ gabib44的问题是使用旧版本的ld
链接使用较新版本构建的库版本.
For anyone else that encounters this issue: I think @gabib44's problem was using a older version of ld
to link a library that had been built with a newer version.
无法识别的重定位". 0x2a
(R_X86_64_REX_GOTPCRELX
)当前是具有最大值的重定位类型;我猜@ gabib44的ld
足够老,以至于不知道该类型之前的重定位类型(0x29
,R_X86_64_GOTPCRELX
).
"unrecognized relocation" occurs when the relocation type is greater than the greatest known relocation type in your version of ld
. 0x2a
(R_X86_64_REX_GOTPCRELX
) is presently the relocation type with the greatest value; I guess @gabib44's ld
was old enough to not know about the relocation type before that one (0x29
, R_X86_64_GOTPCRELX
).
当我使用binutils v2.26构建一个库时,我自己遇到了这个问题(该库知道重定位0x2a
),然后将该库合并到使用binutils v2.24的构建机器上
I had this problem myself when I was building a library with binutils v2.26 (which knew about relocation 0x2a
) but then incorporating that library on a build machine using binutils v2.24
修复程序是建立要与较旧版本的binutils套件链接的库,或者在要链接该库的计算机上升级ld
.
The fix is either to build the library that you want to link with a older version of the binutils suite, or to upgrade ld
on the machine that wants to link that library.
这篇关于无法编译:无法识别的重定位的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!