This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: ELF phdrs in .debug files
On Tue, May 22, 2007 at 10:14:01PM -0700, Roland McGrath wrote:
> > Not as of elfutils 0.97.1-3 (RHEL4) it's not. What am I missing?
>
> That's a very old elfutils and I won't make any claims off hand about it.
Well, only one RHEL release back... but I take your point.
> I don't quite follow how this relates to correlating stripped and debug
> file sections. Why is that ever relevant to symbol tables? What I do is
> use the symbol table in the stripped file if it has one, and if it doesn't,
> then look for a debuginfo file and use its symbol table. (Of course you
> need to remember which one you are using, so you can apply the prelink bias
> if you are using the unprelinked debug file.)
This has to do with how separate debug files were originally
implemented in GDB, and the fact that it uses BFD. Both the original
and separate debug file are pretty much first-class citizens in the
list of loaded files. So when GDB is searching for a symbol
associated with a particular BFD section it has to also accept symbols
associated with the equivalent BFD section in the other file.
> The only issue I'm aware of is in ET_REL files, where the debug file's
> .rel.debug_info et al sections will refer to symbols. My consumer code
> handles this fine. But, as I mentioned, we found out that "crash" did not,
> and so the Fedora eu-strip now copies the symtab into the debug file when
> the debug file contains reloc sections referring to it.
I'm pretty sure I worked on a GDB crash relating to this, too.
--
Daniel Jacobowitz
CodeSourcery