diff mbox

[libffi] Sync merge libffi

Message ID 32A48973-1E73-41B1-9037-AE857B097952@sandoe-acoustics.co.uk
State New
Headers show

Commit Message

Iain Sandoe March 9, 2012, 12:45 p.m. UTC
Hello Anthony,

On 4 Mar 2012, at 21:20, Anthony Green wrote:

> The attached patch includes changes that have been reviewed,  
> approved and merged into the stand-alone libffi release tree**.

This hunk (and an identical change in src/powerpc/darwin.S) ..


.. appear to be incomplete - they change the FDE encoding - without  
changing the way in which the information is provided (and the  
parenthesized portion of the comment is now misleading).

Consequently, unwinding through libffi for m32/m64 powerpc-darwin is  
not working on trunk at present which causes fails in libffi.special/ 
special.exp (and also causes some additional fails for libjava).

===

Reverting the hunks is one possibility;  however the use of indirect- 
pcrel is somewhat out-of-line with what the system compiler produces  
for FDE encoding (although it is the preferred method for personality  
routine encoding)...

... so the following patch modifies the provided data to use just  
pcrel (as per the usual output of the system gcc-4.2.1).

I have tested this on a quad G5 running darwin9
libffi/libjava: \{,-mmacosx-version-min=10.4\}\{-m32,-m64\}

The patch restores libffi/libjava to the pre-merge results.

[one new libffi test - err_bad_abi.c - is also failing on trunk for  
ppc-darwin, but that's to be investigated separately].

Mike, do you know any special reason that indirect-pcrel was being  
used there?

.. or, is this OK for trunk?
Iain


libffi:

	* src/powerpc/darwin_closure.S (EH_FRAME_LABEL): New.
	Remove indirect reference for Lstartcode.  Change comment on FDE
	encoding.  Use amended EH_FRAME_LABEL for CIE offset.
	Adjust initial location to use PCrel, and no indirection.
	* src/powerpc/darwin.S: Likewise.
Index: libffi/src/powerpc/darwin_closure.S
===================================================================
--- libffi/src/powerpc/darwin_closure.S	(revision 185095)
+++ libffi/src/powerpc/darwin_closure.S	(working copy)
@@ -466,14 +466,10 @@ Lendcode:
 /* 176, 400 */
 #define EH_FRAME_OFFSETA MODE_CHOICE(176,0x90)
 #define EH_FRAME_OFFSETB MODE_CHOICE(1,3)
+#define EH_FRAME_LABEL MODE_CHOICE(LEH_frame1,EH_frame1)
 
-	.static_data
-	.align LOG2_GPR_BYTES
-LLFB1$non_lazy_ptr:
-	.g_long Lstartcode
-
 	.section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support
-EH_frame1:
+EH_FRAME_LABEL:
 	.set	L$set$0,LECIE1-LSCIE1
 	.long	L$set$0	; Length of Common Information Entry
 LSCIE1:
@@ -484,7 +480,7 @@ LSCIE1:
 	.byte	EH_DATA_ALIGN_FACT ; sleb128 -4; CIE Data Alignment Factor
 	.byte	0x41	; CIE RA Column
 	.byte	0x1	; uleb128 0x1; Augmentation size
-	.byte	0x10	; FDE Encoding (indirect pcrel)
+	.byte	0x10	; FDE Encoding (pcrel)
 	.byte	0xc	; DW_CFA_def_cfa
 	.byte	0x1	; uleb128 0x1
 	.byte	0x0	; uleb128 0x0
@@ -497,8 +493,8 @@ LSFDE1:
 	.long	L$set$1	; FDE Length
 
 LASFDE1:
-	.long	LASFDE1-EH_frame1	; FDE CIE offset
-	.g_long	LLFB1$non_lazy_ptr-.	; FDE initial location
+	.long	LASFDE1-EH_FRAME_LABEL	; FDE CIE offset
+	.g_long	Lstartcode-.	; FDE initial location
 	.set	L$set$3,LFE1-Lstartcode
 	.g_long	L$set$3	; FDE address range
 	.byte   0x0     ; uleb128 0x0; Augmentation size
Index: libffi/src/powerpc/darwin.S
===================================================================
--- libffi/src/powerpc/darwin.S	(revision 185095)
+++ libffi/src/powerpc/darwin.S	(working copy)
@@ -317,14 +317,10 @@ _ffi_call_AIX:
 /* EH stuff.  */
 
 #define EH_DATA_ALIGN_FACT MODE_CHOICE(0x7c,0x78)
+#define EH_FRAME_LABEL MODE_CHOICE(LEH_frame1,EH_frame1)
 
-	.static_data
-	.align LOG2_GPR_BYTES
-LLFB0$non_lazy_ptr:
-	.g_long Lstartcode
-
 	.section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support
-EH_frame1:
+EH_FRAME_LABEL:
 	.set	L$set$0,LECIE1-LSCIE1
 	.long	L$set$0	; Length of Common Information Entry
 LSCIE1:
@@ -335,7 +331,7 @@ LSCIE1:
 	.byte	EH_DATA_ALIGN_FACT ; sleb128 -4; CIE Data Alignment Factor
 	.byte	0x41	; CIE RA Column
 	.byte	0x1	; uleb128 0x1; Augmentation size
-	.byte	0x10	; FDE Encoding (indirect pcrel)
+	.byte	0x10	; FDE Encoding (pcrel)
 	.byte	0xc	; DW_CFA_def_cfa
 	.byte	0x1	; uleb128 0x1
 	.byte	0x0	; uleb128 0x0
@@ -348,8 +344,8 @@ LSFDE1:
 	.set	L$set$1,LEFDE1-LASFDE1
 	.long	L$set$1	; FDE Length
 LASFDE1:
-	.long	LASFDE1-EH_frame1 ; FDE CIE offset
-	.g_long	LLFB0$non_lazy_ptr-.	; FDE initial location
+	.long	LASFDE1-EH_FRAME_LABEL ; FDE CIE offset
+	.g_long	Lstartcode-.	; FDE initial location
 	.set	L$set$3,LFE1-Lstartcode
 	.g_long	L$set$3	; FDE address range
 	.byte   0x0     ; uleb128 0x0; Augmentation size

Comments

Mike Stump March 9, 2012, 5:06 p.m. UTC | #1
On Mar 9, 2012, at 4:45 AM, Iain Sandoe wrote:
> The patch restores libffi/libjava to the pre-merge results.

> Mike, do you know any special reason that indirect-pcrel was being used there?

Nope.  The gcc repo has all the pointers to people that did all the changes...

> .. or, is this OK for trunk?

Ok from my perspective.
diff mbox

Patch

Index: src/powerpc/darwin_closure.S
===================================================================
--- src/powerpc/darwin_closure.S	(revision 184894)
+++ src/powerpc/darwin_closure.S	(working copy)
@@ -484,7 +484,7 @@ 
  	.byte	EH_DATA_ALIGN_FACT ; sleb128 -4; CIE Data Alignment Factor
  	.byte	0x41	; CIE RA Column
  	.byte	0x1	; uleb128 0x1; Augmentation size
-	.byte	0x90	; FDE Encoding (indirect pcrel)
+	.byte	0x10	; FDE Encoding (indirect pcrel)
  	.byte	0xc	; DW_CFA_def_cfa
  	.byte	0x1	; uleb128 0x1
  	.byte	0x0	; uleb128 0x0