This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] S/390: Fix two issues with the IFUNC optimized mem* routines


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.

> 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.

Bye,

-Andreas-


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]