From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9115 invoked by alias); 7 Nov 2014 15:31:07 -0000 Mailing-List: contact libffi-discuss-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libffi-discuss-owner@sourceware.org Received: (qmail 9055 invoked by uid 89); 7 Nov 2014 15:31:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-wi0-f181.google.com Received: from mail-wi0-f181.google.com (HELO mail-wi0-f181.google.com) (209.85.212.181) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Fri, 07 Nov 2014 15:31:00 +0000 Received: by mail-wi0-f181.google.com with SMTP id n3so4925072wiv.14 for ; Fri, 07 Nov 2014 07:30:57 -0800 (PST) X-Received: by 10.180.39.65 with SMTP id n1mr6109527wik.13.1415374257347; Fri, 07 Nov 2014 07:30:57 -0800 (PST) Received: from pike.twiddle.home.com ([87.111.149.167]) by mx.google.com with ESMTPSA id p1sm12186731wjy.22.2014.11.07.07.30.56 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 Nov 2014 07:30:56 -0800 (PST) From: Richard Henderson To: libffi-discuss@sourceware.org Subject: [PATCH 04/13] x86: Convert to gas generated unwind info Date: Fri, 07 Nov 2014 15:31:00 -0000 Message-Id: <1415374240-1792-5-git-send-email-rth@twiddle.net> In-Reply-To: <1415374240-1792-1-git-send-email-rth@twiddle.net> References: <1415374240-1792-1-git-send-email-rth@twiddle.net> X-SW-Source: 2014/txt/msg00193.txt.bz2 --- src/x86/sysv.S | 173 +++++++-------------------------------------------------- 1 file changed, 20 insertions(+), 153 deletions(-) diff --git a/src/x86/sysv.S b/src/x86/sysv.S index 3bd5477..fd13bc0 100644 --- a/src/x86/sysv.S +++ b/src/x86/sysv.S @@ -30,6 +30,7 @@ #define LIBFFI_ASM #include #include +#include .text @@ -40,11 +41,12 @@ .type ffi_call_SYSV,@function ffi_call_SYSV: -.LFB1: + cfi_startproc pushl %ebp -.LCFI0: + cfi_adjust_cfa_offset(4) + cfi_rel_offset(%ebp, 0) movl %esp,%ebp -.LCFI1: + cfi_def_cfa_register(%ebp) /* Make room for all of the new args. */ movl 16(%ebp),%ecx subl %ecx,%esp @@ -163,7 +165,7 @@ epilogue: movl %ebp,%esp popl %ebp ret -.LFE1: + cfi_endproc .ffi_call_SYSV_end: .size ffi_call_SYSV,.ffi_call_SYSV_end-ffi_call_SYSV @@ -173,11 +175,12 @@ FFI_HIDDEN (ffi_closure_SYSV) .type ffi_closure_SYSV, @function ffi_closure_SYSV: -.LFB2: + cfi_startproc pushl %ebp -.LCFI2: + cfi_adjust_cfa_offset(4) + cfi_rel_offset(%ebp, 0) movl %esp, %ebp -.LCFI3: + cfi_def_cfa_register(%ebp) subl $40, %esp leal -24(%ebp), %edx movl %edx, -12(%ebp) /* resp */ @@ -199,12 +202,13 @@ ffi_closure_SYSV: call ffi_closure_SYSV_inner #else movl %ebx, 8(%esp) -.LCFI7: + cfi_offset(%ebx, -40) call 1f 1: popl %ebx addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %ebx call ffi_closure_SYSV_inner@PLT movl 8(%esp), %ebx + cfi_restore(%ebx) #endif movl -12(%ebp), %ecx cmpl $FFI_TYPE_INT, %eax @@ -251,7 +255,7 @@ ffi_closure_SYSV: movl %ebp, %esp popl %ebp ret $4 -.LFE2: + cfi_endproc .size ffi_closure_SYSV, .-ffi_closure_SYSV #if !FFI_NO_RAW_API @@ -278,13 +282,14 @@ FFI_HIDDEN (ffi_closure_raw_SYSV) .type ffi_closure_raw_SYSV, @function ffi_closure_raw_SYSV: -.LFB3: + cfi_startproc pushl %ebp -.LCFI4: + cfi_adjust_cfa_offset(4) + cfi_rel_offset(%ebp, 0) movl %esp, %ebp -.LCFI5: + cfi_def_cfa_register(%ebp) pushl %esi -.LCFI6: + cfi_offset(%esi, -12) subl $36, %esp movl RAW_CLOSURE_CIF_OFFSET(%eax), %esi /* closure->cif */ movl RAW_CLOSURE_USER_DATA_OFFSET(%eax), %edx /* closure->user_data */ @@ -335,149 +340,11 @@ ffi_closure_raw_SYSV: movl -24(%ebp), %eax movl -20(%ebp), %edx jmp .Lrcls_epilogue -.LFE3: + cfi_endproc .size ffi_closure_raw_SYSV, .-ffi_closure_raw_SYSV -#endif - -#if defined __GNUC__ -/* Only emit dwarf unwind info when building with GNU toolchain. */ - -#if defined __PIC__ -# if defined __sun__ && defined __svr4__ -/* 32-bit Solaris 2/x86 uses datarel encoding for PIC. GNU ld before 2.22 - doesn't correctly sort .eh_frame_hdr with mixed encodings, so match this. */ -# define FDE_ENCODING 0x30 /* datarel */ -# define FDE_ENCODE(X) X@GOTOFF -# else -# define FDE_ENCODING 0x1b /* pcrel sdata4 */ -# if defined HAVE_AS_X86_PCREL -# define FDE_ENCODE(X) X-. -# else -# define FDE_ENCODE(X) X@rel -# endif -# endif -#else -# define FDE_ENCODING 0 /* absolute */ -# define FDE_ENCODE(X) X -#endif - - .section .eh_frame,EH_FRAME_FLAGS,@progbits -.Lframe1: - .long .LECIE1-.LSCIE1 /* Length of Common Information Entry */ -.LSCIE1: - .long 0x0 /* CIE Identifier Tag */ - .byte 0x1 /* CIE Version */ -#ifdef HAVE_AS_ASCII_PSEUDO_OP -#ifdef __PIC__ - .ascii "zR\0" /* CIE Augmentation */ -#else - .ascii "\0" /* CIE Augmentation */ -#endif -#elif defined HAVE_AS_STRING_PSEUDO_OP -#ifdef __PIC__ - .string "zR" /* CIE Augmentation */ -#else - .string "" /* CIE Augmentation */ -#endif -#else -#error missing .ascii/.string -#endif - .byte 0x1 /* .uleb128 0x1; CIE Code Alignment Factor */ - .byte 0x7c /* .sleb128 -4; CIE Data Alignment Factor */ - .byte 0x8 /* CIE RA Column */ -#ifdef __PIC__ - .byte 0x1 /* .uleb128 0x1; Augmentation size */ - .byte FDE_ENCODING -#endif - .byte 0xc /* DW_CFA_def_cfa */ - .byte 0x4 /* .uleb128 0x4 */ - .byte 0x4 /* .uleb128 0x4 */ - .byte 0x88 /* DW_CFA_offset, column 0x8 */ - .byte 0x1 /* .uleb128 0x1 */ - .align 4 -.LECIE1: -.LSFDE1: - .long .LEFDE1-.LASFDE1 /* FDE Length */ -.LASFDE1: - .long .LASFDE1-.Lframe1 /* FDE CIE offset */ - .long FDE_ENCODE(.LFB1) /* FDE initial location */ - .long .LFE1-.LFB1 /* FDE address range */ -#ifdef __PIC__ - .byte 0x0 /* .uleb128 0x0; Augmentation size */ -#endif - .byte 0x4 /* DW_CFA_advance_loc4 */ - .long .LCFI0-.LFB1 - .byte 0xe /* DW_CFA_def_cfa_offset */ - .byte 0x8 /* .uleb128 0x8 */ - .byte 0x85 /* DW_CFA_offset, column 0x5 */ - .byte 0x2 /* .uleb128 0x2 */ - .byte 0x4 /* DW_CFA_advance_loc4 */ - .long .LCFI1-.LCFI0 - .byte 0xd /* DW_CFA_def_cfa_register */ - .byte 0x5 /* .uleb128 0x5 */ - .align 4 -.LEFDE1: -.LSFDE2: - .long .LEFDE2-.LASFDE2 /* FDE Length */ -.LASFDE2: - .long .LASFDE2-.Lframe1 /* FDE CIE offset */ - .long FDE_ENCODE(.LFB2) /* FDE initial location */ - .long .LFE2-.LFB2 /* FDE address range */ -#ifdef __PIC__ - .byte 0x0 /* .uleb128 0x0; Augmentation size */ -#endif - .byte 0x4 /* DW_CFA_advance_loc4 */ - .long .LCFI2-.LFB2 - .byte 0xe /* DW_CFA_def_cfa_offset */ - .byte 0x8 /* .uleb128 0x8 */ - .byte 0x85 /* DW_CFA_offset, column 0x5 */ - .byte 0x2 /* .uleb128 0x2 */ - .byte 0x4 /* DW_CFA_advance_loc4 */ - .long .LCFI3-.LCFI2 - .byte 0xd /* DW_CFA_def_cfa_register */ - .byte 0x5 /* .uleb128 0x5 */ -#if !defined HAVE_HIDDEN_VISIBILITY_ATTRIBUTE && defined __PIC__ - .byte 0x4 /* DW_CFA_advance_loc4 */ - .long .LCFI7-.LCFI3 - .byte 0x83 /* DW_CFA_offset, column 0x3 */ - .byte 0xa /* .uleb128 0xa */ -#endif - .align 4 -.LEFDE2: - -#if !FFI_NO_RAW_API - -.LSFDE3: - .long .LEFDE3-.LASFDE3 /* FDE Length */ -.LASFDE3: - .long .LASFDE3-.Lframe1 /* FDE CIE offset */ - .long FDE_ENCODE(.LFB3) /* FDE initial location */ - .long .LFE3-.LFB3 /* FDE address range */ -#ifdef __PIC__ - .byte 0x0 /* .uleb128 0x0; Augmentation size */ -#endif - .byte 0x4 /* DW_CFA_advance_loc4 */ - .long .LCFI4-.LFB3 - .byte 0xe /* DW_CFA_def_cfa_offset */ - .byte 0x8 /* .uleb128 0x8 */ - .byte 0x85 /* DW_CFA_offset, column 0x5 */ - .byte 0x2 /* .uleb128 0x2 */ - .byte 0x4 /* DW_CFA_advance_loc4 */ - .long .LCFI5-.LCFI4 - .byte 0xd /* DW_CFA_def_cfa_register */ - .byte 0x5 /* .uleb128 0x5 */ - .byte 0x4 /* DW_CFA_advance_loc4 */ - .long .LCFI6-.LCFI5 - .byte 0x86 /* DW_CFA_offset, column 0x6 */ - .byte 0x3 /* .uleb128 0x3 */ - .align 4 -.LEFDE3: - -#endif -#endif +#endif /* !FFI_NO_RAW_API */ #endif /* ifndef __x86_64__ */ - #if defined __ELF__ && defined __linux__ .section .note.GNU-stack,"",@progbits #endif -- 1.9.3