From patchwork Fri Mar 9 12:45:24 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Sandoe X-Patchwork-Id: 145714 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id DE4A3B6F9F for ; Fri, 9 Mar 2012 23:45:52 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1331901953; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Cc: Message-Id:From:To:In-Reply-To:Content-Type:Mime-Version:Subject: Date:References:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=D1Sa6PT 5pEQHTBh0RR/ewekB/W8=; b=wI6cy3TZLN2pDIytisihMbfbfhzfDRVCIH8v7/G iJMEApdLU+jGehHZVHzV/+kV5dbd2kcL0Tz3WIpveP+dNJI5WNm7tSXIIcRXVB7T +Dp15liBBIXV23JJiXphAuMdvmIApDTAvUSZ24KD8FunMFN8pyRO477DNVQPN+ZT RMRs= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Cc:Message-Id:From:To:In-Reply-To:Content-Type:Mime-Version:Subject:Date:References:X-Mirapoint-IP-Reputation:X-Junkmail-Premium-Raw:X-Junkmail-Signature-Raw:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=IZVb8qpK7ep+eU1KeujXy6gKW7eJ8S9Lw5xHdwFXkLH3Lx+AFF8San6Diki0Wb 5eZhzY5mOG682rgpBvUPjfppHJoBz9UHMG8/MS7Iwl1mYYDY1GdRbBJPdumcgqjr 0rTf6Ft3wyFtC2Xunl7iw6yxU6F+1e30dPYXe672V1LJg=; Received: (qmail 28210 invoked by alias); 9 Mar 2012 12:45:48 -0000 Received: (qmail 28186 invoked by uid 22791); 9 Mar 2012 12:45:46 -0000 X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, TW_BF X-Spam-Check-By: sourceware.org Received: from c2beaomr06.btconnect.com (HELO mail.btconnect.com) (213.123.26.184) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 09 Mar 2012 12:45:28 +0000 Received: from host86-178-146-215.range86-178.btcentralplus.com (EHLO thor.office) ([86.178.146.215]) by c2beaomr06.btconnect.com with ESMTP id GUL01995; Fri, 09 Mar 2012 12:45:26 +0000 (GMT) Cc: Mike Stump , gcc-patches Patches , libffi-discuss@sourceware.org Message-Id: <32A48973-1E73-41B1-9037-AE857B097952@sandoe-acoustics.co.uk> From: Iain Sandoe To: Anthony Green In-Reply-To: <4F53DC89.7000901@moxielogic.com> Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: [patch, libffi] Sync merge libffi Date: Fri, 9 Mar 2012 12:45:24 +0000 References: <4F53DC89.7000901@moxielogic.com> X-Mirapoint-IP-Reputation: reputation=Fair-1, source=Queried, refid=tid=0001.0A0B0301.4F59FB65.0063, actions=TAG X-Junkmail-Premium-Raw: score=8/50, refid=2.7.2:2012.3.9.121219:17:8.707, ip=86.178.146.215, rules=__MULTIPLE_RCPTS_CC_X2, __HAS_MSGID, __SANE_MSGID, __MSGID_APPLEMAIL, __TO_MALFORMED_2, __CT, __CTYPE_HAS_BOUNDARY, __CTYPE_MULTIPART, CTYPE_MULTIPART_NO_QUOTE, __CTYPE_MULTIPART_MIXED, __MIME_VERSION, __MIME_VERSION_APPLEMAIL, __BOUNCE_CHALLENGE_SUBJ, __BOUNCE_NDR_SUBJ_EXEMPT, __SUBJ_ALPHA_END, __HAS_X_MAILER, __X_MAILER_APPLEMAIL, MIME_LOWER_CASE, TXT_ATTACHED, __STOCK_PHRASE_7, BODYTEXTP_SIZE_3000_LESS, BODY_SIZE_5000_5999, __MIME_TEXT_ONLY, RDNS_GENERIC_POOLED, HTML_00_01, HTML_00_10, RDNS_SUSP_GENERIC, __USER_AGENT_APPLEMAIL, MULTIPLE_RCPTS, RDNS_SUSP, BODY_SIZE_7000_LESS, NO_URI_FOUND, MIME_TEXT_ONLY_MP_MIXED X-Junkmail-Signature-Raw: score=unknown, refid=str=0001.0A0B0202.4F59FB66.004D, ss=1, re=0.000, fgs=0, ip=0.0.0.0, so=2011-07-25 19:15:43, dmn=2011-05-27 18:58:46, mode=multiengine X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org 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 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