From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13504 invoked by alias); 21 Aug 2006 01:38:36 -0000 Received: (qmail 13489 invoked by uid 22791); 21 Aug 2006 01:38:35 -0000 X-Spam-Check-By: sourceware.org Received: from omta01ps.mx.bigpond.com (HELO omta01ps.mx.bigpond.com) (144.140.82.153) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 21 Aug 2006 01:38:33 +0000 Received: from grove.modra.org ([60.226.255.233]) by omta01ps.mx.bigpond.com with ESMTP id <20060821013829.ZFVB29999.omta01ps.mx.bigpond.com@grove.modra.org>; Mon, 21 Aug 2006 01:38:29 +0000 Received: by bubble.grove.modra.org (Postfix, from userid 500) id 181871ECDAE; Mon, 21 Aug 2006 11:08:29 +0930 (CST) Date: Mon, 21 Aug 2006 01:38:00 -0000 From: Alan Modra To: Vivek Goyal , gdb@sourceware.org, Dave Anderson , binutils@sourceware.org Subject: Re: "gdb vmlinux" gives wrong symbol addresses Message-ID: <20060821013829.GA20576@bubble.grove.modra.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> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060818184837.GA1980@nevyn.them.org> User-Agent: Mutt/1.4i 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/msg00144.txt.bz2 On Fri, Aug 18, 2006 at 02:48:37PM -0400, Daniel Jacobowitz wrote: > The debug section has been fully resolved, but relocations are also > applied to it, moving all addresses up even further. I don't have > any good idea on how to detect this case. We originally handled > relocations for shared libraries with unrelocated debug sections; > but this is a fully relocated section which still has relocation > information. > > Did we change all binutils targets to resolve relocations in debug > sections? I don't really remember. If so, maybe we should drop > support for shared libraries with this problem, and only apply > relocations to debug info for ET_REL objects. 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. -- Alan Modra IBM OzLabs - Linux Technology Centre