This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] S/390: Fix two issues with the IFUNC optimized mem* routines
On Thu, Aug 30, 2012 at 12:22 AM, Andreas Krebbel
<krebbel@linux.vnet.ibm.com> wrote:
> On 29/08/12 18:52, David Miller wrote:
>> From: Andreas Krebbel <krebbel@linux.vnet.ibm.com>
>> Date: Wed, 29 Aug 2012 17:45:52 +0200
>>
>>> The point is that if it is not known at compile time that the symbol
>>> will resolve locally the compiler generates an GOT access which for
>>> a DSO cannot be completed at final link.
>>
>> If the symbol is hidden or protected, it can.
>
> Sure. And this actually would make my fix much simpler :) The downside then is that we depend on a
> compiler optimization to make it actually work.
That is what x86 IFUNC has been doing from day one.
>> The linker has to optimize the GOT reference into a relative reloc if
>> you want IFUNC to work properly, sparc does this as does x86.
>
> It would only work if ld would be able to get rid of the runtime relocations entirely. In order to
> do this ld would need to rewrite the code accessing the GOT slots to use pc or got relative
> addressing. Interesting, but I don't think x86 is already doing this. At least ld didn't in the
> testcase I'm discussing with H.J.Lu.
>
I have no plan to edit code sequence for this.
--
H.J.