aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2020-09-29 00:02:06 +0200
committerAndreas K. Hüttel <dilfridge@gentoo.org>2021-01-23 20:20:08 +0200
commitecadfa55a29a526bae110570656d09b21cd9869d (patch)
tree9fbc5734fe3cdb3299b3e51f14da36118d8717df
parentreadelf: Show Unit Type for DWARF5 (diff)
downloadbinutils-gdb-ecadfa55a29a526bae110570656d09b21cd9869d.tar.gz
binutils-gdb-ecadfa55a29a526bae110570656d09b21cd9869d.tar.bz2
binutils-gdb-ecadfa55a29a526bae110570656d09b21cd9869d.zip
binutils: dwarf.c handle DWARF5 DW_LLE_start_end and DW_LLE_start_length.
display_loclists_list only handled DW_LLE_offset_pair as bounded location description. Also handle DW_LLE_start_end and DW_LLE_start_lenght. These don't use the base_address. binutils/ChangeLog: * dwarf.c (display_loclists_list): Handle DW_LLE_start_end and DW_LLE_start_length. Only add base_address for DW_LLE_offset_pair. (cherry picked from commit 1c9f770d16a715662564d810a1c1efefd7a66540) (cherry picked from commit 6ccb0b25575511e699f2c32631717fdfe14f5ad5)
-rw-r--r--binutils/ChangeLog8
-rw-r--r--binutils/dwarf.c23
2 files changed, 27 insertions, 4 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 5e048dbf34..0f756f778f 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,6 +1,14 @@
2020-11-15 Mark Wielaard <mark@klomp.org>
Backport from the mainline:
+ 2020-09-29 Mark Wielaard <mark@klomp.org>
+
+ * dwarf.c (display_loclists_list): Handle DW_LLE_start_end and
+ DW_LLE_start_length. Only add base_address for DW_LLE_offset_pair.
+
+2020-11-15 Mark Wielaard <mark@klomp.org>
+
+ Backport from the mainline:
2020-09-23 Mark Wielaard <mark@klomp.org>
* dwarf.c (process_debug_info): Print Unit Type for DWARF5.
diff --git a/binutils/dwarf.c b/binutils/dwarf.c
index b163c5b64f..eed0177b06 100644
--- a/binutils/dwarf.c
+++ b/binutils/dwarf.c
@@ -6018,7 +6018,9 @@ display_loclists_list (struct dwarf_section *section,
SAFE_BYTE_GET_AND_INC (llet, start, 1, section_end);
- if (vstart && llet == DW_LLE_offset_pair)
+ if (vstart && (llet == DW_LLE_offset_pair
+ || llet == DW_LLE_start_end
+ || llet == DW_LLE_start_length))
{
off = offset + (vstart - *start_ptr);
@@ -6039,7 +6041,18 @@ display_loclists_list (struct dwarf_section *section,
break;
case DW_LLE_offset_pair:
READ_ULEB (begin, start, section_end);
+ begin += base_address;
READ_ULEB (end, start, section_end);
+ end += base_address;
+ break;
+ case DW_LLE_start_end:
+ SAFE_BYTE_GET_AND_INC (begin, start, pointer_size, section_end);
+ SAFE_BYTE_GET_AND_INC (end, start, pointer_size, section_end);
+ break;
+ case DW_LLE_start_length:
+ SAFE_BYTE_GET_AND_INC (begin, start, pointer_size, section_end);
+ READ_ULEB (end, start, section_end);
+ end += begin;
break;
case DW_LLE_base_address:
SAFE_BYTE_GET_AND_INC (base_address, start, pointer_size,
@@ -6066,7 +6079,9 @@ display_loclists_list (struct dwarf_section *section,
}
if (llet == DW_LLE_end_of_list)
break;
- if (llet != DW_LLE_offset_pair)
+ if (llet != DW_LLE_offset_pair
+ && llet != DW_LLE_start_end
+ && llet != DW_LLE_start_length)
continue;
if (start + 2 > section_end)
@@ -6078,8 +6093,8 @@ display_loclists_list (struct dwarf_section *section,
READ_ULEB (length, start, section_end);
- print_dwarf_vma (begin + base_address, pointer_size);
- print_dwarf_vma (end + base_address, pointer_size);
+ print_dwarf_vma (begin, pointer_size);
+ print_dwarf_vma (end, pointer_size);
putchar ('(');
need_frame_base = decode_location_expression (start,