From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2745 invoked by alias); 18 Aug 2006 18:48:50 -0000 Received: (qmail 2728 invoked by uid 22791); 18 Aug 2006 18:48:50 -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; Fri, 18 Aug 2006 18:48:48 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1GE9OX-0000YI-E9; Fri, 18 Aug 2006 14:48:37 -0400 Date: Fri, 18 Aug 2006 18:48: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: <20060818184837.GA1980@nevyn.them.org> Mail-Followup-To: Vivek Goyal , gdb@sourceware.org, Dave Anderson , binutils@sourceware.org References: <20060818183807.GD12962@in.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060818183807.GD12962@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/msg00138.txt.bz2 On Fri, Aug 18, 2006 at 02:38:07PM -0400, Vivek Goyal wrote: > Following are two outputs. > > vmlinux linked without option --emit-relocs > > (gdb) p &linux_banner > $1 = (char (*)[162]) 0xc0344000 > > vmlinux linked with option --emit-relocs > > (gdb) p &linux_banner > $1 = (char (*)[162]) 0x8068a000 Stick a 1 in front of that and it should be obvious what the problem is. The address has been doubled. 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. Any ideas from the binutils list? -- Daniel Jacobowitz CodeSourcery