From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29179 invoked by alias); 19 Apr 2013 20:58:42 -0000 Mailing-List: contact libc-ports-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: libc-ports-owner@sourceware.org Received: (qmail 29165 invoked by uid 89); 19 Apr 2013 20:58:42 -0000 X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,TW_FN autolearn=ham version=3.3.1 Received: from toast.topped-with-meat.com (HELO topped-with-meat.com) (204.197.218.159) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Fri, 19 Apr 2013 20:58:40 +0000 Received: by topped-with-meat.com (Postfix, from userid 5281) id DEFE82C08A; Fri, 19 Apr 2013 13:58:38 -0700 (PDT) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit From: Roland McGrath To: Joseph Myers Cc: libc-ports@sourceware.org Subject: [PATCH roland/arm-unwind-macros] ARM: Macroize assembly use of EABI unwind directives. Message-Id: <20130419205838.DEFE82C08A@topped-with-meat.com> Date: Fri, 19 Apr 2013 20:58:00 -0000 X-CMAE-Score: 0 X-CMAE-Analysis: v=2.1 cv=LYSvtFvi c=1 sm=1 tr=0 a=WkljmVdYkabdwxfqvArNOQ==:117 a=14OXPxybAAAA:8 a=WgSMOmvwhhAA:10 a=Z6MIti7PxpgA:10 a=kj9zAlcOel0A:10 a=hOe2yjtxAAAA:8 a=NPgX4mrZ0hkA:10 a=zSSv0n2AZ4gZy5MzFFgA:9 a=qGqqMBmKKi5BFkXM:21 a=gFvb93_7fs2YzP_g:21 a=CjuIK1q_8ugA:10 X-SW-Source: 2013-04/txt/msg00094.txt.bz2 In a configuration that does not use EABI unwind info, using the directives for it anywhere causes link-time references to magic symbols that such a configuration's libgcc won't necessarily define. (I haven't changed the uses in .../linux/arm/ files because there is no configuration planned using those files that doesn't use EABI unwind info.) Tested on armv7l-linux-gnueabihf that compiled code was unchanged by the patch. Thanks, Roland ports/ChangeLog.arm 2013-04-19 Roland McGrath * sysdeps/arm/sysdep.h (eabi_fnstart, eabi_fnend, eabi_save, eabi_cantunwind, eabi_pad): New macros. * sysdeps/arm/dl-tlsdesc.S: Use them. --- a/ports/sysdeps/arm/dl-tlsdesc.S +++ b/ports/sysdeps/arm/dl-tlsdesc.S @@ -29,13 +29,13 @@ .global _dl_tlsdesc_return .type _dl_tlsdesc_return,#function cfi_startproc - .fnstart + eabi_fnstart .align 2 _dl_tlsdesc_return: sfi_breg r0, \ ldr r0, [\B] BX (lr) - .fnend + eabi_fnend cfi_endproc .size _dl_tlsdesc_return, .-_dl_tlsdesc_return @@ -43,14 +43,14 @@ _dl_tlsdesc_return: .global _dl_tlsdesc_undefweak .type _dl_tlsdesc_undefweak,#function cfi_startproc - .fnstart + eabi_fnstart .align 2 _dl_tlsdesc_undefweak: GET_TLS (r1) rsb r0, r0, #0 BX (lr) cfi_endproc - .fnend + eabi_fnend .size _dl_tlsdesc_undefweak, .-_dl_tlsdesc_undefweak #ifdef SHARED @@ -80,12 +80,12 @@ _dl_tlsdesc_dynamic(struct tlsdesc *tdp) */ cfi_startproc - .fnstart + eabi_fnstart .align 2 _dl_tlsdesc_dynamic: /* Our calling convention is to clobber r0, r1 and the processor flags. All others that are modified must be saved */ - .save {r2,r3,r4,lr} + eabi_save ({r2,r3,r4,lr}) push {r2,r3,r4,lr} cfi_adjust_cfa_offset (16) cfi_rel_offset (r2,0) @@ -135,7 +135,7 @@ _dl_tlsdesc_dynamic: #else pop {r2,r3,r4, pc} #endif - .fnend + eabi_fnend cfi_endproc .size _dl_tlsdesc_dynamic, .-_dl_tlsdesc_dynamic #endif /* SHARED */ @@ -145,7 +145,7 @@ _dl_tlsdesc_dynamic: .global _dl_tlsdesc_lazy_resolver .type _dl_tlsdesc_lazy_resolver,#function cfi_startproc - .fnstart + eabi_fnstart .align 2 _dl_tlsdesc_lazy_resolver: /* r0 points at the tlsdesc, @@ -155,10 +155,10 @@ _dl_tlsdesc_lazy_resolver: We push the remaining call-clobbered registers here, and also R1 -- to keep the stack correctly aligned. */ /* Tell the unwinder that r2 has already been pushed. */ - .save {r2} + eabi_save ({r2}) cfi_adjust_cfa_offset (4) cfi_rel_offset (r2, 0) - .save {r0,r1,r3,ip,lr} + eabi_save ({r0,r1,r3,ip,lr}) push {r0, r1, r3, ip, lr} cfi_adjust_cfa_offset (20) cfi_rel_offset (r0, 0) @@ -180,7 +180,7 @@ _dl_tlsdesc_lazy_resolver: sfi_breg r0, \ ldr r1, [\B, #4] BX (r1) - .fnend + eabi_fnend cfi_endproc .size _dl_tlsdesc_lazy_resolver, .-_dl_tlsdesc_lazy_resolver @@ -190,14 +190,14 @@ _dl_tlsdesc_lazy_resolver: .global _dl_tlsdesc_resolve_hold .type _dl_tlsdesc_resolve_hold,#function cfi_startproc - .fnstart + eabi_fnstart .align 2 _dl_tlsdesc_resolve_hold: /* Tell the unwinder that r2 has already been pushed. */ - .save {r2} + eabi_save ({r2}) cfi_adjust_cfa_offset (4) cfi_rel_offset (r2, 0) - .save {r0,r1,r3,ip,lr} + eabi_save ({r0,r1,r3,ip,lr}) push {r0, r1, r3, ip, lr} cfi_adjust_cfa_offset (20) cfi_rel_offset (r0, 0) @@ -220,6 +220,6 @@ _dl_tlsdesc_resolve_hold: sfi_breg r0, \ ldr r1, [\B, #4] BX (r1) - .fnend + eabi_fnend cfi_endproc .size _dl_tlsdesc_resolve_hold, .-_dl_tlsdesc_resolve_hold --- a/ports/sysdeps/arm/sysdep.h +++ b/ports/sysdeps/arm/sysdep.h @@ -257,6 +257,15 @@ # endif +/* These are the directives used for EABI unwind info. + Wrap them in macros so another configuration's sysdep.h + file can define them away if it doesn't use EABI unwind info. */ +# define eabi_fnstart .fnstart +# define eabi_fnend .fnend +# define eabi_save(...) .save __VA_ARGS__ +# define eabi_cantunwind .cantunwind +# define eabi_pad(n) .pad n + #endif /* __ASSEMBLER__ */ /* This number is the offset from the pc at the current location. */