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: retaining debug symbols of an elf image


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



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