public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* retaining debug symbols of an elf image
@ 2006-04-07 15:22 Bahadir Balban
  2006-04-10 15:55 ` Nick Clifton
  0 siblings, 1 reply; 2+ messages in thread
From: Bahadir Balban @ 2006-04-07 15:22 UTC (permalink / raw)
  To: binutils

Hi,

There's a primitive tool that bundles multiple elf images together,
for later scatterloading. However it only keeps the .data and .text
sections, discarding the others.

I want to retain debug symbols in the elf images that are bundled, or
at least be able to load symbols to a debugger when images are
running. Is it non-trivial effort to retain debug symbols in the
image? Else how could I separate out the debug symbols into a file,
for reading them into the debugger later when images are running?

Thanks,
Bahadir

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: retaining debug symbols of an elf image
  2006-04-07 15:22 retaining debug symbols of an elf image Bahadir Balban
@ 2006-04-10 15:55 ` Nick Clifton
  0 siblings, 0 replies; 2+ messages in thread
From: Nick Clifton @ 2006-04-10 15:55 UTC (permalink / raw)
  To: Bahadir Balban; +Cc: binutils

Hi Bahadir,

> There's a primitive tool that bundles multiple elf images together,
> for later scatterloading.

Does this tool use the BFD library ?  If not, then why are you asking on 
this list ? :-)


> I want to retain debug symbols in the elf images that are bundled, or
> at least be able to load symbols to a debugger when images are
> running. Is it non-trivial effort to retain debug symbols in the
> image? 

Not really.  You just need to retain the sections that contain symbol 
tables.  That is sections with either the SHT_SYMTAB or SHT_DYNSYM value 
  set as their sh_type value.

Of course for this to be useful you are also going to want to retain the 
sections containing debug information as well.  They are slightly harder 
to locate as they do not have a specific type assigned to them in the 
ELF spec.  They usually have well known names however, often starting 
with ".debug".

You might like to look at the code in binutils/objcopy.c that strips out 
debug sections into a separate file.

Cheers
   Nick


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-04-10 15:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-04-07 15:22 retaining debug symbols of an elf image Bahadir Balban
2006-04-10 15:55 ` Nick Clifton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).