Blame SOURCES/gdb-rhbz1560010-fix-assertion-symbol-language-dict-language-2of5.patch

689258
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
689258
From: Sergio Durigan Junior <sergiodj@redhat.com>
689258
Date: Fri, 11 Jan 2019 11:25:11 -0500
689258
Subject: 
689258
 gdb-rhbz1560010-fix-assertion-symbol-language-dict-language-2of5.patch
689258
689258
;; Fix 'Assertion `SYMBOL_LANGUAGE (sym) == DICT_LANGUAGE (dict)->la_language' failed.'
689258
;; Keith Seitz, RHBZ#1560010.
689258
689258
gdb/23712: Use new multidictionary API
689258
689258
This patch builds on the previous by enabling the `new' multidictionary
689258
API.  A lot of the hunks are simply textual replacements of "dict_"
689258
with "mdict_" and similar transformations.
689258
689258
A word of warning, even with the use of multidictionaries, the code
689258
still does not satisfactorily fix the reported problems with gdb/23712
689258
(or gdb/23010). We still have additional changes to make before that
689258
happens.
689258
689258
gdb/ChangeLog:
689258
689258
	PR gdb/23712
689258
	PR symtab/23010
689258
	* dictionary.h (struct dictionary): Replace declaration with
689258
	multidictionary.
689258
	(dict_create_hashed, dict_create_hashed_expandable)
689258
	(dict_create_linear, dict_create_linear_expandable)
689258
	(dict_free, dict_add_symbol, dict_add_pending, dict_empty)
689258
	(dict_iterator_first, dict_iterator_next, dict_iter_match_first)
689258
	(dict_iter_match_next, dict_size): Rename to "mdict_" versions
689258
	taking multidictionary argument.
689258
	[ALL_DICT_SYMBOLS]: Update for multidictionary.
689258
	* block.h (struct block) <dict>: Change to multidictionary
689258
	and rename `multidict'.
689258
	* block.c, buildsym.c, jit.c, mdebugread.c, objfiles.c,
689258
	symmisc.c: Update all dictionary references to multidictionary.
689258
689258
diff --git a/gdb/block.c b/gdb/block.c
689258
--- a/gdb/block.c
689258
+++ b/gdb/block.c
689258
@@ -387,9 +387,9 @@ block_global_block (const struct block *block)
689258
    zero/NULL.  This is useful for creating "dummy" blocks that don't
689258
    correspond to actual source files.
689258
 
689258
-   Warning: it sets the block's BLOCK_DICT to NULL, which isn't a
689258
+   Warning: it sets the block's BLOCK_MULTIDICT to NULL, which isn't a
689258
    valid value.  If you really don't want the block to have a
689258
-   dictionary, then you should subsequently set its BLOCK_DICT to
689258
+   dictionary, then you should subsequently set its BLOCK_MULTIDICT to
689258
    dict_create_linear (obstack, NULL).  */
689258
 
689258
 struct block *
689258
@@ -544,10 +544,11 @@ block_iterator_step (struct block_iterator *iterator, int first)
689258
 
689258
 	  block = BLOCKVECTOR_BLOCK (COMPUNIT_BLOCKVECTOR (cust),
689258
 				     iterator->which);
689258
-	  sym = dict_iterator_first (BLOCK_DICT (block), &iterator->dict_iter);
689258
+	  sym = mdict_iterator_first (BLOCK_MULTIDICT (block),
689258
+				      &iterator->mdict_iter);
689258
 	}
689258
       else
689258
-	sym = dict_iterator_next (&iterator->dict_iter);
689258
+	sym = mdict_iterator_next (&iterator->mdict_iter);
689258
 
689258
       if (sym != NULL)
689258
 	return sym;
689258
@@ -569,7 +570,7 @@ block_iterator_first (const struct block *block,
689258
   initialize_block_iterator (block, iterator);
689258
 
689258
   if (iterator->which == FIRST_LOCAL_BLOCK)
689258
-    return dict_iterator_first (block->dict, &iterator->dict_iter);
689258
+    return mdict_iterator_first (block->multidict, &iterator->mdict_iter);
689258
 
689258
   return block_iterator_step (iterator, 1);
689258
 }
689258
@@ -580,7 +581,7 @@ struct symbol *
689258
 block_iterator_next (struct block_iterator *iterator)
689258
 {
689258
   if (iterator->which == FIRST_LOCAL_BLOCK)
689258
-    return dict_iterator_next (&iterator->dict_iter);
689258
+    return mdict_iterator_next (&iterator->mdict_iter);
689258
 
689258
   return block_iterator_step (iterator, 0);
689258
 }
689258
@@ -612,11 +613,11 @@ block_iter_match_step (struct block_iterator *iterator,
689258
 
689258
 	  block = BLOCKVECTOR_BLOCK (COMPUNIT_BLOCKVECTOR (cust),
689258
 				     iterator->which);
689258
-	  sym = dict_iter_match_first (BLOCK_DICT (block), name,
689258
-				       &iterator->dict_iter);
689258
+	  sym = mdict_iter_match_first (BLOCK_MULTIDICT (block), name,
689258
+					&iterator->mdict_iter);
689258
 	}
689258
       else
689258
-	sym = dict_iter_match_next (name, &iterator->dict_iter);
689258
+	sym = mdict_iter_match_next (name, &iterator->mdict_iter);
689258
 
689258
       if (sym != NULL)
689258
 	return sym;
689258
@@ -639,7 +640,8 @@ block_iter_match_first (const struct block *block,
689258
   initialize_block_iterator (block, iterator);
689258
 
689258
   if (iterator->which == FIRST_LOCAL_BLOCK)
689258
-    return dict_iter_match_first (block->dict, name, &iterator->dict_iter);
689258
+    return mdict_iter_match_first (block->multidict, name,
689258
+				   &iterator->mdict_iter);
689258
 
689258
   return block_iter_match_step (iterator, name, 1);
689258
 }
689258
@@ -651,7 +653,7 @@ block_iter_match_next (const lookup_name_info &name,
689258
 		       struct block_iterator *iterator)
689258
 {
689258
   if (iterator->which == FIRST_LOCAL_BLOCK)
689258
-    return dict_iter_match_next (name, &iterator->dict_iter);
689258
+    return mdict_iter_match_next (name, &iterator->mdict_iter);
689258
 
689258
   return block_iter_match_step (iterator, name, 0);
689258
 }
689258
@@ -731,7 +733,7 @@ block_lookup_symbol_primary (const struct block *block, const char *name,
689258
 			     const domain_enum domain)
689258
 {
689258
   struct symbol *sym, *other;
689258
-  struct dict_iterator dict_iter;
689258
+  struct mdict_iterator mdict_iter;
689258
 
689258
   lookup_name_info lookup_name (name, symbol_name_match_type::FULL);
689258
 
689258
@@ -740,9 +742,10 @@ block_lookup_symbol_primary (const struct block *block, const char *name,
689258
 	      || BLOCK_SUPERBLOCK (BLOCK_SUPERBLOCK (block)) == NULL);
689258
 
689258
   other = NULL;
689258
-  for (sym = dict_iter_match_first (block->dict, lookup_name, &dict_iter);
689258
+  for (sym
689258
+	 = mdict_iter_match_first (block->multidict, lookup_name, &mdict_iter);
689258
        sym != NULL;
689258
-       sym = dict_iter_match_next (lookup_name, &dict_iter))
689258
+       sym = mdict_iter_match_next (lookup_name, &mdict_iter))
689258
     {
689258
       if (SYMBOL_DOMAIN (sym) == domain)
689258
 	return sym;
689258
diff --git a/gdb/block.h b/gdb/block.h
689258
--- a/gdb/block.h
689258
+++ b/gdb/block.h
689258
@@ -111,7 +111,7 @@ struct block
689258
 
689258
   /* This is used to store the symbols in the block.  */
689258
 
689258
-  struct dictionary *dict;
689258
+  struct multidictionary *multidict;
689258
 
689258
   /* Contains information about namespace-related info relevant to this block:
689258
      using directives and the current namespace scope.  */
689258
@@ -143,7 +143,7 @@ struct global_block
689258
 #define BLOCK_END(bl)		(bl)->endaddr
689258
 #define BLOCK_FUNCTION(bl)	(bl)->function
689258
 #define BLOCK_SUPERBLOCK(bl)	(bl)->superblock
689258
-#define BLOCK_DICT(bl)		(bl)->dict
689258
+#define BLOCK_MULTIDICT(bl)	(bl)->multidict
689258
 #define BLOCK_NAMESPACE(bl)	(bl)->namespace_info
689258
 
689258
 /* Accessor for ranges field within block BL.  */
689258
@@ -298,9 +298,9 @@ struct block_iterator
689258
 
689258
   enum block_enum which;
689258
 
689258
-  /* The underlying dictionary iterator.  */
689258
+  /* The underlying multidictionary iterator.  */
689258
 
689258
-  struct dict_iterator dict_iter;
689258
+  struct mdict_iterator mdict_iter;
689258
 };
689258
 
689258
 /* Initialize ITERATOR to point at the first symbol in BLOCK, and
689258
diff --git a/gdb/buildsym.c b/gdb/buildsym.c
689258
--- a/gdb/buildsym.c
689258
+++ b/gdb/buildsym.c
689258
@@ -349,23 +349,21 @@ finish_block_internal (struct symbol *symbol,
689258
 
689258
   if (symbol)
689258
     {
689258
-      BLOCK_DICT (block)
689258
-	= dict_create_linear (&objfile->objfile_obstack,
689258
-			      buildsym_compunit->language, *listhead);
689258
+      BLOCK_MULTIDICT (block)
689258
+	= mdict_create_linear (&objfile->objfile_obstack, *listhead);
689258
     }
689258
   else
689258
     {
689258
       if (expandable)
689258
 	{
689258
-	  BLOCK_DICT (block)
689258
-	    = dict_create_hashed_expandable (buildsym_compunit->language);
689258
-	  dict_add_pending (BLOCK_DICT (block), *listhead);
689258
+	  BLOCK_MULTIDICT (block)
689258
+	    = mdict_create_hashed_expandable (buildsym_compunit->language);
689258
+	  mdict_add_pending (BLOCK_MULTIDICT (block), *listhead);
689258
 	}
689258
       else
689258
 	{
689258
-	  BLOCK_DICT (block) =
689258
-	    dict_create_hashed (&objfile->objfile_obstack,
689258
-				buildsym_compunit->language, *listhead);
689258
+	  BLOCK_MULTIDICT (block) =
689258
+	    mdict_create_hashed (&objfile->objfile_obstack, *listhead);
689258
 	}
689258
     }
689258
 
689258
@@ -377,7 +375,7 @@ finish_block_internal (struct symbol *symbol,
689258
   if (symbol)
689258
     {
689258
       struct type *ftype = SYMBOL_TYPE (symbol);
689258
-      struct dict_iterator iter;
689258
+      struct mdict_iterator miter;
689258
       SYMBOL_BLOCK_VALUE (symbol) = block;
689258
       BLOCK_FUNCTION (block) = symbol;
689258
 
689258
@@ -391,7 +389,7 @@ finish_block_internal (struct symbol *symbol,
689258
 
689258
 	  /* Here we want to directly access the dictionary, because
689258
 	     we haven't fully initialized the block yet.  */
689258
-	  ALL_DICT_SYMBOLS (BLOCK_DICT (block), iter, sym)
689258
+	  ALL_DICT_SYMBOLS (BLOCK_MULTIDICT (block), miter, sym)
689258
 	    {
689258
 	      if (SYMBOL_IS_ARGUMENT (sym))
689258
 		nparams++;
689258
@@ -405,7 +403,7 @@ finish_block_internal (struct symbol *symbol,
689258
 	      iparams = 0;
689258
 	      /* Here we want to directly access the dictionary, because
689258
 		 we haven't fully initialized the block yet.  */
689258
-	      ALL_DICT_SYMBOLS (BLOCK_DICT (block), iter, sym)
689258
+	      ALL_DICT_SYMBOLS (BLOCK_MULTIDICT (block), miter, sym)
689258
 		{
689258
 		  if (iparams == nparams)
689258
 		    break;
689258
@@ -1448,7 +1446,7 @@ end_symtab_with_blockvector (struct block *static_block,
689258
       {
689258
 	struct block *block = BLOCKVECTOR_BLOCK (blockvector, block_i);
689258
 	struct symbol *sym;
689258
-	struct dict_iterator iter;
689258
+	struct mdict_iterator miter;
689258
 
689258
 	/* Inlined functions may have symbols not in the global or
689258
 	   static symbol lists.  */
689258
@@ -1459,7 +1457,7 @@ end_symtab_with_blockvector (struct block *static_block,
689258
 	/* Note that we only want to fix up symbols from the local
689258
 	   blocks, not blocks coming from included symtabs.  That is why
689258
 	   we use ALL_DICT_SYMBOLS here and not ALL_BLOCK_SYMBOLS.  */
689258
-	ALL_DICT_SYMBOLS (BLOCK_DICT (block), iter, sym)
689258
+	ALL_DICT_SYMBOLS (BLOCK_MULTIDICT (block), miter, sym)
689258
 	  if (symbol_symtab (sym) == NULL)
689258
 	    symbol_set_symtab (sym, symtab);
689258
       }
689258
@@ -1598,7 +1596,7 @@ augment_type_symtab (void)
689258
 	 to the primary symtab.  */
689258
       set_missing_symtab (file_symbols, cust);
689258
 
689258
-      dict_add_pending (BLOCK_DICT (block), file_symbols);
689258
+      mdict_add_pending (BLOCK_MULTIDICT (block), file_symbols);
689258
     }
689258
 
689258
   if (global_symbols != NULL)
689258
@@ -1609,7 +1607,7 @@ augment_type_symtab (void)
689258
 	 to the primary symtab.  */
689258
       set_missing_symtab (global_symbols, cust);
689258
 
689258
-      dict_add_pending (BLOCK_DICT (block), global_symbols);
689258
+      mdict_add_pending (BLOCK_MULTIDICT (block), global_symbols);
689258
     }
689258
 
689258
   reset_symtab_globals ();
689258
diff --git a/gdb/dictionary.h b/gdb/dictionary.h
689258
--- a/gdb/dictionary.h
689258
+++ b/gdb/dictionary.h
689258
@@ -25,10 +25,10 @@
689258
 
689258
 #include "symfile.h"
689258
 
689258
-/* An opaque type for dictionaries; only dictionary.c should know
689258
-   about its innards.  */
689258
+/* An opaque type for multi-language dictionaries; only dictionary.c should
689258
+   know about its innards.  */
689258
 
689258
-struct dictionary;
689258
+struct multidictionary;
689258
 
689258
 /* Other types needed for declarations.  */
689258
 
689258
@@ -38,65 +38,64 @@ struct pending;
689258
 struct language_defn;
689258
 
689258
 /* The creation functions for various implementations of
689258
-   dictionaries.  */
689258
+   multi-language dictionaries.  */
689258
 
689258
-/* Create a dictionary of symbols of language LANGUAGE implemented via
689258
+/* Create a multi-language dictionary of symbols implemented via
689258
    a fixed-size hashtable.  All memory it uses is allocated on
689258
    OBSTACK; the environment is initialized from SYMBOL_LIST.  */
689258
 
689258
-extern struct dictionary *dict_create_hashed (struct obstack *obstack,
689258
-					      enum language language,
689258
-					      const struct pending
689258
-					      *symbol_list);
689258
+extern struct multidictionary *
689258
+  mdict_create_hashed (struct obstack *obstack,
689258
+		       const struct pending *symbol_list);
689258
 
689258
-/* Create a dictionary of symbols of language LANGUAGE, implemented
689258
-   via a hashtable that grows as necessary.  The dictionary is
689258
-   initially empty; to add symbols to it, call dict_add_symbol().
689258
-   Call dict_free() when you're done with it.  */
689258
+/* Create a multi-language dictionary of symbols, implemented
689258
+   via a hashtable that grows as necessary.  The initial dictionary of
689258
+   LANGUAGE is empty; to add symbols to it, call mdict_add_symbol().
689258
+   Call mdict_free() when you're done with it.  */
689258
 
689258
-extern struct dictionary *
689258
-  dict_create_hashed_expandable (enum language language);
689258
+extern struct multidictionary *
689258
+  mdict_create_hashed_expandable (enum language language);
689258
 
689258
-/* Create a dictionary of symbols of language LANGUAGE, implemented
689258
+/* Create a multi-language dictionary of symbols, implemented
689258
    via a fixed-size array.  All memory it uses is allocated on
689258
    OBSTACK; the environment is initialized from the SYMBOL_LIST.  The
689258
    symbols are ordered in the same order that they're found in
689258
    SYMBOL_LIST.  */
689258
 
689258
-extern struct dictionary *dict_create_linear (struct obstack *obstack,
689258
-					      enum language language,
689258
-					      const struct pending
689258
-					      *symbol_list);
689258
+extern struct multidictionary *
689258
+  mdict_create_linear (struct obstack *obstack,
689258
+		       const struct pending *symbol_list);
689258
 
689258
-/* Create a dictionary of symbols of language LANGUAGE, implemented
689258
-   via an array that grows as necessary.  The dictionary is initially
689258
-   empty; to add symbols to it, call dict_add_symbol().  Call
689258
-   dict_free() when you're done with it.  */
689258
+/* Create a multi-language dictionary of symbols, implemented
689258
+   via an array that grows as necessary.  The multidictionary initially
689258
+   contains a single empty dictionary of LANGUAGE; to add symbols to it,
689258
+   call mdict_add_symbol().  Call mdict_free() when you're done with it.  */
689258
 
689258
-extern struct dictionary *
689258
-  dict_create_linear_expandable (enum language language);
689258
+extern struct multidictionary *
689258
+  mdict_create_linear_expandable (enum language language);
689258
 
689258
-/* The functions providing the interface to dictionaries.  Note that
689258
-   the most common parts of the interface, namely symbol lookup, are
689258
-   only provided via iterator functions.  */
689258
+/* The functions providing the interface to multi-language dictionaries.
689258
+   Note that the most common parts of the interface, namely symbol lookup,
689258
+   are only provided via iterator functions.  */
689258
 
689258
-/* Free the memory used by a dictionary that's not on an obstack.  (If
689258
+/* Free the memory used by a multidictionary that's not on an obstack.  (If
689258
    any.)  */
689258
 
689258
-extern void dict_free (struct dictionary *dict);
689258
+extern void mdict_free (struct multidictionary *mdict);
689258
 
689258
-/* Add a symbol to an expandable dictionary.  */
689258
+/* Add a symbol to an expandable multidictionary.  */
689258
 
689258
-extern void dict_add_symbol (struct dictionary *dict, struct symbol *sym);
689258
+extern void mdict_add_symbol (struct multidictionary *mdict,
689258
+			      struct symbol *sym);
689258
 
689258
-/* Utility to add a list of symbols to a dictionary.  */
689258
+/* Utility to add a list of symbols to a multidictionary.  */
689258
 
689258
-extern void dict_add_pending (struct dictionary *dict,
689258
-			      const struct pending *symbol_list);
689258
+extern void mdict_add_pending (struct multidictionary *mdict,
689258
+			       const struct pending *symbol_list);
689258
 
689258
-/* Is the dictionary empty?  */
689258
+/* Is the multidictionary empty?  */
689258
 
689258
-extern int dict_empty (struct dictionary *dict);
689258
+extern int mdict_empty (struct multidictionary *mdict);
689258
 
689258
 /* A type containing data that is used when iterating over all symbols
689258
    in a dictionary.  Don't ever look at its innards; this type would
689258
@@ -128,44 +127,46 @@ struct mdict_iterator
689258
   unsigned short current_idx;
689258
 };
689258
 
689258
-/* Initialize ITERATOR to point at the first symbol in DICT, and
689258
-   return that first symbol, or NULL if DICT is empty.  */
689258
+/* Initialize ITERATOR to point at the first symbol in MDICT, and
689258
+   return that first symbol, or NULL if MDICT is empty.  */
689258
 
689258
-extern struct symbol *dict_iterator_first (const struct dictionary *dict,
689258
-					   struct dict_iterator *iterator);
689258
+extern struct symbol *
689258
+  mdict_iterator_first (const struct multidictionary *mdict,
689258
+			struct mdict_iterator *miterator);
689258
 
689258
-/* Advance ITERATOR, and return the next symbol, or NULL if there are
689258
+/* Advance MITERATOR, and return the next symbol, or NULL if there are
689258
    no more symbols.  Don't call this if you've previously received
689258
-   NULL from dict_iterator_first or dict_iterator_next on this
689258
+   NULL from mdict_iterator_first or mdict_iterator_next on this
689258
    iteration.  */
689258
 
689258
-extern struct symbol *dict_iterator_next (struct dict_iterator *iterator);
689258
+extern struct symbol *mdict_iterator_next (struct mdict_iterator *miterator);
689258
 
689258
-/* Initialize ITERATOR to point at the first symbol in DICT whose
689258
+/* Initialize MITERATOR to point at the first symbol in MDICT whose
689258
    SYMBOL_SEARCH_NAME is NAME, as tested using COMPARE (which must use
689258
    the same conventions as strcmp_iw and be compatible with any
689258
    dictionary hashing function), and return that first symbol, or NULL
689258
    if there are no such symbols.  */
689258
 
689258
-extern struct symbol *dict_iter_match_first (const struct dictionary *dict,
689258
-					     const lookup_name_info &name,
689258
-					     struct dict_iterator *iterator);
689258
+extern struct symbol *
689258
+  mdict_iter_match_first (const struct multidictionary *mdict,
689258
+			  const lookup_name_info &name,
689258
+			  struct mdict_iterator *miterator);
689258
 
689258
-/* Advance ITERATOR to point at the next symbol in DICT whose
689258
+/* Advance MITERATOR to point at the next symbol in MDICT whose
689258
    SYMBOL_SEARCH_NAME is NAME, as tested using COMPARE (see
689258
    dict_iter_match_first), or NULL if there are no more such symbols.
689258
    Don't call this if you've previously received NULL from 
689258
-   dict_iterator_match_first or dict_iterator_match_next on this
689258
-   iteration.  And don't call it unless ITERATOR was created by a
689258
-   previous call to dict_iter_match_first with the same NAME and COMPARE.  */
689258
+   mdict_iterator_match_first or mdict_iterator_match_next on this
689258
+   iteration.  And don't call it unless MITERATOR was created by a
689258
+   previous call to mdict_iter_match_first with the same NAME and COMPARE.  */
689258
 
689258
-extern struct symbol *dict_iter_match_next (const lookup_name_info &name,
689258
-					    struct dict_iterator *iterator);
689258
+extern struct symbol *mdict_iter_match_next (const lookup_name_info &name,
689258
+					     struct mdict_iterator *miterator);
689258
 
689258
-/* Return some notion of the size of the dictionary: the number of
689258
+/* Return some notion of the size of the multidictionary: the number of
689258
    symbols if we have that, the number of hash buckets otherwise.  */
689258
 
689258
-extern int dict_size (const struct dictionary *dict);
689258
+extern int mdict_size (const struct multidictionary *mdict);
689258
 
689258
 /* Macro to loop through all symbols in a dictionary DICT, in no
689258
    particular order.  ITER is a struct dict_iterator (NOTE: __not__ a
689258
@@ -175,8 +176,8 @@ extern int dict_size (const struct dictionary *dict);
689258
    early by a break if you desire.  */
689258
 
689258
 #define ALL_DICT_SYMBOLS(dict, iter, sym)			\
689258
-	for ((sym) = dict_iterator_first ((dict), &(iter));	\
689258
+	for ((sym) = mdict_iterator_first ((dict), &(iter));	\
689258
 	     (sym);						\
689258
-	     (sym) = dict_iterator_next (&(iter)))
689258
+	     (sym) = mdict_iterator_next (&(iter)))
689258
 
689258
 #endif /* DICTIONARY_H */
689258
diff --git a/gdb/jit.c b/gdb/jit.c
689258
--- a/gdb/jit.c
689258
+++ b/gdb/jit.c
689258
@@ -651,14 +651,12 @@ finalize_symtab (struct gdb_symtab *stab, struct objfile *objfile)
689258
   size_t blockvector_size;
689258
   CORE_ADDR begin, end;
689258
   struct blockvector *bv;
689258
-  enum language language;
689258
 
689258
   actual_nblocks = FIRST_LOCAL_BLOCK + stab->nblocks;
689258
 
689258
   cust = allocate_compunit_symtab (objfile, stab->file_name);
689258
   allocate_symtab (cust, stab->file_name);
689258
   add_compunit_symtab_to_objfile (cust);
689258
-  language = compunit_language (cust);
689258
 
689258
   /* JIT compilers compile in memory.  */
689258
   COMPUNIT_DIRNAME (cust) = NULL;
689258
@@ -702,8 +700,8 @@ finalize_symtab (struct gdb_symtab *stab, struct objfile *objfile)
689258
 					   TARGET_CHAR_BIT,
689258
 					   "void");
689258
 
689258
-      BLOCK_DICT (new_block) = dict_create_linear (&objfile->objfile_obstack,
689258
-						   language, NULL);
689258
+      BLOCK_MULTIDICT (new_block)
689258
+	= mdict_create_linear (&objfile->objfile_obstack, NULL);
689258
       /* The address range.  */
689258
       BLOCK_START (new_block) = (CORE_ADDR) gdb_block_iter->begin;
689258
       BLOCK_END (new_block) = (CORE_ADDR) gdb_block_iter->end;
689258
@@ -740,8 +738,8 @@ finalize_symtab (struct gdb_symtab *stab, struct objfile *objfile)
689258
       new_block = (i == GLOBAL_BLOCK
689258
 		   ? allocate_global_block (&objfile->objfile_obstack)
689258
 		   : allocate_block (&objfile->objfile_obstack));
689258
-      BLOCK_DICT (new_block) = dict_create_linear (&objfile->objfile_obstack,
689258
-						   language, NULL);
689258
+      BLOCK_MULTIDICT (new_block)
689258
+	= mdict_create_linear (&objfile->objfile_obstack, NULL);
689258
       BLOCK_SUPERBLOCK (new_block) = block_iter;
689258
       block_iter = new_block;
689258
 
689258
diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c
689258
--- a/gdb/mdebugread.c
689258
+++ b/gdb/mdebugread.c
689258
@@ -4534,7 +4534,7 @@ static void
689258
 add_symbol (struct symbol *s, struct symtab *symtab, struct block *b)
689258
 {
689258
   symbol_set_symtab (s, symtab);
689258
-  dict_add_symbol (BLOCK_DICT (b), s);
689258
+  mdict_add_symbol (BLOCK_MULTIDICT (b), s);
689258
 }
689258
 
689258
 /* Add a new block B to a symtab S.  */
689258
@@ -4762,7 +4762,7 @@ new_bvect (int nblocks)
689258
 }
689258
 
689258
 /* Allocate and zero a new block of language LANGUAGE, and set its
689258
-   BLOCK_DICT.  If function is non-zero, assume the block is
689258
+   BLOCK_MULTIDICT.  If function is non-zero, assume the block is
689258
    associated to a function, and make sure that the symbols are stored
689258
    linearly; otherwise, store them hashed.  */
689258
 
689258
@@ -4775,9 +4775,9 @@ new_block (enum block_type type, enum language language)
689258
   struct block *retval = XCNEW (struct block);
689258
 
689258
   if (type == FUNCTION_BLOCK)
689258
-    BLOCK_DICT (retval) = dict_create_linear_expandable (language);
689258
+    BLOCK_MULTIDICT (retval) = mdict_create_linear_expandable (language);
689258
   else
689258
-    BLOCK_DICT (retval) = dict_create_hashed_expandable (language);
689258
+    BLOCK_MULTIDICT (retval) = mdict_create_hashed_expandable (language);
689258
 
689258
   return retval;
689258
 }
689258
diff --git a/gdb/objfiles.c b/gdb/objfiles.c
689258
--- a/gdb/objfiles.c
689258
+++ b/gdb/objfiles.c
689258
@@ -813,40 +813,40 @@ objfile_relocate1 (struct objfile *objfile,
689258
     }
689258
 
689258
     ALL_OBJFILE_COMPUNITS (objfile, cust)
689258
-    {
689258
-      const struct blockvector *bv = COMPUNIT_BLOCKVECTOR (cust);
689258
-      int block_line_section = COMPUNIT_BLOCK_LINE_SECTION (cust);
689258
-
689258
-      if (BLOCKVECTOR_MAP (bv))
689258
-	addrmap_relocate (BLOCKVECTOR_MAP (bv),
689258
-			  ANOFFSET (delta, block_line_section));
689258
-
689258
-      for (i = 0; i < BLOCKVECTOR_NBLOCKS (bv); ++i)
689258
-	{
689258
-	  struct block *b;
689258
-	  struct symbol *sym;
689258
-	  struct dict_iterator iter;
689258
-
689258
-	  b = BLOCKVECTOR_BLOCK (bv, i);
689258
-	  BLOCK_START (b) += ANOFFSET (delta, block_line_section);
689258
-	  BLOCK_END (b) += ANOFFSET (delta, block_line_section);
689258
-
689258
-	  if (BLOCK_RANGES (b) != nullptr)
689258
-	    for (int j = 0; j < BLOCK_NRANGES (b); j++)
689258
+      {
689258
+	const struct blockvector *bv = COMPUNIT_BLOCKVECTOR (cust);
689258
+	int block_line_section = COMPUNIT_BLOCK_LINE_SECTION (cust);
689258
+
689258
+	if (BLOCKVECTOR_MAP (bv))
689258
+	  addrmap_relocate (BLOCKVECTOR_MAP (bv),
689258
+			    ANOFFSET (delta, block_line_section));
689258
+
689258
+	for (int i = 0; i < BLOCKVECTOR_NBLOCKS (bv); ++i)
689258
+	  {
689258
+	    struct block *b;
689258
+	    struct symbol *sym;
689258
+	    struct mdict_iterator miter;
689258
+
689258
+	    b = BLOCKVECTOR_BLOCK (bv, i);
689258
+	    BLOCK_START (b) += ANOFFSET (delta, block_line_section);
689258
+	    BLOCK_END (b) += ANOFFSET (delta, block_line_section);
689258
+
689258
+	    if (BLOCK_RANGES (b) != nullptr)
689258
+	      for (int j = 0; j < BLOCK_NRANGES (b); j++)
689258
+		{
689258
+		  BLOCK_RANGE_START (b, j)
689258
+		    += ANOFFSET (delta, block_line_section);
689258
+		  BLOCK_RANGE_END (b, j) += ANOFFSET (delta, block_line_section);
689258
+		}
689258
+
689258
+	    /* We only want to iterate over the local symbols, not any
689258
+	       symbols in included symtabs.  */
689258
+	    ALL_DICT_SYMBOLS (BLOCK_MULTIDICT (b), miter, sym)
689258
 	      {
689258
-		BLOCK_RANGE_START (b, j)
689258
-		  += ANOFFSET (delta, block_line_section);
689258
-		BLOCK_RANGE_END (b, j) += ANOFFSET (delta, block_line_section);
689258
+		relocate_one_symbol (sym, objfile, delta);
689258
 	      }
689258
-
689258
-	  /* We only want to iterate over the local symbols, not any
689258
-	     symbols in included symtabs.  */
689258
-	  ALL_DICT_SYMBOLS (BLOCK_DICT (b), iter, sym)
689258
-	    {
689258
-	      relocate_one_symbol (sym, objfile, delta);
689258
-	    }
689258
-	}
689258
-    }
689258
+	  }
689258
+      }
689258
   }
689258
 
689258
   /* Relocate isolated symbols.  */
689258
diff --git a/gdb/symmisc.c b/gdb/symmisc.c
689258
--- a/gdb/symmisc.c
689258
+++ b/gdb/symmisc.c
689258
@@ -275,7 +275,7 @@ dump_symtab_1 (struct symtab *symtab, struct ui_file *outfile)
689258
   struct objfile *objfile = SYMTAB_OBJFILE (symtab);
689258
   struct gdbarch *gdbarch = get_objfile_arch (objfile);
689258
   int i;
689258
-  struct dict_iterator iter;
689258
+  struct mdict_iterator miter;
689258
   int len;
689258
   struct linetable *l;
689258
   const struct blockvector *bv;
689258
@@ -331,7 +331,7 @@ dump_symtab_1 (struct symtab *symtab, struct ui_file *outfile)
689258
 	     even if we're using a hashtable, but nothing else but this message
689258
 	     wants it.  */
689258
 	  fprintf_filtered (outfile, ", %d syms/buckets in ",
689258
-			    dict_size (BLOCK_DICT (b)));
689258
+			    mdict_size (BLOCK_MULTIDICT (b)));
689258
 	  fputs_filtered (paddress (gdbarch, BLOCK_START (b)), outfile);
689258
 	  fprintf_filtered (outfile, "..");
689258
 	  fputs_filtered (paddress (gdbarch, BLOCK_END (b)), outfile);
689258
@@ -349,7 +349,7 @@ dump_symtab_1 (struct symtab *symtab, struct ui_file *outfile)
689258
 	  /* Now print each symbol in this block (in no particular order, if
689258
 	     we're using a hashtable).  Note that we only want this
689258
 	     block, not any blocks from included symtabs.  */
689258
-	  ALL_DICT_SYMBOLS (BLOCK_DICT (b), iter, sym)
689258
+	  ALL_DICT_SYMBOLS (BLOCK_MULTIDICT (b), miter, sym)
689258
 	    {
689258
 	      TRY
689258
 		{