public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Vivek Goyal <vgoyal@in.ibm.com>
To: gdb@sourceware.org, binutils@sourceware.org,
	        Daniel Jacobowitz <drow@false.org>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>,
	        Dave Anderson <anderson@redhat.com>
Subject: Re: "gdb vmlinux" gives wrong symbol addresses
Date: Sat, 19 Aug 2006 12:09:00 -0000	[thread overview]
Message-ID: <20060818191429.GA32199@in.ibm.com> (raw)
In-Reply-To: <20060818184837.GA1980@nevyn.them.org>

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

  reply	other threads:[~2006-08-18 19:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20060818183807.GD12962@in.ibm.com>
2006-08-18 22:09 ` Daniel Jacobowitz
2006-08-19 12:09   ` Vivek Goyal [this message]
2006-08-21  3:24   ` Alan Modra
2006-08-21  7:19     ` Daniel Jacobowitz
2006-08-21  8:13       ` Alan Modra
2006-08-23 18:31         ` Jan Kratochvil
2006-08-24  3:29           ` Mark Kettenis
2006-08-24  3:51             ` Daniel Jacobowitz
2006-08-21 15:27       ` Vivek Goyal
2006-08-21 17:56         ` Daniel Jacobowitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060818191429.GA32199@in.ibm.com \
    --to=vgoyal@in.ibm.com \
    --cc=anderson@redhat.com \
    --cc=binutils@sourceware.org \
    --cc=drow@false.org \
    --cc=ebiederm@xmission.com \
    --cc=gdb@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).