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

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

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

commit 9621e7e98df5895eeb2f4aadbdc95687dbf6b8f5
Author: Alan Modra <[email protected]>
Date:   Thu Oct 29 08:26:24 2026 +1030

    Ignore empty symtab sections

    Confusion results if we accept an empty .symtab as elf_symtab_hdr.  A
    lot of BFD code for ELF targets supported by GNU ld requires that the
    STN_UNDEF symbol be treated as a local sym when processing relocs,
    which means it must be present and sh_info for .symtab be non-zero.

    This patch stops BFD from attempting to handle relocations in an
    object with an empty .symtab, as is already the case for relocations
    where .symtab is missing entirely.  More reporting is done too.

    The extra reporting showed failures on rx-elf when attempting to
    assemble strip-15rela.s from the binutils testsuite.  The test would
    need to be modified to create .relaP rather than .rela.text to work
    on that target.  I opted instead to disable the test.

            PR 34835
            PR 13962
            PR 7023
    bfd/
            * elf.c (bfd_section_from_shdr): Do not use an empty SHT_SYMTAB
            or SHT_DYNSYM section.  Validate sh_info of SHT_SYMTAB and
            SHT_DYNSYM sections.  Delete bogus SHT_SYMTAB comment.  Report
            an error on bad sh_link or sh_info of reloc sections.
    binutils/
            * testsuite/binutils-all/strip-15.d: Disable for rx.
            * testsuite/binutils-all/strip-section-headers-1.d: Likewise.
            * testsuite/binutils-all/strip-13.d: Correct rx comment.
            * testsuite/binutils-all/strip-14.d: Likewise

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

Reply via email to