From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26282 invoked by alias); 30 Jul 2013 15:38:36 -0000 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 Received: (qmail 26273 invoked by uid 89); 30 Jul 2013 15:38:36 -0000 X-Spam-SWARE-Status: No, score=-7.0 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RDNS_NONE,SPF_HELO_PASS,SPF_PASS autolearn=no version=3.3.1 Received: from Unknown (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Tue, 30 Jul 2013 15:38:35 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r6UFcQi2008170 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 30 Jul 2013 11:38:27 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r6UFcOb5007521; Tue, 30 Jul 2013 11:38:25 -0400 Message-ID: <51F7DDF0.8090605@redhat.com> Date: Tue, 30 Jul 2013 15:38:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 MIME-Version: 1.0 To: Omair Javaid CC: gdb-patches@sourceware.org Subject: Re: [PATCH] testsuite/gdb.dwarf2: Fix for dw2-dos-drive failure on ARM References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2013-07/txt/msg00774.txt.bz2 On 07/15/2013 11:26 AM, Omair Javaid wrote: > A test-case in gdb.dwarf2/dw2-dos-drive.exp fails on ARM. Problem occurs > due to an unaligned access of text section. This patch correctly aligns > text section to 4 bytes. This patch has been tested on armv7 and x86_64. #1 - What exactly is unaligned? You're reserving 4 bytes instead of 1 for pc_start. Does that really influence alignment of text ? It doesn't for me, with an arm-linux toolchain: $ arm-linux-gcc dw2-dos-drive.S -o a.out -c $ arm-gp2x-linux-objdump -h a.out ... Sections: Idx Name Size VMA LMA File off Algn 0 .text 00000001 00000000 00000000 00000034 2**0 CONTENTS, ALLOC, LOAD, READONLY, CODE ... vs ... Sections: Idx Name Size VMA LMA File off Algn 0 .text 00000004 00000000 00000000 00000034 2**0 CONTENTS, ALLOC, LOAD, READONLY, CODE ... IOW, size increases, but alignment stays the same. #2 - Where's the actual access/fault? AFAICS, the test doesn't even execute the compiled object's code. #3 - How come these other tests aren't likewise affected? $ grep "\.byte 0$" * -B 4 dw2-canonicalize-type.S- along with this program. If not, see . */ dw2-canonicalize-type.S- dw2-canonicalize-type.S- .text dw2-canonicalize-type.S- .globl main dw2-canonicalize-type.S:main: .byte 0 -- pr11465.S- .text pr11465.S-text_start: pr11465.S-_ZN1N1cE: pr11465.S- /* Valid function must have non-empty PC range. */ pr11465.S: .byte 0 > > gdb/testsuite/ChangeLog: > > 2013-07-15 Omair Javaid > > * gdb.dwarf2/dw2-dos-drive.S: Corrected text section alignment Missing period at end of sentence. That's a "why". You should say a "what" instead: * gdb.dwarf2/dw2-dos-drive.S (pc_start): Use .4byte instead of .byte. > > =================================================================== > RCS file: /cvs/src/src/gdb/testsuite/gdb.dwarf2/dw2-dos-drive.S,v > retrieving revision 1.1 > diff -u -p -r1.1 dw2-dos-drive.S > --- gdb/testsuite/gdb.dwarf2/dw2-dos-drive.S 17 Jan 2013 20:40:44 > -0000 1.1 > +++ gdb/testsuite/gdb.dwarf2/dw2-dos-drive.S 19 Jun 2013 19:43:32 -0000 > @@ -15,7 +15,7 @@ > > .text > pc_start: > - .byte 0 > + .4byte 0 > pc_end: > > .section .debug_info > -- Pedro Alves