On Wed, Aug 24, 2016 at 10:14:29AM +0930, Alan Modra wrote: > Given a hidden visibility function declaration, the toolchain can say > that the function is local to the module. This generally means that a > call to the function can be direct, ie. doesn't need to go via the PLT > even in a shared library. However, ifunc breaks this promise. GNU > indirect functions may resolve non-locally, and are implemented by > always using a PLT call. > > This causes trouble for targets like ppc32 where the -msecure-plt PIC > PLT call stub needs a valid GOT pointer. Any call that potentially > might be to an ifunc therefore requires a GOT pointer, and can't be a > sibling call (because the GOT pointer on ppc32 is a caller saved reg). > > So unless we require that all ifuncs are declared as ifunc, it seems > that ppc32 can't assume extern or weak functions are local. This > patch does the latter. Boostrapped and regression tested > powerpc64-linux biarch. OK to apply?
Okay for trunk. (Unless "boostrapped" means that it failed horribly ;-) ) > diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md > index 58dccdd..07e79ab 100644 > --- a/gcc/config/rs6000/rs6000.md > +++ b/gcc/config/rs6000/rs6000.md > @@ -10278,8 +10278,10 @@ This doesn't show what pattern this is. If you make a ".gitattributes" somewhere in your tree (I have it in the gcc/ subdir), containing *.md diff=md and then in your git config (say, in .git/config in the GCC source tree) you have [diff "md"] xfuncname = "^\\(define.*$" then magic happens. Cheers, Segher