]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
readelf: Fix output of rnglists section
authorBernd Edlinger <bernd.edlinger@hotmail.de>
Wed, 11 Nov 2020 14:31:46 +0000 (14:31 +0000)
committerMark Wielaard <mark@klomp.org>
Mon, 16 Nov 2020 19:41:54 +0000 (20:41 +0100)
* dwarf.c (display_debug_rnglists_list): Only bias the
DW_RLS_offset_pair with the base address.

(cherry picked from commit 4d93271533473d65165022ee9f82c368511ce82a)

binutils/ChangeLog
binutils/dwarf.c

index 0f756f778fc50ed9f291a6ae4186564f96942724..20a120e91444cd901cdf685639bb5931860a4582 100644 (file)
@@ -1,3 +1,11 @@
+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:
index eed0177b0686baf70872a941c68111ec62420d28..e673c4b7fa8ae9ab1bd5e9f7502ca7af7c936556 100644 (file)
@@ -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);