This is the mail archive of the libffi-discuss@sourceware.org mailing list for the libffi project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]