[PATCH 2/3] ld: bfd: sframe: KEEP .sframe sections and support gc-sections

Claudiu Zissulescu-Ianculescu claudiu.zissulescu-ianculescu@oracle.com
Tue Jan 13 10:21:04 GMT 2026


Hi,

Maybe the best is to swap the order of the patches, first the fix, then the tests. In general, I like to see if a test works for a given issue, and this is the reason why the are first patches which I craft.

Best regards,
Claudiu


________________________________
From: Jens Remus <jremus@linux.ibm.com>
Sent: 12 January 2026 17:46
To: Claudiu Zissulescu-Ianculescu <claudiu.zissulescu-ianculescu@oracle.com>; binutils@sourceware.org <binutils@sourceware.org>
Cc: Elena Zannoni <elena.zannoni@oracle.com>; Indu Bhagat <indu.bhagat@oracle.com>
Subject: Re: [PATCH 2/3] ld: bfd: sframe: KEEP .sframe sections and support gc-sections

On 1/12/2026 11:53 AM, claudiu.zissulescu-ianculescu--- via Binutils wrote:
> From: Claudiu Zissulescu <claudiu.zissulescu-ianculescu@oracle.com>
>
> Fix PR ld/32769
>
> Currently, specifying --gc-sections causes the linker to discard all
> input .sframe sections.  Fix this behaviour by adding KEEP for .sframe
> sections in the default ELF linker script.
>
> Additionally, add logic in the linker to gc mark .sframe sections.
> _bfd_elf_gc_mark () now is aware of SFrame sections. It relies on
> elf_section_sframe () to get the SFrame section associated with the text
> section.
>
> The stub changes in bfd_elf_discard_info skip checking the return
> value of _bfd_elf_parse_sframe because it may have already been
> parsed.  Remove redundant call to _bfd_elf_set_section_sframe.
>
> ld/
>        PR ld/32769
>        * scripttempl/elf.sc: KEEP .sframe sections.

Doesn't this affect any of the tests added with "[PATCH 1/3] sframe: Add
tests for PR ld/32769"?  If not, why isn't an additional test added?

> bfd/
>        * elf-bfd.h (struct elf_obj_tdata): Add sframe section pointer.
>        (elf_sframe_section): New macro.
>        * elflink.c (_bfd_elf_gc_mark): Handle SFrame sections.
>        (bfd_elf_gc_sections): Likewise.
>        (bfd_elf_discard_info): Update for handling gc operations.
>
> Co-authored-by: Indu Bhagat <indu.bhagat@oracle.com>
> Signed-off-by: Claudiu Zissulescu <claudiu.zissulescu-ianculescu@oracle.com>
Regards,
Jens
--
Jens Remus
Linux on Z Development (D3303)
jremus@de.ibm.com / jremus@linux.ibm.com

IBM Deutschland Research & Development GmbH; Vorsitzender des Aufsichtsrats: Wolfgang Wendt; Geschäftsführung: David Faller; Sitz der Gesellschaft: Ehningen; Registergericht: Amtsgericht Stuttgart, HRB 243294
IBM Data Privacy Statement: https://www.ibm.com/privacy/


Confidential- Oracle Internal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://sourceware.org/pipermail/binutils/attachments/20260113/0a447f91/attachment-0001.htm>


More information about the Binutils mailing list