This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
unwind info for darwin
- From: Andreas Tobler <toa at pop dot agri dot ch>
- To: aph <aph at redhat dot com>, Anthony Green <green at redhat dot com>, java-patches <java-patches at gcc dot gnu dot org>
- Date: Mon, 20 Jan 2003 17:52:41 +0100
- Subject: unwind info for darwin
Attached a patch which adds unwind info to the libffi darwin part.
Running with this patch the libgcj failures will be reduced by about 20.
The patch has been tested on both, 3.3 and trunk.
Could one take over the ci as I don't have cvs access? In case of the
patch being accepted.
Thanks,
Andreas
more fix ups will follow.
2003-01-20 Andreas Tobler <a.tobler@schweiz.ch>
* src/powerpc/darwin.S: Add unwind info.
* src/powerpc/darwin_closure.S: Likewise.
--- gcc/libffi/src/powerpc/darwin.S.orig Sun Jan 19 12:09:10 2003
+++ gcc/libffi/src/powerpc/darwin.S Mon Jan 20 15:33:57 2003
@@ -37,10 +37,13 @@
.text
.align 2
_ffi_call_DARWIN:
- mr r12,r8 // We only need r12 until the call, so it doesn't have to be saved...
+LFB0:
+ mr r12,r8 /* We only need r12 until the call,
+ so it doesn't have to be saved... */
+LFB1:
/* Save the old stack pointer as AP. */
mr r8,r1
-
+LCFI0:
/* Allocate the stack space we need. */
stwux r1,r1,r4
@@ -48,19 +51,24 @@
mflr r9
stw r28,-16(r8)
+LCFI1:
stw r29,-12(r8)
+LCFI2:
stw r30, -8(r8)
+LCFI3:
stw r31, -4(r8)
-
+LCFI4:
stw r9, 8(r8)
+LCFI5:
stw r2, 20(r1)
+LCFI6:
/* Save arguments over call... */
- mr r31,r5 /* flags, */
- mr r30,r6 /* rvalue, */
- mr r29,r7 /* function address, */
- mr r28,r8 /* our AP. */
-
+ mr r31,r5 /* flags, */
+ mr r30,r6 /* rvalue, */
+ mr r29,r7 /* function address, */
+ mr r28,r8 /* our AP. */
+LCFI7:
/* Call ffi_prep_args. */
mr r4,r1
li r9,0
@@ -143,7 +151,8 @@
L(float_return_value):
stfs f1,0(r30)
b L(done_return_value)
-//END(_ffi_call_DARWIN)
+LFE1:
+/* END(_ffi_call_DARWIN) */
/* Provide a null definition of _ffi_call_AIX. */
.text
@@ -153,5 +162,60 @@
.align 2
_ffi_call_AIX:
blr
-//END(_ffi_call_AIX)
+/* END(_ffi_call_AIX) */
+.data
+.section __TEXT,__eh_frame
+Lframe1:
+ .set L$set$0,LECIE1-LSCIE1
+ .long L$set$0 ; Length of Common Information Entry
+LSCIE1:
+ .long 0x0 ; CIE Identifier Tag
+ .byte 0x1 ; CIE Version
+ .ascii "zR\0" ; CIE Augmentation
+ .byte 0x1 ; uleb128 0x1; CIE Code Alignment Factor
+ .byte 0x7c ; sleb128 -4; CIE Data Alignment Factor
+ .byte 0x41 ; CIE RA Column
+ .byte 0x1 ; uleb128 0x1; Augmentation size
+ .byte 0x10 ; FDE Encoding (pcrel)
+ .byte 0xc ; DW_CFA_def_cfa
+ .byte 0x1 ; uleb128 0x1
+ .byte 0x0 ; uleb128 0x0
+ .align 2
+LECIE1:
+LSFDE1:
+ .set L$set$1,LEFDE1-LASFDE1
+ .long L$set$1 ; FDE Length
+LASFDE1:
+ .set L$set$2,LASFDE1-Lframe1
+ .long L$set$2 ; FDE CIE offset
+ .long LFB0-. ; FDE initial location
+ .set L$set$3,LFE1-LFB0
+ .long L$set$3 ; FDE address range
+ .byte 0x4 ; DW_CFA_advance_loc4
+ .set L$set$4,LCFI0-LFB1
+ .long L$set$4
+ .byte 0xd ; DW_CFA_def_cfa_register
+ .byte 0x08 ; uleb128 0x08
+ .byte 0x4 ; DW_CFA_advance_loc4
+ .set L$set$5,LCFI6-LCFI0
+ .long L$set$5
+ .byte 0x11 ; DW_CFA_offset_extended_sf
+ .byte 0x41 ; uleb128 0x41
+ .byte 0x7e ; sleb128 -2
+ .byte 0x9f ; DW_CFA_offset, column 0x1f
+ .byte 0x1 ; uleb128 0x1
+ .byte 0x9e ; DW_CFA_offset, column 0x1e
+ .byte 0x2 ; uleb128 0x2
+ .byte 0x9d ; DW_CFA_offset, column 0x1d
+ .byte 0x3 ; uleb128 0x3
+ .byte 0x9c ; DW_CFA_offset, column 0x1c
+ .byte 0x4 ; uleb128 0x4
+ .byte 0x4 ; DW_CFA_advance_loc4
+ .set L$set$6,LCFI7-LCFI6
+ .long L$set$6
+ .byte 0xd ; DW_CFA_def_cfa_register
+ .byte 0x1c ; uleb128 0x1c
+ .align 2
+LEFDE1:
+
--- gcc/libffi/src/powerpc/darwin_closure.S.orig Sun Jan 19 12:09:10 2003
+++ gcc/libffi/src/powerpc/darwin_closure.S Mon Jan 20 15:32:11 2003
@@ -1,6 +1,6 @@
/* -----------------------------------------------------------------------
- darwin_closures.S - Copyright (c) 2002 Free Software Foundation, Inc.
- based on ppc_closures.S
+ darwin_closure.S - Copyright (c) 2002 2003 Free Software Foundation,
+ Inc. based on ppc_closure.S
PowerPC Assembly glue.
@@ -37,20 +37,20 @@
.text
.align 2
_ffi_closure_ASM:
-
- mflr r0 /* extract return address */
- stw r0, 8(r1) /* save the return address */
-
+LFB1:
+ mflr r0 /* extract return address */
+ stw r0, 8(r1) /* save the return address */
+LCFI0:
/* 24 Bytes (Linkage Area) */
/* 32 Bytes (outgoing parameter area, always reserved) */
/* 104 Bytes (13*8 from FPR) */
/* 4 Bytes (result)
/* 164 Bytes */
- stwu r1,-164(r1) /* skip over caller save area */
-
-/* we want to build up an area for the parameters passed */
-/* in registers (both floating point and integer) */
+ stwu r1,-164(r1) /* skip over caller save area */
+LCFI1:
+ /* we want to build up an area for the parameters passed
+ in registers (both floating point and integer) */
/* we store gpr 3 to gpr 10 (aligned to 4) */
/* in the parents outgoing area */
@@ -111,7 +111,9 @@
lwzx r3,r4,r3 /* get the contents of that table value */
add r3,r3,r4 /* add contents of table to table address */
mtctr r3
- bctr /* jump to it */
+ bctr /* jump to it */
+LFE1:
+ .align 2
.L60:
.long .L44-.L60 /* FFI_TYPE_VOID */
@@ -185,5 +187,49 @@
mtlr r0 /* reset link register */
blr
-/* END(ffi_closure_ASM) */
+/* END(ffi_closure_ASM) */
+
+.data
+.section __TEXT,__eh_frame
+Lframe1:
+ .set L$set$0,LECIE1-LSCIE1
+ .long L$set$0 ; Length of Common Information Entry
+LSCIE1:
+ .long 0x0 ; CIE Identifier Tag
+ .byte 0x1 ; CIE Version
+ .ascii "zR\0" ; CIE Augmentation
+ .byte 0x1 ; uleb128 0x1; CIE Code Alignment Factor
+ .byte 0x7c ; sleb128 -4; CIE Data Alignment Factor
+ .byte 0x41 ; CIE RA Column
+ .byte 0x1 ; uleb128 0x1; Augmentation size
+ .byte 0x10 ; FDE Encoding (pcrel)
+ .byte 0xc ; DW_CFA_def_cfa
+ .byte 0x1 ; uleb128 0x1
+ .byte 0x0 ; uleb128 0x0
+ .align 2
+LECIE1:
+LSFDE1:
+ .set L$set$1,LEFDE1-LASFDE1
+ .long L$set$1 ; FDE Length
+
+LASFDE1:
+ .set L$set$2,LASFDE1-Lframe1
+ .long L$set$2 ; FDE CIE offset
+ .long LFB1-. ; FDE initial location
+ .set L$set$3,LFE1-LFB1
+ .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
+ .long L$set$3
+ .byte 0xe ; DW_CFA_def_cfa_offset
+ .byte 164,1 ; uleb128 164
+ .byte 0x4 ; DW_CFA_advance_loc4
+ .set L$set$4,LCFI0-LFB1
+ .long L$set$4
+ .byte 0x11 ; DW_CFA_offset_extended_sf
+ .byte 0x41 ; uleb128 0x41
+ .byte 0x7e ; sleb128 -2
+ .align 2
+LEFDE1: