From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20900 invoked by alias); 18 Aug 2006 19:15:00 -0000 Received: (qmail 20881 invoked by uid 22791); 18 Aug 2006 19:14:59 -0000 X-Spam-Check-By: sourceware.org Received: from e36.co.us.ibm.com (HELO e36.co.us.ibm.com) (32.97.110.154) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 18 Aug 2006 19:14:56 +0000 Received: from d03relay04.boulder.ibm.com (d03relay04.boulder.ibm.com [9.17.195.106]) by e36.co.us.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id k7IJEtXm000517; Fri, 18 Aug 2006 15:14:55 -0400 Received: from d03av03.boulder.ibm.com (d03av03.boulder.ibm.com [9.17.195.169]) by d03relay04.boulder.ibm.com (8.13.6/8.13.6/NCO v8.1.1) with ESMTP id k7IJEsHo141542; Fri, 18 Aug 2006 13:14:54 -0600 Received: from d03av03.boulder.ibm.com (loopback [127.0.0.1]) by d03av03.boulder.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id k7IJErFh018405; Fri, 18 Aug 2006 13:14:54 -0600 Received: from vivek.in.ibm.com ([9.124.88.164]) by d03av03.boulder.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id k7IJEpjW018253; Fri, 18 Aug 2006 13:14:52 -0600 Received: by vivek.in.ibm.com (Postfix, from userid 500) id 7B42D124931; Fri, 18 Aug 2006 15:14:29 -0400 (EDT) Date: Fri, 18 Aug 2006 19:15:00 -0000 From: Vivek Goyal To: gdb@sourceware.org, binutils@sourceware.org, Daniel Jacobowitz Cc: "Eric W. Biederman" , Dave Anderson Subject: Re: "gdb vmlinux" gives wrong symbol addresses Message-ID: <20060818191429.GA32199@in.ibm.com> Reply-To: vgoyal@in.ibm.com 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.5.11 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/msg00139.txt.bz2 On Fri, Aug 18, 2006 at 02:48:37PM -0400, Daniel Jacobowitz wrote: > 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. > Oh. Thanks. > 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. > In this case file type is ET_EXEC and not even ET_DYN or ET_REL. Probably we should not be applying relocations at least for file types ET_EXEC as relocations have already been processed. We are looking at making i386 kernel relocatable by retaining relocation information in fully linked executable and later using that info to relocate the kernel at run time. Eric already has posted working patches. In this context I can not debung kernel core using gdb if this problem persists. Thanks Vivek