This is the mail archive of the mailing list for the binutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: "gdb vmlinux" gives wrong symbol addresses

On Mon, Aug 21, 2006 at 11:14:39AM -0400, Vivek Goyal wrote:
> On Sun, Aug 20, 2006 at 09:54:30PM -0400, Daniel Jacobowitz wrote:
> > On Mon, Aug 21, 2006 at 11:08:29AM +0930, Alan Modra wrote:
> > > 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.
> > 
> > This amounts to always ignoring relocations; GDB only uses relocations
> > for debug sections, which will never point at SHT_DYNSYM (I don't
> > think?).
> >
> This brings me to a stupid question. Why do I have to apply relocations
> for file type ET_EXEC. By definition, doesn't it mean that all the
> relocations have already been processed?

For ET_EXEC, you don't especially.  However, for some ET_DYN you do and
some ET_DYN you don't.  If we're going to change the behavior... let's
get it right.

I just need to figure out how to do the check Alan suggested without
breaking non-ELF GDB.  Shouldn't be too hard.

Daniel Jacobowitz

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]