From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18643 invoked by alias); 12 Aug 2010 11:49:27 -0000 Received: (qmail 18630 invoked by uid 22791); 12 Aug 2010 11:49:26 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 12 Aug 2010 11:49:21 +0000 Received: (qmail 22023 invoked from network); 12 Aug 2010 11:49:19 -0000 Received: from unknown (HELO qiyaows) (yao@127.0.0.2) by mail.codesourcery.com with ESMTPA; 12 Aug 2010 11:49:19 -0000 Date: Thu, 12 Aug 2010 11:49:00 -0000 From: Yao Qi To: gdb-patches@sourceware.org Subject: Re: [PATCH,Testsuite] Add .align 2 for labels on Thumb Message-ID: <20100812114907.GB24769@qiyaows> References: <20100812081814.GA24769@qiyaows> <201008120935.o7C9Zpid015638@glazunov.sibelius.xs4all.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201008120935.o7C9Zpid015638@glazunov.sibelius.xs4all.nl> User-Agent: Mutt/1.5.20 (2009-06-14) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-08/txt/msg00172.txt.bz2 On Thu, Aug 12, 2010 at 11:35:51AM +0200, Mark Kettenis wrote: > > Date: Thu, 12 Aug 2010 16:18:14 +0800 > > From: Yao Qi > > Content-Disposition: inline > > > > We find test failures in gdb.dwarf2/dw2-ref-missing-frame.exp when > > test cases are compiled as thumb. > > https://bugs.launchpad.net/gdb-linaro/+bug/615997 > > > > In dw2-ref-missing-frame-func.c, it is assumed that address of label > > 'func_loopfb_start' is equal to address of function func_loopfb. > > However, in thumb, the label is 16-bit aligned, while function is > > 32-bit aligned, so label address may not be equal to function address. > > > > Patch below is to set labels 32-bit aligned. Tested this patch on > > both x86 and armel. OK to apply? > > Unfortunately not. The .align pseudo-op has different effects on > different architectures. On most architectures .align 2 actually > means 16-bit alignment, which is certainly not what you want on RISC > architectures that have 32-bit wide instructions. Thanks for your explanation. In original test case, breakpoint is set on insn nop, while main branches to insn push, so breakpoint is not hit. 0000000a : a: bf00 nop 0000000c : c: b480 push {r7} I thought this nop is generated for alignment, so I added '.align 2' for label func_loopfb_start to force it to be equal to func_loopfb. I make a mistake here. I don't know why nop is generated on label func_loopfb_start, and once '.align 2' is added, nop is *not* generated, so failures go away by accident. -- Yao Qi CodeSourcery yao@codesourcery.com (650) 331-3385 x739