[PATCH 2/7] x86: handle a local IFUNC referenced only from a non-alloc section
Harshit Kumar
harshit7kr@gmail.com
Fri Nov 13 12:45:27 GMT 2026
Last message went to wrong thread sorry for that...
> How did you pick this insertion point?
On purpose ahead of the return. The new tests are static links with
no shared library or run step, so they don't need a Linux target, and
I wanted x86_64-elf to run them too. In x86-64.exp I first had them
after pr20253-5b, but in an x86_64-elf build that is past the return
and they silently stopped running, so I put them at the end of the
pr-numbered run instead (after pr20093-2). In i386.exp they follow
pr20253-5, the end of the IFUNC tests there. All eight pass in an
x86_64-elf build as well as natively. The ifunc-textrel tests below
the return link with -pie, which I took to be why they are there.
> These -melf_i386 (if really needed) may in fact get in the way of
> invoking these testcases ahead of said conditional return.
The neighbouring tests use -melf_i386 and -melf_x86_64 the same way
(e.g. pr20253-5, pr20093-2), and they work on x86_64-elf. I can drop
the option if you prefer.
> Note also that there is a whole ld-ifunc/ subdir.
ld-ifunc/ holds mostly shared or run tests built from C, and the
related pr22929 test lives in ld-i386/ and ld-x86-64/, so I'd keep
them there unless you prefer otherwise.
Thanks,
Harshit
On Fri, 13 Nov 2026 at 18:13, Harshit Kumar <harshit7kr@gmail.com> wrote:
>
> Hi Jan,
>
> > Question is: Why don't you replace those existing incarnations of the
> > rule enforcement then?
>
> I left them alone to keep the series a fix rather than a refactor (the
> cover letter says so). I'm happy to convert them, though: v2 will make
> the global-symbol code in x86, AArch64, RISC-V and SPARC use the helper
> too, and (per the 0/7 thread) have it treat debugging sections like
> SHT_NOTE, unless Alan objects.
>
> > Pointer-to-const for the function argument?
>
> Yes, will do.
>
> Thanks,
> Harshit
>
>
> On Fri, 13 Nov 2026 at 17:03, Jan Beulich <jbeulich@suse.com> wrote:
> >
> > On 11.11.2026 12:03, Harshit Kumar wrote:
> > > --- a/ld/testsuite/ld-i386/i386.exp
> > > +++ b/ld/testsuite/ld-i386/i386.exp
> > > @@ -445,6 +445,10 @@ run_dump_test "pr20253-4a"
> > > run_dump_test "pr20253-4b"
> > > run_dump_test "pr20253-4c"
> > > run_dump_test "pr20253-5"
> > > +run_dump_test "ifunc-skip-nonalloc"
> > > +run_dump_test "ifunc-note-nonalloc"
> > > +run_dump_test "ifunc-plain-nonalloc"
> > > +run_dump_test "ifunc-global-plain-nonalloc"
> > > run_dump_test "pr20515"
> > > run_dump_test "property-x86-3"
> > > run_dump_test "property-x86-4a"
> >
> > How did you pick this insertion point? There are a few ifunc tests invoked
> > further down, after a conditional return from the script. Aiui either your
> > new tests need to be put below there, or you're indicating that the existing
> > ifunc ones there are misplaced any want moving up ahead.
> >
> > Note also that there is a whole ld-ifunc/ subdir. Whether putting the new
> > tests there instead would be the right thing I don't know, though, as I'm
> > unaware of the criteria which were used for the split.
> >
> > > --- /dev/null
> > > +++ b/ld/testsuite/ld-i386/ifunc-global-plain-nonalloc.d
> > > @@ -0,0 +1,4 @@
> > > +#name: global IFUNC symbol referenced from a plain non-alloc section
> > > +#as: --32
> > > +#ld: -e _start -melf_i386
> >
> > These -melf_i386 (if really needed) may in fact get in the way of invoking
> > these testcases ahead of said conditional return.
> >
> > Similar remarks for the x86-64 part.
> >
> > Jan
More information about the Binutils
mailing list