From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17260 invoked by alias); 21 Aug 2006 15:25:55 -0000 Received: (qmail 17243 invoked by uid 22791); 21 Aug 2006 15:25:54 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Mon, 21 Aug 2006 15:25:48 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1GFBeo-0005VJ-2r; Mon, 21 Aug 2006 11:25:42 -0400 Date: Mon, 21 Aug 2006 15:25:00 -0000 From: Daniel Jacobowitz To: Vivek Goyal Cc: gdb@sourceware.org, Dave Anderson , binutils@sourceware.org Subject: Re: "gdb vmlinux" gives wrong symbol addresses Message-ID: <20060821152542.GA21118@nevyn.them.org> Mail-Followup-To: Vivek Goyal , gdb@sourceware.org, Dave Anderson , binutils@sourceware.org References: <20060818183807.GD12962@in.ibm.com> <20060818184837.GA1980@nevyn.them.org> <20060821013829.GA20576@bubble.grove.modra.org> <20060821015430.GA4615@nevyn.them.org> <20060821151439.GF9549@in.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060821151439.GF9549@in.ibm.com> User-Agent: Mutt/1.5.11+cvs20060403 X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-08/txt/msg00163.txt.bz2 On Mon, Aug 21, 2006 at 11:14:39AM -0400, Vivek Goyal wrote: > On Sun, Aug 20, 2006 at 09:54:30PM -0400, Daniel Jacobowitz wrote: > > On Mon, Aug 21, 2006 at 11:08:29AM +0930, Alan Modra wrote: > > > I think that for ET_EXEC and ET_DYN gdb should ignore relocs that use > > > the normal symbol table. Sane ELF targets will have dynamic reloc > > > section(s) with sh_link pointing at a symtab section with sh_type of > > > SHT_DYNSYM. --emit-relocs creates reloc sections with sh_link pointing > > > at a symtab section with sh_type of SHT_SYMTAB. > > > > This amounts to always ignoring relocations; GDB only uses relocations > > for debug sections, which will never point at SHT_DYNSYM (I don't > > think?). > > > > This brings me to a stupid question. Why do I have to apply relocations > for file type ET_EXEC. By definition, doesn't it mean that all the > relocations have already been processed? For ET_EXEC, you don't especially. However, for some ET_DYN you do and some ET_DYN you don't. If we're going to change the behavior... let's get it right. I just need to figure out how to do the check Alan suggested without breaking non-ELF GDB. Shouldn't be too hard. -- Daniel Jacobowitz CodeSourcery