ELF phdrs in .debug files
Roland McGrath
roland@redhat.com
Tue May 22 17:56:00 GMT 2007
> Elfutils's output files have an, in my opinion, somewhat bizarre
> property. The symbol table is left in the unstripped file and the
> stripped file gets only NOBITS copy, so GDB ends up associating the
> symbols from .symtab with one file and the symbols from .debug_info
> with another.
Just to be clear, this is not precisely the story. (And by "this", I mean
what you said above but with "stripped" and "unstripped" swapped, which is
what I think you meant.) In executables, .symtab is stripped. In ET_DYN
and ET_REL files, .symtab is kept in the stripped file since it's used for
linking, and the debug file gets a SHT_NOBITS copy since you don't need two.
However, recently we noticed that "crash" (based on gdb, AIUI) freaks out
about this for ET_REL files (Linux .ko kernel modules). So now Fedora's
version of eu-strip copies .symtab into the debug file as well when reloc
sections in the debug file need it. (.ko.debug files have .rel.debug_*.)
Thanks,
Roland
More information about the Binutils
mailing list