[PATCH 00/13] Go closures, libffi, and the static chain
Lynn A. Boger
laboger@linux.vnet.ibm.com
Thu Nov 6 13:10:00 GMT 2014
Aren't there cases where the static chain register is needed? How does
that work if it could be trashed on a plt call?
On 11/06/2014 06:48 AM, Alan Modra wrote:
> On Thu, Nov 06, 2014 at 07:59:16AM +0100, Richard Henderson wrote:
>> I haven't done powerpc yet. If you'd like to help, I'd be delighted.
> I was going to say that it doesn't look too difficult, but then I
> noticed we have a problem. PowerPC uses r11 as the static chain,
> a register that is allowed to be used by linkage stubs.
>
> So any call to a shared libffi will (or may) blow away r11. On ppc32,
> every plt call currently uses r11. On ppc64 ELFv1 most plt calls do
> (in fact r11 is loaded from the third word of the plt function
> descriptor if using a standard plt stub). On ppc64 ELFv2 just the
> lazy plt resolution trashes r11.
>
More information about the Gcc-patches
mailing list