[PATCH] binutils: partially revert 17c6c3b99156fe82c1e637e1a5fd9f163ac788c8

Jan Beulich jbeulich@suse.com
Mon Nov 21 09:52:24 GMT 2022


On 21.11.2022 10:21, 徐持恒 Xu Chiheng wrote:
> 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 ?

It probably could, but I have no idea how to invasive this would end
up being.

Jan


More information about the Binutils mailing list