Ticket #427 (closed defect: fixed)
Wrong interpretation of code_offset in dwarf_add_line_entry
|Reported by:||jtytgat||Owned by:||kaiwang27|
Compared to SGI libdwarf implementation, code_offset in dwarf_add_line_entry is interpreted differently. In elftoolchain, it is an address offset compared to the address specified in the last dwarf_lne_set_address call.
The SGI libdwarf implementation it is an address like the one specified in dwarf_lne_set_address calls and gets implicitly the same relocation as specified in the last dwarf_lne_set_address call (hence, the 'offset' in code_offset).
It is a bit confusing and not well documented but it is clear when trying out the same code against elftoolchain and libdwarf.
I've attached a patch to address this. I guess the corresponding man3 page of dwarf_add_line_entry needs fixing and/or enhanced.