diff options
author | Mark Wielaard <[email protected]> | 2017-11-24 19:29:57 +0100 |
---|---|---|
committer | Mark Wielaard <[email protected]> | 2018-05-29 12:18:43 +0200 |
commit | 7cfe2c16f9ddaa7478a2d97dd893c6b89080020a (patch) | |
tree | d3ceaf787ee03c7cb5f22728b1ddd92bca56fdb2 /libdw/dwarf_formudata.c | |
parent | 263dbe8ca17f66baa184f489530eb92afa15adfe (diff) |
readelf: Handle .debug_loclists.
The new DWARF5 .debug_loclists sections are like .debug_rnglists, but
plus locations. For Split Dwarf GCC generates the .debug_loclists fully
in the split .dwo file. Any references to addresses need to be resolved
through the skeleton .debug_addr section.
Signed-off-by: Mark Wielaard <[email protected]>
Diffstat (limited to 'libdw/dwarf_formudata.c')
-rw-r--r-- | libdw/dwarf_formudata.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/libdw/dwarf_formudata.c b/libdw/dwarf_formudata.c index 280fef2f..26f86f12 100644 --- a/libdw/dwarf_formudata.c +++ b/libdw/dwarf_formudata.c @@ -184,11 +184,23 @@ dwarf_formudata (Dwarf_Attribute *attr, Dwarf_Word *return_uval) case DW_AT_use_location: case DW_AT_vtable_elem_location: case DW_AT_GNU_locviews: - /* loclistptr */ - if (__libdw_formptr (attr, IDX_debug_loc, - DWARF_E_NO_LOCLIST, NULL, - return_uval) == NULL) - return -1; + case DW_AT_loclists_base: + if (attr->cu->version < 5) + { + /* loclistptr */ + if (__libdw_formptr (attr, IDX_debug_loc, + DWARF_E_NO_DEBUG_LOC, NULL, + return_uval) == NULL) + return -1; + } + else + { + /* loclist, loclistsptr */ + if (__libdw_formptr (attr, IDX_debug_loclists, + DWARF_E_NO_DEBUG_LOCLISTS, NULL, + return_uval) == NULL) + return -1; + } break; case DW_AT_macro_info: @@ -291,6 +303,7 @@ dwarf_formudata (Dwarf_Attribute *attr, Dwarf_Word *return_uval) case DW_FORM_udata: case DW_FORM_rnglistx: + case DW_FORM_loclistx: if (datap + 1 > endp) goto invalid; get_uleb128 (*return_uval, datap, endp); |