[PATCH 2/7] x86: handle a local IFUNC referenced only from a non-alloc section

Harshit Kumar harshit7kr@gmail.com
Fri Nov 13 15:12:11 GMT 2026


> Likely there is a (perhaps historical) reason for this, but it feels
> wrong to me. Plain ELF targets should imo be ELFOSABI_NONE.

I looked it up: it is fairly recent.  Alan's ff31f2e09d ("Set ELF_OSABI
for x86 and sparc", January) added it for target matching, mainly so
the Solaris vectors win for ELFOSABI_SOLARIS objects, and x86_64-elf
shares x86_64_elf64_vec with Linux:
https://inbox.sourceware.org/binutils/aVos4o3YHLbKaT8B@squeak.grove.modra.org/

It doesn't decide whether IFUNC works there, though:
_bfd_elf_final_write_processing marks an ELFOSABI_NONE output as
ELFOSABI_GNU when it uses IFUNC, so x86_64-elf accepted IFUNC before
that change as well.

Following this up showed a problem in v1, though: since that change
gas rejects IFUNC on sparc64-*-solaris*, so the SPARC tests in patch 5
fail there.  v2 will run them only when supports_gnu_osabi.

Thanks


Harshit

On Fri, 13 Nov 2026 at 18:59, Jan Beulich <jbeulich@suse.com> wrote:
>
> On 13.11.2026 14:21, Harshit Kumar wrote:
> >> But a GNU one at least, i.e. ...
> >> ... I'm not sure these tests should work as expected there. (IOW if they
> >> do, this may point at another problem.)
> >
> > As far as I can tell x86_64-elf is one.  Its vectors, x86_64_elf64_vec
> > and i386_elf32_vec, have ELF_OSABI ELFOSABI_GNU (FreeBSD and Solaris
> > have their own), and the linked output is marked OS/ABI GNU.
> > supports_gnu_osabi in binutils-common.exp is true for *-*-elf*, so
> > ld-ifunc/ifunc.exp runs there as well (98 passes on master), and
> > i386.exp already runs IFUNC tests such as pr20253-5 and pr22929 ahead
> > of the return.
>
> Likely there is a (perhaps historical) reason for this, but it feels
> wrong to me. Plain ELF targets should imo be ELFOSABI_NONE.
>
> Jan


More information about the Binutils mailing list