[V2 31/36] [SFrame-V3] ld: discard sframe sections when --discard-sframe

Indu Bhagat indu.bhagat@oracle.com
Thu Jan 8 08:53:13 GMT 2026


On 1/7/26 4:06 AM, Jens Remus wrote:
> On 1/7/2026 9:42 AM, Indu Bhagat wrote:
>> Mark SFrame sections with SEC_EXCLUDE if --discard-sframe is in effect.
>>
>> TBD:
>>    - This does generate an empty .sframe section though!  A problem ? No
>>      segment marker PT_GNU_SFRAME is created, which is good
> 
> Without an empty .sframe section would be preferable.  But maybe that
> can be resolved later on?  Not sure how others think about that though.
> 

I am afraid this will need to be looked at later, yes.  I have noted it 
down for now.  Not creating the section header (for empty section) when 
--discard-sframe without touching generic linker parts for SFrame may 
not be possible though (IIUC).

>>
>> bfd/
>> 	* elf-sframe.c (_bfd_elf_parse_sframe): Mark with SEC_EXCLUDE if
>> 	--discard-sframe is in effect.
>> ld/testsuite/
>> 	* ld-x86-64/x86-64.exp: New test.
>> 	* ld-x86-64/sframe-command-line-1.d: New test.
> 
> Wouldn't it make sense to squash this patch into the previous?  At least
> prior to committing.
> 

Makes sense.  I kept it separate in order to keep my action item above 
clearly stand out.  But since I will not be able to take a look now, if 
this series goes in current shape, I can squash this commit with previous.

Thanks
Indu


More information about the Binutils mailing list