]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Remove support for .gdb_index < 7
authorTom Tromey <tom@tromey.com>
Mon, 8 Sep 2025 23:55:57 +0000 (17:55 -0600)
committerTom Tromey <tom@tromey.com>
Wed, 10 Sep 2025 22:05:26 +0000 (16:05 -0600)
This patch removes support for .gdb_index versions less than 7.  See
the patch that rewrites the reader to understand why this is needed.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
Reviewed-By: Eli Zaretskii <eliz@gnu.org>
Acked-By: Simon Marchi <simon.marchi@efficios.com>
gdb/NEWS
gdb/doc/gdb.texinfo
gdb/dwarf2/read-gdb-index.c

index 36065ec1943014565ccaeff616bc94c83000121a..1a9cd9df8971e17c295301b6cac32b663f37f93e 100644 (file)
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -3,6 +3,9 @@
 
 *** Changes since GDB 17
 
+* Support for .gdb_index sections with version less than 7 has been
+  removed.
+
 * New targets
 
 GNU/Linux/MicroBlaze (gdbserver) microblazeel-*linux*
index 4c33cd2a5213bdeac9e4c84c50f039de71e77fb9..dd9498c3dc8c666ba7d766a7fd4770289cd12783 100644 (file)
@@ -50686,17 +50686,13 @@ unless otherwise noted:
 
 @enumerate
 @item
-The version number, currently 9.  Versions 1, 2 and 3 are obsolete.
-Version 4 uses a different hashing function from versions 5 and 6.
-Version 6 includes symbols for inlined functions, whereas versions 4
-and 5 do not.  Version 7 adds attributes to the CU indices in the
-symbol table.  Version 8 specifies that symbols from DWARF type units
+The version number, currently 9.  Versions 1 through 6 are obsolete.
+Version 7 adds attributes to the CU indices in the symbol table.
+Version 8 specifies that symbols from DWARF type units
 (@samp{DW_TAG_type_unit}) refer to the type unit's symbol table and not the
 compilation unit (@samp{DW_TAG_comp_unit}) using the type.  Version 9 adds
 the name and the language of the main function to the index.
 
-@value{GDBN} will only read version 4, 5, or 6 indices
-by specifying @code{set use-deprecated-index-sections on}.
 GDB has a workaround for potentially broken version 7 indices so it is
 currently not flagged as deprecated.
 
index f2686e30efe33b9db75e34f8b367f76a593073f2..070239a5b6a396c39eac15f6d126aff339da92a8 100644 (file)
@@ -1060,9 +1060,7 @@ dw2_expand_marked_cus (dwarf2_per_objfile *per_objfile, offset_type idx,
         Indices prior to version 7 don't record them,
         and indices >= 7 may elide them for certain symbols
         (gold does this).  */
-      int attrs_valid =
-       (index.version >= 7
-        && symbol_kind != GDB_INDEX_SYMBOL_KIND_NONE);
+      int attrs_valid = symbol_kind != GDB_INDEX_SYMBOL_KIND_NONE;
 
       /* Work around gold/15646.  */
       if (attrs_valid
@@ -1210,11 +1208,9 @@ read_gdb_index_from_buffer (const char *filename,
 
   /* Version check.  */
   offset_type version = metadata[0];
-  /* Versions earlier than 3 emitted every copy of a psymbol.  This
-     causes the index to behave very poorly for certain requests.  Version 3
-     contained incomplete addrmap.  So, it seems better to just ignore such
-     indices.  */
-  if (version < 4)
+  /* GDB now requires the symbol attributes, which were added in
+     version 7.  */
+  if (version < 7)
     {
       static int warning_printed = 0;
       if (!warning_printed)
@@ -1225,30 +1221,6 @@ read_gdb_index_from_buffer (const char *filename,
        }
       return 0;
     }
-  /* Index version 4 uses a different hash function than index version
-     5 and later.
-
-     Versions earlier than 6 did not emit psymbols for inlined
-     functions.  Using these files will cause GDB not to be able to
-     set breakpoints on inlined functions by name, so we ignore these
-     indices unless the user has done
-     "set use-deprecated-index-sections on".  */
-  if (version < 6 && !deprecated_ok)
-    {
-      static int warning_printed = 0;
-      if (!warning_printed)
-       {
-         warning (_("\
-Skipping deprecated .gdb_index section in %s.\n\
-Do \"%ps\" before the file is read\n\
-to use the section anyway."),
-                  filename,
-                  styled_string (command_style.style (),
-                                 "set use-deprecated-index-sections on"));
-         warning_printed = 1;
-       }
-      return 0;
-    }
   /* Version 7 indices generated by gold refer to the CU for a symbol instead
      of the TU (for symbols coming from TUs),
      http://sourceware.org/bugzilla/show_bug.cgi?id=15021.