From ae9e5edb6e04667f22f954bb34546f575f41c2dc Mon Sep 17 00:00:00 2001 From: dje Date: Thu, 22 Mar 2012 18:43:00 +0000 Subject: [PATCH] 2012-03-22 David Edelsohn Backport from mainline: 2012-03-09 David Edelsohn * src/powerpc/aix_closure.S (ffi_closure_ASM): Adjust for Darwin64 change to return value of ffi_closure_helper_DARWIN and load type from return type. From Tom Honermann : * src/powerpc/aix.S: Declare .ffi_prep_args. Insert nops after branch instructions. * src/powerpc/aix_closure.S: Declare .ffi_closure_helper_DARWIN. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_7-branch@185706 138bc75d-0d04-0410-961f-82ee72b054a4 --- libffi/ChangeLog | 14 ++++++++++++++ libffi/src/powerpc/aix.S | 6 +++++- libffi/src/powerpc/aix_closure.S | 6 +++++- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/libffi/ChangeLog b/libffi/ChangeLog index bd32b1a65a6..e8d5a69cc27 100644 --- a/libffi/ChangeLog +++ b/libffi/ChangeLog @@ -1,3 +1,17 @@ +2012-03-22 David Edelsohn + + Backport from mainline: + 2012-03-09 David Edelsohn + + * src/powerpc/aix_closure.S (ffi_closure_ASM): Adjust for Darwin64 + change to return value of ffi_closure_helper_DARWIN and load type + from return type. + + From Tom Honermann : + * src/powerpc/aix.S: Declare .ffi_prep_args. Insert nops after + branch instructions. + * src/powerpc/aix_closure.S: Declare .ffi_closure_helper_DARWIN. + 2012-03-22 Release Manager * GCC 4.7.0 released. diff --git a/libffi/src/powerpc/aix.S b/libffi/src/powerpc/aix.S index c6f87644d94..213f2db39de 100644 --- a/libffi/src/powerpc/aix.S +++ b/libffi/src/powerpc/aix.S @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------- - aix.S - Copyright (c) 2002,2009 Free Software Foundation, Inc. + aix.S - Copyright (c) 2002, 2009 Free Software Foundation, Inc. based on darwin.S by John Hornkvist PowerPC Assembly glue. @@ -79,6 +79,8 @@ .set f20,20 .set f21,21 + .extern .ffi_prep_args + #define LIBFFI_ASM #include #include @@ -125,6 +127,7 @@ ffi_call_AIX: /* Call ffi_prep_args. */ mr r4, r1 bl .ffi_prep_args + nop /* Now do the call. */ ld r0, 0(r29) @@ -226,6 +229,7 @@ L(float_return_value): /* Call ffi_prep_args. */ mr r4, r1 bl .ffi_prep_args + nop /* Now do the call. */ lwz r0, 0(r29) diff --git a/libffi/src/powerpc/aix_closure.S b/libffi/src/powerpc/aix_closure.S index 5c74448f2b1..aabd3c3c1ee 100644 --- a/libffi/src/powerpc/aix_closure.S +++ b/libffi/src/powerpc/aix_closure.S @@ -79,6 +79,8 @@ .set f20,20 .set f21,21 + .extern .ffi_closure_helper_DARWIN + #define LIBFFI_ASM #define JUMPTARGET(name) name #define L(x) x @@ -165,6 +167,7 @@ ffi_closure_ASM: /* look up the proper starting point in table */ /* by using return type as offset */ + lhz r3, 10(r3) /* load type from return type */ ld r4, LC..60(2) /* get address of jump table */ sldi r3, r3, 4 /* now multiply return type by 16 */ ld r0, 240+16(r1) /* load return address */ @@ -337,8 +340,9 @@ L..finish: /* look up the proper starting point in table */ /* by using return type as offset */ + lhz r3, 6(r3) /* load type from return type */ lwz r4, LC..60(2) /* get address of jump table */ - slwi r3, r3, 4 /* now multiply return type by 4 */ + slwi r3, r3, 4 /* now multiply return type by 16 */ lwz r0, 176+8(r1) /* load return address */ add r3, r3, r4 /* add contents of table to table address */ mtctr r3 -- 2.11.0