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 Thu, Aug 30, 2012 at 06:09:36AM -0700, H.J. Lu wrote:
> 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.

There are two issues on x64 I think about but don't exactly know how indirect
functions fit.
First is that scheduling on atom is different from rest and recompling
with march=atom helps. 
Second is avx. There is 70 instruction penalty of switching sse/avx. gcc
with suitable flag encodes sse instruction(even assembly) with VEX
prefix. But it also should be enforced globaly.
> 
> 
> 
> -- 
> H.J.

-- 

Domain controller not responding


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