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


On Tue, May 22, 2007 at 10:56:09AM -0700, Roland McGrath wrote:
> > 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.

Not as of elfutils 0.97.1-3 (RHEL4) it's not.  What am I missing?

dan@cugel:~% echo 'int main(){}' > main.c
dan@cugel:~% gcc -o main main.c
dan@cugel:~% eu-strip -g -o main.strip -f main.debug main
dan@cugel:~% readelf -S main.strip|grep symtab
  [26] .symtab           SYMTAB           0000000000000000  000008d0
dan@cugel:~% readelf -S main.debug|grep symtab
readelf: Warning: the .dynamic section is not contained within the
dynamic segment  [27] .symtab           NOBITS
0000000000000000  000002e8

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.

-- 
Daniel Jacobowitz
CodeSourcery


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