This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: ELF phdrs in .debug files
- From: Roland McGrath <roland at redhat dot com>
- To: Daniel Jacobowitz <drow at false dot org>
- Cc: Nick Clifton <nickc at redhat dot com>, Alan Modra <amodra at bigpond dot net dot au>, binutils at sources dot redhat dot com
- Date: Tue, 22 May 2007 22:14:01 -0700 (PDT)
- Subject: Re: ELF phdrs in .debug files
> 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.
The current rpm-supplied script (/usr/lib/rpm/find-debuginfo.sh) does not
use -g. Indeed you are right that -g leaves the symtab in the stripped
file, as it should. Without -g, the symtab is stripped except for ET_REL
(when there are reloc sections in the stripped file referring to it).
> Note that the symtab is left in the unstripped file only. This is the
> same eu-strip invocation RPM uses, as far as I can tell, and it's the
> direct cause of the section matching code in GDB.
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.)
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.
Thanks,
Roland