Unable to compile: unrecognized relocation

前端 未结 3 1985
伪装坚强ぢ
伪装坚强ぢ 2021-02-14 11:50

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 packag

3条回答
  •  鱼传尺愫
    2021-02-14 12:14

    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.

    "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).

    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

    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.

提交回复
热议问题