On Wed, Nov 11, 2015 at 09:56:42AM -0500, Rich Felker wrote: > > > I'm actually > > > trying to prepare a simpler FDPIC patch for other gcc versions we're > > > interested in that's not so invasive, and for now I'm just having > > > function_symbol replace SFUNC_STATIC with SFUNC_GOT on TARGET_FDPIC > > > to > > > avoid needing all the label stuff, but it would be nice to find a way > > > to reuse the existing framework. > > > > Do you know how this affects code size (and inherently performance)? > > I suspect it makes very little difference, but to compare I'd need to > do the same hack on 5.2.0 or trunk. The only difference should be one > additional load per call, and one additional GOT slot per function > called this way (but just once per executable/library).
Actually I think this is not quite right: if the call takes place via the GOT, this also requires the initial r12 to be preserved somewhere in order to load the function address, whereas for SFUNC_STATIC, the initial r12 can be completely discarded, right? (SFUNC functions are not permitted to use the GOT themselves as far as I can tell, and thus do not receive the hidden GOT argument in r12.) Rich