[Dwarf-discuss] Question about differentiate instruction address in different sections

David Anderson davea
Thu Apr 13 11:06:57 GMT 2006

Jim Blandy writes:
>This seems fragile, and more work than actually checking the relocs.
>All you need to do is read the .rel.debug_info section, and build a
>table sorted by the address the reloc is meant to modify.  Then, when
>an address appears in the line number info, check the table to see if
>there is a reloc that applies to it.  If there is, that reloc refers

I think Jim's correct.

BTW: libdwarf was not designed to be used on unrelocated object files.

At the time it was designed relocatable objects  only had a
single text section (well the exceptions were very very
exceptional...).  So it mostly  worked pretty well.  Perhaps
'adequately' is a better word  :-)

Today things like using groups of sections for effective
duplicate-removal or having a static-linker avoid bringing in
dead fuctions have made multiple sections much more common.
(for example, the COMDAT notion.)

However, before tackling that I have some things to finish.  I
have a libdwarf/dwarfdump version in testing for which a
'dwarfdump configuration file' (dwarfdump.conf, a simple text
file) lets you give frame/eh_frame descriptions in text (per
ABI, for whatever ABIs you want) so dwarfdump can sensibly
print a wide range of ABIs without touching dwarf.h or
libdwarf.h or recompiling dwarfdump.  The existing .debug_frame
.eh_frame library interface has some significant limitations.
The new frame interface (additional one, not replacement, the old remains)
is more flexible and more correct.

I should re-evaluate the 'multiple .debug_info' (etc) sections
issue at some point. Not right now...

David Anderson

More information about the Dwarf-discuss mailing list