aboutsummaryrefslogtreecommitdiff
path: root/binutils/dwarf.c
diff options
context:
space:
mode:
authorBernd Edlinger <bernd.edlinger@hotmail.de>2020-11-11 14:31:46 +0000
committerNick Clifton <nickc@redhat.com>2020-11-11 14:31:46 +0000
commit4d93271533473d65165022ee9f82c368511ce82a (patch)
treebdeccec40b560199b5c7f38fb2ba3911bc762798 /binutils/dwarf.c
parent0dd7428d895b35121db434dd0432d810ef6eecbe (diff)
downloadgdb-4d93271533473d65165022ee9f82c368511ce82a.zip
gdb-4d93271533473d65165022ee9f82c368511ce82a.tar.gz
gdb-4d93271533473d65165022ee9f82c368511ce82a.tar.bz2
readelf: Fix output of rnglists section
* dwarf.c (display_debug_rnglists_list): Only bias the DW_RLS_offset_pair with the base address.
Diffstat (limited to 'binutils/dwarf.c')
-rw-r--r--binutils/dwarf.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/binutils/dwarf.c b/binutils/dwarf.c
index cf68eba..c454d05 100644
--- a/binutils/dwarf.c
+++ b/binutils/dwarf.c
@@ -7532,8 +7532,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);