Commit 590663b30b1f35b6136cf55d8870a2394ed78c21

Richard Henderson 2014-11-18T12:56:58

powerpc: Fix ffi_go_closure_linux64 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.

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.