https://sourceware.org/bugzilla/show_bug.cgi?id=34988
--- Comment #4 from Sourceware Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jan Beulich <[email protected]>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=cda5e335fee83c5bdfc9023f6c429e1bd8140b2e commit cda5e335fee83c5bdfc9023f6c429e1bd8140b2e Author: Harshit Kumar <[email protected]> Date: Mon Nov 23 13:46:03 2026 +0100 riscv: relocate IFUNC references from non-alloc sections as STT_FUNC A local STT_GNU_IFUNC symbol gets its hash entry from the relocation scan, which skips non-SEC_ALLOC sections (PR ld/26080). When only such a section, for example .debug_info, refers to it, riscv_elf_relocate_section finds no entry and aborts. A non-alloc section is not loaded and ld.so never processes it, so relocate a reference from any non-alloc section, debugging and note sections included, as against STT_FUNC: it gets the address of the resolver. This replaces the separate SHT_NOTE (PR ld/22929) and SEC_DEBUGGING (PR ld/18808) cases for a global symbol, which left a debugging section's field unrelocated (0, or the bare addend, in .debug_info) and rejected or aborted on other non-alloc sections. bfd/ PR ld/34988 * elfnn-riscv.c (riscv_elf_relocate_section): Relocate a reference from a non-alloc section to an STT_GNU_IFUNC symbol, local without a hash entry or defined, as against STT_FUNC. ld/ PR ld/34988 * testsuite/ld-riscv-elf/ifunc-debug-nonalloc.d: New test. * testsuite/ld-riscv-elf/ifunc-debug-nonalloc.s: New file. * testsuite/ld-riscv-elf/ifunc-global-debug-nonalloc.d: New test. * testsuite/ld-riscv-elf/ifunc-global-debug-nonalloc.s: New file. * testsuite/ld-riscv-elf/ifunc-global-plain-nonalloc.d: New test. * testsuite/ld-riscv-elf/ifunc-global-plain-nonalloc.s: New file. * testsuite/ld-riscv-elf/ifunc-note-nonalloc.d: New test. * testsuite/ld-riscv-elf/ifunc-note-nonalloc.s: New file. * testsuite/ld-riscv-elf/ifunc-plain-nonalloc.d: New test. * testsuite/ld-riscv-elf/ifunc-plain-nonalloc.s: New file. * testsuite/ld-riscv-elf/ld-riscv-elf.exp: Run them. Signed-off-by: Harshit Kumar <[email protected]> -- You are receiving this mail because: You are on the CC list for the bug.
