]> git.ipfire.org Git - thirdparty/elfutils.git/commit
libdw: Add explicit section index to struct Dwarf_CU.
authorMark Wielaard <mark@klomp.org>
Wed, 20 Dec 2017 15:50:57 +0000 (16:50 +0100)
committerMark Wielaard <mark@klomp.org>
Wed, 20 Dec 2017 16:20:29 +0000 (17:20 +0100)
commit51a7292b7ec7ddebcd2abddc7efff9d604494d44
tree821f988774a107793b1d0f9978d58ce3651c7e97
parent8887f30e55747b010631f04c4dc5f513359213f4
libdw: Add explicit section index to struct Dwarf_CU.

The DIE (attribute) data might come from either the main .debug_info
section or for DWARFv4 from a separate .debug_types section. Or in
case of the fake_loc_cu from the .debug_loc section and in the case
of macros from the .debug_macinfo or .debug_macro section.

We didn't handle the last two "fake" CU cases correctly when sanity
checking offsets in __libdw_read_address and __libdw_read_offset.

Add an explicit sec_idx field to struct Dwarf_CU that is always set
to the actual section that the data came from.

Signed-off-by: Mark Wielaard <mark@klomp.org>
libdw/ChangeLog
libdw/dwarf_begin_elf.c
libdw/dwarf_getmacros.c
libdw/libdwP.h
libdw/libdw_findcu.c