From 1488177afef2bf1a40d9a5c041465d3a603402c9 Mon Sep 17 00:00:00 2001 From: Mike Stump Date: Thu, 24 Mar 2005 00:45:38 +0000 Subject: darwin.S: Update for -m64 multilib. * src/powerpc/darwin.S: Update for -m64 multilib. * src/powerpc/darwin_closure.S: Likewise. From-SVN: r96967 --- libffi/ChangeLog | 5 +++++ libffi/src/powerpc/darwin.S | 22 ++++++++++++++------ libffi/src/powerpc/darwin_closure.S | 41 ++++++++++++++++++++++++------------- 3 files changed, 48 insertions(+), 20 deletions(-) (limited to 'libffi') diff --git a/libffi/ChangeLog b/libffi/ChangeLog index 88dc958..fa801d1 100644 --- a/libffi/ChangeLog +++ b/libffi/ChangeLog @@ -1,3 +1,8 @@ +2005-03-23 Mike Stump + + * src/powerpc/darwin.S: Update for -m64 multilib. + * src/powerpc/darwin_closure.S: Likewise. + 2005-03-21 Zack Weinberg * configure.ac: Do not invoke TL_AC_GCC_VERSION. diff --git a/libffi/src/powerpc/darwin.S b/libffi/src/powerpc/darwin.S index b608e9c..d8a1df5 100644 --- a/libffi/src/powerpc/darwin.S +++ b/libffi/src/powerpc/darwin.S @@ -24,6 +24,16 @@ OTHER DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ +#if defined(__ppc64__) +#define MODE_CHOICE(x, y) y +#else +#define MODE_CHOICE(x, y) x +#endif + +#define g_long MODE_CHOICE(long, quad) /* usage is ".g_long" */ + +#define LOG2_GPR_BYTES MODE_CHOICE(2,3) /* log2(GPR_BYTES) */ + #define LIBFFI_ASM #include #include @@ -190,7 +200,7 @@ LSCIE1: .byte 0xc ; DW_CFA_def_cfa .byte 0x1 ; uleb128 0x1 .byte 0x0 ; uleb128 0x0 - .align 2 + .align LOG2_GPR_BYTES LECIE1: .globl _ffi_call_DARWIN.eh _ffi_call_DARWIN.eh: @@ -199,9 +209,9 @@ LSFDE1: .long L$set$1 ; FDE Length LASFDE1: .long LASFDE1-EH_frame1 ; FDE CIE offset - .long LLFB0$non_lazy_ptr-. ; FDE initial location + .g_long LLFB0$non_lazy_ptr-. ; FDE initial location .set L$set$3,LFE1-LFB0 - .long L$set$3 ; FDE address range + .g_long L$set$3 ; FDE address range .byte 0x0 ; uleb128 0x0; Augmentation size .byte 0x4 ; DW_CFA_advance_loc4 .set L$set$4,LCFI0-LFB1 @@ -227,9 +237,9 @@ LASFDE1: .long L$set$6 .byte 0xd ; DW_CFA_def_cfa_register .byte 0x1c ; uleb128 0x1c - .align 2 + .align LOG2_GPR_BYTES LEFDE1: .data - .align 2 + .align LOG2_GPR_BYTES LLFB0$non_lazy_ptr: - .long LFB0 + .g_long LFB0 diff --git a/libffi/src/powerpc/darwin_closure.S b/libffi/src/powerpc/darwin_closure.S index 272278b..7959838 100644 --- a/libffi/src/powerpc/darwin_closure.S +++ b/libffi/src/powerpc/darwin_closure.S @@ -27,13 +27,25 @@ #define LIBFFI_ASM #define L(x) x +#if defined(__ppc64__) +#define MODE_CHOICE(x, y) y +#else +#define MODE_CHOICE(x, y) x +#endif + +#define lgu MODE_CHOICE(lwzu, ldu) + +#define g_long MODE_CHOICE(long, quad) /* usage is ".g_long" */ + +#define LOG2_GPR_BYTES MODE_CHOICE(2,3) /* log2(GPR_BYTES) */ + .file "darwin_closure.S" .text - .align 2 + .align LOG2_GPR_BYTES .globl _ffi_closure_ASM .text - .align 2 + .align LOG2_GPR_BYTES _ffi_closure_ASM: LFB1: mflr r0 /* extract return address */ @@ -234,7 +246,7 @@ Lfinish: /* END(ffi_closure_ASM) */ .data -.section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms +.section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support EH_frame1: .set L$set$0,LECIE1-LSCIE1 .long L$set$0 ; Length of Common Information Entry @@ -250,7 +262,7 @@ LSCIE1: .byte 0xc ; DW_CFA_def_cfa .byte 0x1 ; uleb128 0x1 .byte 0x0 ; uleb128 0x0 - .align 2 + .align LOG2_GPR_BYTES LECIE1: .globl _ffi_closure_ASM.eh _ffi_closure_ASM.eh: @@ -260,9 +272,9 @@ LSFDE1: LASFDE1: .long LASFDE1-EH_frame1 ; FDE CIE offset - .long LLFB1$non_lazy_ptr-. ; FDE initial location + .g_long LLFB1$non_lazy_ptr-. ; FDE initial location .set L$set$3,LFE1-LFB1 - .long L$set$3 ; FDE address range + .g_long L$set$3 ; FDE address range .byte 0x0 ; uleb128 0x0; Augmentation size .byte 0x4 ; DW_CFA_advance_loc4 .set L$set$3,LCFI1-LCFI0 @@ -275,14 +287,15 @@ LASFDE1: .byte 0x11 ; DW_CFA_offset_extended_sf .byte 0x41 ; uleb128 0x41 .byte 0x7e ; sleb128 -2 - .align 2 + .align LOG2_GPR_BYTES LEFDE1: .data - .align 2 + .align LOG2_GPR_BYTES LDFCM0: .section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32 - .align 2 + .align LOG2_GPR_BYTES Lffi_closure_helper_DARWIN$stub: +#if 1 .indirect_symbol _ffi_closure_helper_DARWIN mflr r0 bcl 20,31,LO$ffi_closure_helper_DARWIN @@ -290,15 +303,15 @@ LO$ffi_closure_helper_DARWIN: mflr r11 addis r11,r11,ha16(L_ffi_closure_helper_DARWIN$lazy_ptr - LO$ffi_closure_helper_DARWIN) mtlr r0 - lwzu r12,lo16(L_ffi_closure_helper_DARWIN$lazy_ptr - LO$ffi_closure_helper_DARWIN)(r11) + lgu r12,lo16(L_ffi_closure_helper_DARWIN$lazy_ptr - LO$ffi_closure_helper_DARWIN)(r11) mtctr r12 bctr -.data .lazy_symbol_pointer L_ffi_closure_helper_DARWIN$lazy_ptr: .indirect_symbol _ffi_closure_helper_DARWIN - .long dyld_stub_binding_helper + .g_long dyld_stub_binding_helper +#endif .data - .align 2 + .align LOG2_GPR_BYTES LLFB1$non_lazy_ptr: - .long LFB1 + .g_long LFB1 -- cgit v1.1