[PATCH 00/13] Go closures, libffi, and the static chain

Alan Modra amodra@gmail.com
Thu Nov 6 12:48:00 GMT 2014


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.

-- 
Alan Modra
Australia Development Lab, IBM



More information about the Libffi-discuss mailing list