This is the mail archive of the
mailing list for the glibc project.
Re: [SPARC] Segfault when resolving STT_GNU_IFUNC functions
From: Richard Henderson <email@example.com>
Date: Tue, 07 Jun 2011 09:21:20 -0700
> Given that ifunc is an extension anyway, you might consider
> adding gotoff-like relocations as well to make life a bit
> easier, and teach gcc to use them for local data.
That's what all the "%gdop_*()" sparc stuff is. I have everything
implemented to make those kinds of local cases work.
The problem in this case is that I'm trying to get at GLRO(dl_hwcap)
which lives in the dynamic linker, from IFUNC resolver code which
lives in libc.so
There is no other way for me to get at the chip capabilities other
than to obtain the AT_HWCAP value the kernel passed in via the
initial process stack. Unlike x86 I lack a "cpuid" instruction or
similar that would allow me to do this without needing AT_HWCAP.
Anyways, normally this IFUNC resolver works, since the GOT will be
filled out before we go resolving memset/memcpy calls, but of course
this can't be relied upon and things like forcing immediate resolving
of all symbols will guarentee it won't work.
And all of this is why I'm passing the dl_hwcap value into the IFUNC
resolver to fix the bug.