aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernd Edlinger <bernd.edlinger@hotmail.de>2020-11-11 14:31:46 +0000
committerAndreas K. Hüttel <dilfridge@gentoo.org>2021-01-23 20:20:25 +0200
commitaf43dac7efc44265c92dd16e8f06b24c1c953cb6 (patch)
treeda36bf70ba3a7b8e286688eb227789ac04476bce
parentbinutils: dwarf.c handle DWARF5 DW_LLE_start_end and DW_LLE_start_length. (diff)
downloadbinutils-gdb-af43dac7efc44265c92dd16e8f06b24c1c953cb6.tar.gz
binutils-gdb-af43dac7efc44265c92dd16e8f06b24c1c953cb6.tar.bz2
binutils-gdb-af43dac7efc44265c92dd16e8f06b24c1c953cb6.zip
readelf: Fix output of rnglists section
* dwarf.c (display_debug_rnglists_list): Only bias the DW_RLS_offset_pair with the base address. (cherry picked from commit 4d93271533473d65165022ee9f82c368511ce82a) (cherry picked from commit 97cdf5f93459ff85e4e73e4da60d4f76e03187d0)
-rw-r--r--binutils/ChangeLog8
-rw-r--r--binutils/dwarf.c11
2 files changed, 17 insertions, 2 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 0f756f778f..20a120e914 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,6 +1,14 @@
2020-11-15 Mark Wielaard <mark@klomp.org>
Backport from the mainline:
+ 2020-11-11 Bernd Edlinger <bernd.edlinger@hotmail.de>
+
+ * dwarf.c (display_debug_rnglists_list): Only bias the
+ DW_RLS_offset_pair with the base address.
+
+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
diff --git a/binutils/dwarf.c b/binutils/dwarf.c
index eed0177b06..e673c4b7fa 100644
--- a/binutils/dwarf.c
+++ b/binutils/dwarf.c
@@ -7102,8 +7102,15 @@ display_debug_rnglists_list (unsigned char *start, unsigned char *finish,
if (rlet == DW_RLE_base_address)
continue;
- print_dwarf_vma (begin + base_address, pointer_size);
- print_dwarf_vma (end + base_address, pointer_size);
+ /* Only a DW_RLE_offset_pair needs the base address added. */
+ if (rlet == DW_RLE_offset_pair)
+ {
+ begin += base_address;
+ end += base_address;
+ }
+
+ print_dwarf_vma (begin, pointer_size);
+ print_dwarf_vma (end, pointer_size);
if (begin == end)
fputs (_("(start == end)"), stdout);