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

--- Comment #2 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=0ee1c4f8dfd28a947ea434ba7eab6d56b471dce7

commit 0ee1c4f8dfd28a947ea434ba7eab6d56b471dce7
Author: Alan Modra <[email protected]>
Date:   Sat Dec 5 07:03:53 2026 +1030

    PR 35099 ld -r segfaults on sparc64

    Commit 447d46c9ad77 ("Set dynobj when creating stub bfd") makes ld set
    dynobj to the stub bfd in every sparc link, relocatable ones included.
    _bfd_sparc_elf_late_size_sections only returns early when dynobj is
    NULL, so it now runs allocate_dynrelocs for an ld -r link.

    A relocatable link has no dynamic sections, so there is no .plt.
    _bfd_sparc_elf_check_relocs returns early for it, so there is no .iplt
    either. allocate_dynrelocs still gives a STT_GNU_IFUNC symbol a PLT
    slot when it is defined and referenced in regular objects, and
    dereferences the missing section.

    bfd/
            PR ld/35099
            * elfnn-ia64.c (elfNN_ia64_relocate_section): Don't set srel
            for relocatable link.

    ld/
            PR ld/35099
            * ldelf.c (ldelf_after_open_output): Don't set dynobj for
            relocatable link.
            * testsuite/ld-ifunc/ifunc-26.s: Replace '.set' with '='.
            * testsuite/ld-ifunc/ifunc-26.d: Don't xfail alpha.
            * testsuite/ld-ifunc/ifunc-27.d,
            * testsuite/ld-ifunc/ifunc-27a.s,
            * testsuite/ld-ifunc/ifunc-27b.s: New test.

    Co-authored-by: Stian Halseth <[email protected]>

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

Reply via email to