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

--- Comment #1 from Stian Halseth <stian at itx dot no> ---
Patch:
https://inbox.sourceware.org/binutils/[email protected]/

> x86-64 is not affected, since _bfd_x86_elf_link_setup_gnu_properties
> creates .iplt there and allocate_dynrelocs always has a section to
> size.

After doing some more testing and writing up the patch I realized
that I got the reason wrong. bfd_x86_elf_link_setup_gnu_properties
returns early for a relocatable link, so x86-64 has no .iplt either.

It's not affected because _bfd_elf_allocate_ifunc_dyn_relocs returns
when plt.refcount and got.refcount are both zero, and they are zero
when check_relocs never ran. aarch64 and riscv use the same helper.
sparc decides from the symbol's attributes instead, so it is the only
one that faults.

A related, older bug: a static link also fails on sparc when the ifunc
is defined in an object without relocations and only referenced from a
non-alloc section. Take ifunc-27a.s from the patch, add a second file
with ".section .debug_info" and ".dc.a do_it", and link them with
-static. 2.47 hits the abort () in _bfd_sparc_elf_finish_dynamic_symbol,
and master segfaults earlier in allocate_dynrelocs. My patch does not
change that case.

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

Reply via email to