From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14898 invoked by alias); 23 Apr 2004 16:41:30 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 14889 invoked from network); 23 Apr 2004 16:41:29 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sources.redhat.com with SMTP; 23 Apr 2004 16:41:29 -0000 Received: from drow by nevyn.them.org with local (Exim 4.32 #1 (Debian)) id 1BH3k1-0003OA-2w; Fri, 23 Apr 2004 12:41:29 -0400 Date: Fri, 23 Apr 2004 16:51:00 -0000 From: Daniel Jacobowitz To: Richard Schmitt Cc: gdb@sources.redhat.com, rishi75@hotmail.com Subject: Re: Relocating Static Local Variables BUG? Message-ID: <20040423164129.GA12949@nevyn.them.org> Mail-Followup-To: Richard Schmitt , gdb@sources.redhat.com, rishi75@hotmail.com References: <55879.10.0.1.2.1082736208.squirrel@mail.bluepeach.com> <20040423161015.GA11696@nevyn.them.org> <56026.10.0.1.2.1082738201.squirrel@mail.bluepeach.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56026.10.0.1.2.1082738201.squirrel@mail.bluepeach.com> User-Agent: Mutt/1.5.5.1+cvs20040105i X-SW-Source: 2004-04/txt/msg00148.txt.bz2 On Fri, Apr 23, 2004 at 12:36:41PM -0400, Richard Schmitt wrote: > > The version of GCC is 3.3.1 > The version of GDB is 6.1 (downloaded latest release) > > The commands to generate the elf are: > > gcc -o test.exe -g test.c > objcopy -O elf32-little test.exe test.elf > > Built this way, the code is not relocatable, so there is no output of the > -r command to readelf. I've done it this way just to demonstrate the > issue that gdb has with relocating symbols, which is independent of code > generated as relocatable. The -s output is shown below. Well, it's not surprising that doesn't work. You are taking non-relocatable output, and giving GDB offsets at which to relocate it. The debug information no longer has relocation information, since final relocation has already been performed. I assume that's your simplified testcase rather than the one you were actually trying to debug, and you've oversimplified it - since f you needed to have .bss at the offset you told GDB about, then your code would be referencing it in the wrong place. How is the original code for your target built? -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer