This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [SPARC] Segfault when resolving STT_GNU_IFUNC functions
From: Aurelien Jarno <aurelien@aurel32.net>
Date: Sun, 12 Jun 2011 01:27:38 +0200
> On Fri, Jun 10, 2011 at 03:58:42PM -0700, David Miller wrote:
>> From: Aurelien Jarno <aurelien@aurel32.net>
>> Date: Sat, 11 Jun 2011 00:27:12 +0200
>>
>> > The problems happens because the IFUNC resolvers are sometimes also
>> > called from generic code, in this case from elf/dl-runtime.c. The patch
>> > below fixes the problem on sparc following the same principle, but is
>> > just there to show the issue, it's not acceptable for mainline.
>>
>> Thanks for debugging this.
>>
>> If doing this generically isn't an option, we can abstract this call
>> out into an arch header file such as dl-irel.h
>>
>> Although, frankly I don't see why doing it generically would be a bad
>> idea.
>
> Just due to the fact that it will add some more instructions to pass the
> values on all architectures, while only one is actually using it.
Powerpc will be guarenteed to need this facility too, FWIW.
> That said if it is acceptable, I have prepared a patch to fix all these
> calls. I have verified that it fixes all the regressions for both
> sparc32 and sparc64 on an Ultrasparc III machine. The testsuite results
> is now identical with --enable-multi-arch and with --disable-multi-arch.
>
> 2011-06-11 Aurelien Jarno <aurelien@aurel32.net>
>
> * elf/dl-runtime.c(_dl_fixup,_dl_profile_fixup): Pass dl_hwcap to
> ifuncs.
> * elf/dl-sym.c(do_sym): Likewise.
I really think this is the way to go and if no objections are raised
I'd like to commit this soon.
Thanks!