* dwarf2read.c (dw2_do_expand_symtabs_matching): Don't examine
authorDoug Evans <dje@google.com>
Tue, 11 Sep 2012 22:42:22 +0000 (22:42 +0000)
committerDoug Evans <dje@google.com>
Tue, 11 Sep 2012 22:42:22 +0000 (22:42 +0000)
.gdb_index symbol attributes if there are none.

gdb/ChangeLog
gdb/dwarf2read.c

index 333eb6e0e837496724beda35293bc59cf98a0b07..037ff2940342e098a5a33f4ed263500bd237a227 100644 (file)
@@ -1,3 +1,8 @@
+2012-09-11  Doug Evans  <dje@google.com>
+
+       * dwarf2read.c (dw2_do_expand_symtabs_matching): Don't examine
+       .gdb_index symbol attributes if there are none.
+
 2012-09-11  Joel Brobecker  <brobecker@adacore.com>
 
        * symtab.h (struct minimal_symbol) [has_size]: New field.
index ba5427c1e82c24b83eda98b8bce576f818b09bb5..5541b692b59b52a89ad6eed8744b0fce584c9d21 100644 (file)
@@ -3133,15 +3133,21 @@ dw2_do_expand_symtabs_matching (struct objfile *objfile,
              int is_static = GDB_INDEX_SYMBOL_STATIC_VALUE (cu_index_and_attrs);
              gdb_index_symbol_kind symbol_kind =
                GDB_INDEX_SYMBOL_KIND_VALUE (cu_index_and_attrs);
-
-             if (want_specific_block
-                 && index->version >= 7
+             /* Only check the symbol attributes if they're present.
+                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);
+
+             if (attrs_valid
+                 && want_specific_block
                  && want_static != is_static)
                continue;
 
-             /* Only check the symbol's kind if it has one.
-                Indices prior to version 7 don't record it.  */
-             if (index->version >= 7)
+             /* Only check the symbol's kind if it has one.  */
+             if (attrs_valid)
                {
                  switch (domain)
                    {