This is the mail archive of the
mailing list for the glibc project.
Re: [SPARC] Segfault when resolving STT_GNU_IFUNC functions
On Sat, Jun 11, 2011 at 4:27 PM, Aurelien Jarno <firstname.lastname@example.org> wrote:
> On Fri, Jun 10, 2011 at 03:58:42PM -0700, David Miller wrote:
>> From: Aurelien Jarno <email@example.com>
>> 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
> 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.
> 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 ?<firstname.lastname@example.org>
> ? ? ? ?* elf/dl-runtime.c(_dl_fixup,_dl_profile_fixup): Pass pdl_hwca to
> ? ? ? ?ifuncs.
> ? ? ? ?* elf/dl-sym.c(do_sym): Likewise.
If we want to change generic code, please make it generic. Some targets
may want __environ instead of pdl_hwcap. You should define a macro, like
IFUNC_ARG, which is default to something and each target can override