This is the mail archive of the
mailing list for the binutils project.
Re: "gdb vmlinux" gives wrong symbol addresses
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: Vivek Goyal <vgoyal at in dot ibm dot com>, gdb at sourceware dot org, Dave Anderson <anderson at redhat dot com>, binutils at sourceware dot org
- Date: Mon, 21 Aug 2006 11:08:29 +0930
- Subject: Re: "gdb vmlinux" gives wrong symbol addresses
- References: <20060818183807.GD12962@in.ibm.com> <20060818184837.GA1980@nevyn.them.org>
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
> 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.
IBM OzLabs - Linux Technology Centre