https://sourceware.org/bugzilla/show_bug.cgi?id=32769

--- Comment #3 from Sourceware Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Indu Bhagat <[email protected]>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=4b5ff658b4993fae1f347793bddd5c14b76167cd

commit 4b5ff658b4993fae1f347793bddd5c14b76167cd
Author: Claudiu Zissulescu <[email protected]>
Date:   Thu Jan 29 23:27:47 2026 -0800

    ld: bfd: sframe: KEEP .sframe sections and support gc-sections

    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, like it is being done for .eh_frame 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.

    Also, the _bfd_elf_parse_sframe is changed to return TRUE when the
    input sframe section is already parsed. It fixes calling
    _bfd_elf_discard_section_sframe function in bfd_elf_discard_info,
    enabling correct behavior for discarding unneeded sframe sections.

    ld/
            PR ld/32769
            * scripttempl/elf.sc: KEEP .sframe sections.
    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.
            * elf-sframe.c (_bfd_elf_parse_sframe): Return TRUE for already
            parsed sframe sections.

    Co-authored-by: Indu Bhagat <[email protected]>
    Reviewed-by: Jens Remus <[email protected]>
    Signed-off-by: Claudiu Zissulescu
<[email protected]>

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Reply via email to