[RFC 1/4] gas: ld: sframe: fix RELA r_offset handling

Jan Beulich jbeulich@suse.com
Fri Mar 21 14:13:20 GMT 2025


On 20.03.2025 16:54, Indu Bhagat wrote:
> On 3/13/25 7:04 AM, Jan Beulich wrote:
>> On 08.03.2025 08:38, Indu Bhagat wrote:
>>> In SFrame V2, SFrame function descriptor entry is a 32-bit signed
>>> integer (sfde_func_start_address) which is meant to indicate the start
>>> PC of the function.  According to the specification, it intends to hold
>>> the offset of the start PC of the function from the
>>> _start_of_the_SFrame_section_.
>>
>> Which isn't something that can normally be expressed by relocations. Hence
>> is it maybe the spec which is flawed? As mentioned elsewhere, relocations
>> should retain their normal meaning. Custom adjustments based on it being
>> .sframe sections that are being processed feels wrong. Unaware tools ought
>> to be able to deal with this just fine.
>>
> 
> Re: change the spec, this issue needs to be fixed for SFrame V2, and the 
> fix backported.

I fear I'll need to leave it to Nick then to approve any of this series,
in line with him having approved the original sframe work.

> Given the way SFrame sections are by design, unaware tools linking 
> SFrame sections will not dump out valid output SFrame section.

Right - I consider this a deficiency of the spec.

>> There also looks to be a number of unrelated changes in this patch.
>> Without there being anything said about those they look as if they're
>> there by mistake.
> 
> There are two set of changes in this patch, which need to go hand in 
> hand (i.e., in the same patch I am afraid): gas emits a different RELA 
> and ld does not do any fixup as it was doing earlier.  I cant seem to 
> find which of the stub seems unrelated.  Can you point them to me ?

Starting from the top, there's renaming of a local var pltn_reloc_by_hand,
there's insertion of a (seemingly random) blank line, and there's removal
of a FIXME comment. (That latter change may indeed be related, and I may
merely not be appreciating the connection.) And then in output_sframe()
there's removal of a blank line, for no apparent reason.

Jan


More information about the Binutils mailing list