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]

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.
---
 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


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