This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH v4] SH FDPIC backend support
- From: Rich Felker <dalias at libc dot org>
- To: Oleg Endo <oleg dot endo at t-online dot de>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 11 Nov 2015 11:41:05 -0500
- Subject: Re: [PATCH v4] SH FDPIC backend support
- Authentication-results: sourceware.org; auth=none
- References: <20151021034138 dot GA4087 at brightrain dot aerifal dot cx> <1445433471 dot 5521 dot 100 dot camel at t-online dot de> <20151021201510 dot GV8645 at brightrain dot aerifal dot cx> <20151023063221 dot GI8645 at brightrain dot aerifal dot cx> <1445783331 dot 8060 dot 3 dot camel at t-online dot de> <20151027024706 dot GU8645 at brightrain dot aerifal dot cx> <1445954499 dot 8060 dot 22 dot camel at t-online dot de> <20151110200700 dot GT3818 at brightrain dot aerifal dot cx> <1447252586 dot 3080 dot 9 dot camel at t-online dot de> <20151111145642 dot GV3818 at brightrain dot aerifal dot cx>
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