]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Fix latent bug in DW_TAG_entry_point handling
authorTom Tromey <tom@tromey.com>
Thu, 18 Jan 2024 20:27:02 +0000 (13:27 -0700)
committerTom Tromey <tom@tromey.com>
Sun, 28 Jan 2024 17:58:15 +0000 (10:58 -0700)
A DW_TAG_entry_point symbol inherits its extern/static property from
the enclosing subroutine.  This is encoded in new_symbol -- but the
cooked indexer does not agree.

gdb/dwarf2/read.c

index 4ac8f346cc90f0324e95cced93f6f6682f271e5b..1cc19b57ba8fec64783350da15316f971f0ef895 100644 (file)
@@ -16448,6 +16448,13 @@ cooked_indexer::index_dies (cutu_reader *reader,
                                  info_ptr, abbrev, &name, &linkage_name,
                                  &flags, &sibling, &this_parent_entry,
                                  &defer, &is_enum_class, false);
+      /* A DW_TAG_entry_point inherits its static/extern property from
+        the enclosing subroutine.  */
+      if (abbrev->tag == DW_TAG_entry_point)
+       {
+         flags &= ~IS_STATIC;
+         flags |= parent_entry->flags & IS_STATIC;
+       }
 
       if (abbrev->tag == DW_TAG_namespace
          && m_language == language_cplus