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 <rth at twiddle dot net>
- To: David Miller <davem at davemloft dot net>
- Cc: aurelien at aurel32 dot net, libc-alpha at sourceware dot org
- Date: Tue, 07 Jun 2011 09:21:20 -0700
- Subject: Re: [SPARC] Segfault when resolving STT_GNU_IFUNC functions
- References: <20110508182509.GH24711@hall.aurel32.net> <email@example.com> <firstname.lastname@example.org>
On 06/06/2011 04:51 PM, David Miller wrote:
> As you discovered we can't depend upon GOT relocations being resolved
> at this point. The only way I could come up to get the dl_hwcap value
> passed down to the IFUNC resolvers is to pass it in directly from the
> dynamic linker (where such symbol references are safe by the time we
> get to these things).
IFUNC resolvers are always going to be a bit special-case.
You need to use pc-relative or gp-relative relocations to
get to the symbols used therein.
E.g. for i386, @GOTOFF, not @GOT, etc.
Sparc is slightly deficient here, but you do have the
R_SPARC_PC10/22 relocations if you want to write all of
these functions by hand. E.g.
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.