This is the mail archive of the
libffi-discuss@sourceware.org
mailing list for the libffi project.
Re: [PATCH 00/13] Go closures, libffi, and the static chain
- From: Alan Modra <amodra at gmail dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: "Lynn A. Boger" <laboger at linux dot vnet dot ibm dot com>, gcc-patches at gcc dot gnu dot org, libffi-discuss at sourceware dot org, gofrontend-dev at googlegroups dot com
- Date: Thu, 6 Nov 2014 23:18:38 +1030
- Subject: Re: [PATCH 00/13] Go closures, libffi, and the static chain
- Authentication-results: sourceware.org; auth=none
- References: <1412973773-3942-1-git-send-email-rth at redhat dot com> <545A97BA dot 3030507 at linux dot vnet dot ibm dot com> <545B1C44 dot 3000306 at redhat dot com>
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