From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16391 invoked by alias); 13 Mar 2013 23:14:08 -0000 Received: (qmail 16371 invoked by uid 22791); 13 Mar 2013 23:14:07 -0000 X-SWARE-Spam-Status: No, hits=-3.0 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,TW_GJ X-Spam-Check-By: sourceware.org Received: from toast.topped-with-meat.com (HELO topped-with-meat.com) (204.197.218.159) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 13 Mar 2013 23:14:03 +0000 Received: by topped-with-meat.com (Postfix, from userid 5281) id 492372C09A; Wed, 13 Mar 2013 16:14:03 -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 2/2 roland/arm-sfi-macros] ARM: sfi_sp assembler macro In-Reply-To: Roland McGrath's message of Wednesday, 13 March 2013 16:08:41 -0700 <20130313230841.B880B2C097@topped-with-meat.com> References: <20130313230841.B880B2C097@topped-with-meat.com> Message-Id: <20130313231403.492372C09A@topped-with-meat.com> Date: Wed, 13 Mar 2013 23:14: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=aX0h-Q8-UvQA:10 a=Z6MIti7PxpgA:10 a=kj9zAlcOel0A:10 a=hOe2yjtxAAAA:8 a=okL2i_K5B5cA:10 a=7XSAYUW_rK3ELJ37R0gA:9 a=CjuIK1q_8ugA:10 X-IsSubscribed: yes 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 X-SW-Source: 2013-03/txt/msg00133.txt.bz2 Another requirement of the arm-nacl ABI is that all explicit modifications of sp take a special form. By "explicit" I mean not including push/pop or any [sp...]! forms of loads or stores (or sp! forms of ldm/stm). I haven't yet dealt with the dynamic linker support code, and other than that longjmp is the only place that actually does any such sp modification. See the previous message for pointers to the non-no-op definition of sfi_sp that will be used by the arm-nacl configuration. Thanks, Roland ports/ChangeLog.arm * sysdeps/arm/sysdep.h [!ARM_SFI_MACROS] (sfi_sp): New macro. * sysdeps/arm/__longjmp.S: Use it. --- a/ports/sysdeps/arm/__longjmp.S +++ b/ports/sysdeps/arm/__longjmp.S @@ -36,7 +36,7 @@ ENTRY (__longjmp) cfi_undefined (r4) CHECK_SP (r4) #endif - sfi_breg ip, \ + sfi_sp sfi_breg ip, \ ldmia \B!, JMP_BUF_REGLIST cfi_restore (v1) cfi_restore (v2) --- a/ports/sysdeps/arm/sysdep.h +++ b/ports/sysdeps/arm/sysdep.h @@ -250,6 +250,11 @@ pld [\basereg, \offset] .endm +/* This macro precedes any instruction that directly changes the SP. + It's not needed for push/pop or for any kind of load or store that + implicitly changes the SP via the ! syntax. */ +# define sfi_sp /* Nothing to do. */ + # endif #endif /* __ASSEMBLER__ */