0

I am trying to parse a ELF file in DWARF2 format. There seems to be an incorrect DIE entry for one of the subprogram. It is supposed to have an entry "DW_TAG_subprogram" but has "DW_TAG_compile_unit" and there are some special characters under DW_AT_name.

Could this be linked to compilation / linking errors (bugs within compiler) ?

Any help greatly appreciated.

Thanks

1 Answers1

0

There isn't really enough information here to answer your question.

If the DWARF in question was emitted by reasonably mature tools, and you wrote your own DWARF reader then I would start by suspecting your code. On the other hand, if you wrote a new DWARF emitter, then the bug could be anywhere. I would probably start by examining the DWARF with an existing tool, say the elfutils eu-readelf (which has some sanity checks embedded in it); then go from there.

Tom Tromey
  • 21,507
  • 2
  • 45
  • 63