From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19861 invoked by alias); 19 Sep 2013 15:23:28 -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 19852 invoked by uid 89); 19 Sep 2013 15:23:28 -0000 Received: from mail-ob0-f169.google.com (HELO mail-ob0-f169.google.com) (209.85.214.169) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 19 Sep 2013 15:23:28 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,NO_RELAYS autolearn=ham version=3.3.2 X-HELO: mail-ob0-f169.google.com Received: by mail-ob0-f169.google.com with SMTP id wp4so10191844obc.28 for ; Thu, 19 Sep 2013 08:23:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=cGLoNj99yKQvN7vg/F9YT+BlN95eecS7jW1hQQe1IWU=; b=O2dPv0CjgplglIvIc8laLywEEdtg6PTbOWgcd6Oru1FHoeDvxW1rhm1RZlp/V7ADxM 0T4ac5HR5hZjZtjXoxgpxme+pV0sFsjTJM+NI3+w2E8viYQjBxqsHUIvNW+99tqvCF6b xjhAxI6n6r1tRsfo9VX7oXHuhc5cm9mDvjOeaK8ZlQ0l5lJey6BzMn7jV7gzfghxinH7 mmUX2+neSAqQOlvFehHJVghnJ2YtL6p2FpsVzu6DnMcY4zk9KGFS48hszHd9sWRcZ8i2 cmZ/dxhVZH103x0Orojv8530afm3VVp1e3ea0B/UzuBzODjDFILPTo1T+T7CRjiN6bLM Vojw== X-Gm-Message-State: ALoCoQmc7/qszcHJQZ07jo286Z6pwpDxZaMtGcNigZdEMrw1X2rZjxL07jxgOzAQ/dYkxJlF7XRm X-Received: by 10.60.133.133 with SMTP id pc5mr275179oeb.63.1379604204390; Thu, 19 Sep 2013 08:23:24 -0700 (PDT) MIME-Version: 1.0 Received: by 10.182.137.135 with HTTP; Thu, 19 Sep 2013 08:23:03 -0700 (PDT) In-Reply-To: <51F7DDF0.8090605@redhat.com> References: <51F7DDF0.8090605@redhat.com> From: Omair Javaid Date: Thu, 19 Sep 2013 15:23:00 -0000 Message-ID: Subject: Re: [PATCH] testsuite/gdb.dwarf2: Fix for dw2-dos-drive failure on ARM To: Pedro Alves Cc: gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes X-SW-Source: 2013-09/txt/msg00689.txt.bz2 Thanks everyone for the feedback. I am getting following problem with 1byte text section in the dw2-dos-drive.exp (gdb) PASS: gdb.dwarf2/dw2-dos-drive.exp: set breakpoint pending off break 'z:file.c':func Cannot access memory at address 0x0 When I change this to 4bytes the problem gets fixed. That is why I thought this could be an unaligned illegal memory access but I accept that the above comments verify that its not a alignment issue. Can anyone help me figure out what could be the cause of this problem? Thanks! -- Omair. On 30 July 2013 16:38, Pedro Alves wrote: > 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