This is the mail archive of the
libffi-discuss@sourceware.org
mailing list for the libffi project.
powerpc: Fix ffi_go_closure_linux64
- From: Alan Modra <amodra at gmail dot com>
- To: libffi-discuss at sourceware dot org
- Date: Thu, 20 Nov 2014 12:18:00 +1030
- Subject: powerpc: Fix ffi_go_closure_linux64
- Authentication-results: sourceware.org; auth=none
- References: <20141120014435 dot GH22459 at bubble dot grove dot modra dot org>
Unlike ffi_closure_LINUX64, this entry point is called normally,
so we already have the TOC in R2 and the closure in R11.
* powerpc/linux64_closure.S (ffi_closure_LINUX64): Remove a
register dependency chain.
(ffi_go_closure_linux64): Don't load r11 or r2.
---
src/powerpc/linux64_closure.S | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/src/powerpc/linux64_closure.S b/src/powerpc/linux64_closure.S
index 1364225..6487d2a 100644
--- a/src/powerpc/linux64_closure.S
+++ b/src/powerpc/linux64_closure.S
@@ -101,7 +101,7 @@ ffi_closure_LINUX64:
# else
# copy r2 to r11 and load TOC into r2
mr %r11, %r2
- ld %r2, 16(%r11)
+ ld %r2, 16(%r2)
mflr %r0
# Save general regs into parm save area
@@ -444,10 +444,6 @@ ffi_go_closure_linux64:
# load up the pointer to the parm save area
mr %r7, %r12
# else
- # copy r2 to r11 and load TOC into r2
- mr %r11, %r2
- ld %r2, 16(%r11)
-
mflr %r0
# Save general regs into parm save area
# This is the parameter save area set up by our caller.
--
2.1.0
--
Alan Modra
Australia Development Lab, IBM