This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: "gdb vmlinux" gives wrong symbol addresses
- From: Daniel Jacobowitz <drow at false dot org>
- To: Vivek Goyal <vgoyal at in dot ibm dot com>
- Cc: gdb at sourceware dot org, Dave Anderson <anderson at redhat dot com>, binutils at sourceware dot org
- Date: Fri, 18 Aug 2006 14:48:37 -0400
- Subject: Re: "gdb vmlinux" gives wrong symbol addresses
- References: <20060818183807.GD12962@in.ibm.com>
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