[PATCH] binutils: partially revert 17c6c3b99156fe82c1e637e1a5fd9f163ac788c8

徐持恒 Xu Chiheng chiheng.xu@gmail.com
Mon Nov 21 09:21:26 GMT 2022


On Mon, Nov 21, 2022 at 5:02 PM Jan Beulich <jbeulich@suse.com> wrote:
>
> So how did you conclude start32.cpp.o uses RELA relocations? .rel.text
> is SHT_REL, not SHT_RELA, and so are other .rel.* sections. Which
> actually supports my suspicion that SHT_REL aren't correctly handled
> when linking, perhaps first and foremost because the x86-64 ABI
> specifies that only RELA relocations are to be used. Whether, in that
> light, it is valid for objcopy to produce SHT_REL output without any
> warning is another question.
>
I'm not an expert, that was all my guess.

It is clear now that x86-64 linker treats the REL relocation entries
as RELA relocation entries, when doing relocation, it does not count
the addend in section content, because src_mask is set to 0.

Then can objcopy transform the REL relocation entries to RELA
relocation entries, so the x86-64 linker can consume them correctly ?


More information about the Binutils mailing list