From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9182 invoked by alias); 13 Mar 2013 19:42:02 -0000 Received: (qmail 8917 invoked by uid 22791); 13 Mar 2013 19:42:00 -0000 X-SWARE-Spam-Status: No, hits=-3.0 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,TW_CP 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 19:41:54 +0000 Received: by topped-with-meat.com (Postfix, from userid 5281) id B5A412C075; Wed, 13 Mar 2013 12:41:52 -0700 (PDT) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit From: Roland McGrath To: "Joseph S. Myers" Cc: Subject: Re: [PATCH roland/arm-avoid-pc] ARM_BX_ALIGN_LOG2 In-Reply-To: Joseph S. Myers's message of Tuesday, 12 March 2013 23:40:16 +0000 References: <20130311205410.2A99B2C08D@topped-with-meat.com> <20130311205518.977F12C08D@topped-with-meat.com> Message-Id: <20130313194152.B5A412C075@topped-with-meat.com> Date: Wed, 13 Mar 2013 19:42: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=nOFskwaZkdMA:10 a=Z6MIti7PxpgA:10 a=kj9zAlcOel0A:10 a=hOe2yjtxAAAA:8 a=CrvMqtIY61UA:10 a=SoB2jSF6CnBbh3uipN8A: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/msg00131.txt.bz2 > The comment should say that this should only be used in ARM-mode code > (certainly this definition doesn't make sense by default for code built as > Thumb). OK with that change. Well, it makes some sense for any situation doing something like what the memcpy code is doing (i.e. arithmetically computing branch targets, which implicitly assumes fixed distance between them). Unless one were completely sure that each Thumb instruction would always have a short encoding, then you'd need to explicitly align each one to four. I've committed it with the following comment. Feel free to adjust it further as you see fit. Thanks, Roland /* The log2 of the minimum alignment required for an address that is the target of a computed branch (i.e. a "bx" instruction). A more-specific arm-features.h file may define this to set a more stringent requirement. Using this only makes sense for code in ARM mode (where instructions always have a fixed size of four bytes), or for Thumb-mode code that is specifically aligning all the related branch targets to match (since Thumb instructions might be either two or four bytes). */