From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21299 invoked by alias); 12 Aug 2010 13:22:19 -0000 Received: (qmail 21283 invoked by uid 22791); 12 Aug 2010 13:22:17 -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 13:22:12 +0000 Received: (qmail 13055 invoked from network); 12 Aug 2010 13:22:08 -0000 Received: from unknown (HELO qiyaows) (yao@127.0.0.2) by mail.codesourcery.com with ESMTPA; 12 Aug 2010 13:22:08 -0000 Date: Thu, 12 Aug 2010 13:22:00 -0000 From: Yao Qi To: gdb-patches@sourceware.org Subject: Re: [PATCH,Testsuite] Add .align 2 for labels on Thumb Message-ID: <20100812132153.GC24769@qiyaows> References: <20100812081814.GA24769@qiyaows> <201008120935.o7C9Zpid015638@glazunov.sibelius.xs4all.nl> <20100812114907.GB24769@qiyaows> <20100812123437.GA31629@caradoc.them.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="v9Ux+11Zm5mwPlX6" Content-Disposition: inline In-Reply-To: <20100812123437.GA31629@caradoc.them.org> 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/msg00175.txt.bz2 --v9Ux+11Zm5mwPlX6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 1402 On Thu, Aug 12, 2010 at 08:34:39AM -0400, Daniel Jacobowitz wrote: > On Thu, Aug 12, 2010 at 07:49:08PM +0800, Yao Qi wrote: > > 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. > > Can you use func_loopfb instead of func_loopfb_start in the .S file? > Or, can you define func_loopfb_start as asm ("func_loopfb_start = > func_loopfb")? > > A third option is to address Mark's concern by using ".p2align 4"; I > believe that is 16-byte alignment on all platforms gas supports, and > this test probably requires gas in practice already. Yeah, update my patch by replacing '.align 2' with '.p2align 4'. Is that OK? > > The existing code is not correct, for the reason you've found; the > compiler typically uses .align or .p2align at the start of a function. I see, thanks. -- Yao Qi CodeSourcery yao@codesourcery.com (650) 331-3385 x739 --v9Ux+11Zm5mwPlX6 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="align.patch" Content-length: 840 gdb/testsuite/ 2010-08-12 Yao Qi * gdb.dwarf2/dw2-ref-missing-frame-func.c: Add .p2align 4 for labels func_nofb_start and func_loopfb_start, so that address of functions is equal to these labels on Thumb. diff --git a/gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame-func.c b/gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame-func.c index 5f77883..e6fa680 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame-func.c +++ b/gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame-func.c @@ -19,6 +19,7 @@ asm (".globl cu_text_start"); asm ("cu_text_start:"); asm (".globl func_nofb_start"); +asm (".p2align 4"); asm ("func_nofb_start:"); void @@ -31,6 +32,7 @@ asm (".globl func_nofb_end"); asm ("func_nofb_end:"); asm (".globl func_loopfb_start"); +asm (".p2align 4"); asm ("func_loopfb_start:"); void --v9Ux+11Zm5mwPlX6--