This is the mail archive of the binutils@sourceware.org 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: ELF phdrs in .debug files


> 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


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