From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9605 invoked by alias); 8 Jul 2003 02:58:33 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 9598 invoked from network); 8 Jul 2003 02:58:32 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sources.redhat.com with SMTP; 8 Jul 2003 02:58:32 -0000 Received: from drow by nevyn.them.org with local (Exim 3.36 #1 (Debian)) id 19ZigY-0007BL-00; Mon, 07 Jul 2003 22:58:30 -0400 Date: Tue, 08 Jul 2003 02:58:00 -0000 From: Daniel Jacobowitz To: Kei Sakamoto Cc: gdb-patches@sources.redhat.com Subject: Re: [patch/testcase] fix gdb.base/relocate.c Message-ID: <20030708025830.GA27558@nevyn.them.org> Mail-Followup-To: Kei Sakamoto , gdb-patches@sources.redhat.com References: <014401c344fc$7b0972d0$5169910a@KEI> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <014401c344fc$7b0972d0$5169910a@KEI> User-Agent: Mutt/1.5.1i X-SW-Source: 2003-07/txt/msg00150.txt.bz2 On Tue, Jul 08, 2003 at 11:56:07AM +0900, Kei Sakamoto wrote: > The attached patch fixes gdb.base/relocate.c. > > "relocate.exp: get address of function_bar" fails with m32r-elf-gdb > as the following: > > print &function_bar > $6 = (int (*)(void)) 0xc > (gdb) FAIL: gdb.base/relocate.exp: get address of function_bar (unknown output) > > Both function_bar and global_bar have the same address, 0xc. > Though they belong to different sections, gdb considers they > are the same and prints global_bar's data instead of > function_bar's. > > The same error happens with i386 if line 4 and 5 of relocate.c > are modified as the following: > > short global_foo = 3; > short global_bar = 4; > > I guess this is not gdb's bug but a feature and the testcase > should be modified. So I made a patch file. > > The attached patch inserts a definition of a dummy array so that > global_bar and function_bar should not have the same address. > > Kei > > 2003-07-08 Kei Sakamoto > > * gdb.base/relocate.c : Add a dummy array to make global_bar > and function_bar have different addresses. Ugh, this is OK, since the test can only reliably specify an offset for .text. -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer