Fix: readelf: loc_offset XX too big
authorNick Clifton <nickc@redhat.com>
Wed, 19 Apr 2023 10:48:24 +0000 (11:48 +0100)
committerNick Clifton <nickc@redhat.com>
Wed, 19 Apr 2023 10:48:24 +0000 (11:48 +0100)
  PR 30355
  * dwarf.c (read_and_display_attr_value): Correctly handle DW_loclistx attributes that index a version 5 .debug_loclists section.

binutils/ChangeLog
binutils/dwarf.c

index f705b6c4622226adfb17ab5fdb34531540e722d0..22ca79cfb96a702c4736fb4973693f2728fc812b 100644 (file)
@@ -1,8 +1,15 @@
+2023-04-19  Nick Clifton  <nickc@redhat.com>
+
+       PR 30355
+       * dwarf.c (read_and_display_attr_value): Correctly handle
+       DW_loclistx attributes that index a version 5 .debug_loclists
+       section.
+
 2023-04-17  Nick Clifton  <nickc@redhat.com>
 
        PR 30142
        * rescoff.c (write_coff_file): Add the SEC_READONLY flag to the
-       .rsrc section. 
+       .rsrc section.
 
 2023-04-11  Nick Clifton  <nickc@redhat.com>
 
index 86893c59dc7bf8d865f5c4d192cc3b4f069a865f..1001a11db40b0eb1bd8f405fad4243b7e6298faa 100644 (file)
@@ -2725,7 +2725,7 @@ read_and_display_attr_value (unsigned long attribute,
                  if (idx != (uint64_t) -1)
                    idx += (offset_size == 8) ? 20 : 12;
                }
-             else if (debug_info_p == NULL)
+             else if (debug_info_p == NULL || dwarf_version > 4)
                {
                  idx = fetch_indexed_value (uvalue, loclists, 0);
                }