+ force_return = 0;
+
+ sym = lookup_symbol_aux_minsyms (name, mangled_name,
+ namespace, is_a_field_of_this,
+ symtab, &force_return);
+
+ if (sym != NULL || force_return == 1)
+ return sym;
+
+#endif
+
+ sym = lookup_symbol_aux_psymtabs (GLOBAL_BLOCK, name, mangled_name,
+ namespace, symtab);
+ if (sym != NULL)
+ return sym;
+
+ /* Now search all static file-level symbols. Not strictly correct,
+ but more useful than an error. Do the symtabs first, then check
+ the psymtabs. If a psymtab indicates the existence of the
+ desired name as a file-level static, then do psymtab-to-symtab
+ conversion on the fly and return the found symbol. */
+
+ sym = lookup_symbol_aux_symtabs (STATIC_BLOCK, name, mangled_name,
+ namespace, symtab);
+ if (sym != NULL)
+ return sym;
+
+ sym = lookup_symbol_aux_psymtabs (STATIC_BLOCK, name, mangled_name,
+ namespace, symtab);
+ if (sym != NULL)
+ return sym;
+
+#ifdef HPUXHPPA
+
+ /* Check for the possibility of the symbol being a function or
+ a global variable that is stored in one of the minimal symbol tables.
+ The "minimal symbol table" is built from linker-supplied info.
+
+ RT: I moved this check to last, after the complete search of
+ the global (p)symtab's and static (p)symtab's. For HP-generated
+ symbol tables, this check was causing a premature exit from
+ lookup_symbol with NULL return, and thus messing up symbol lookups
+ of things like "c::f". It seems to me a check of the minimal
+ symbol table ought to be a last resort in any case. I'm vaguely
+ worried about the comment below which talks about FORTRAN routines "foo_"
+ though... is it saying we need to do the "minsym" check before
+ the static check in this case?
+ */
+
+
+ force_return = 0;
+
+ sym = lookup_symbol_aux_minsyms (name, mangled_name,
+ namespace, is_a_field_of_this,
+ symtab, &force_return);
+
+ if (sym != NULL || force_return == 1)
+ return sym;
+
+#endif
+
+ if (symtab != NULL)
+ *symtab = NULL;
+ return NULL;
+}
+
+/* Check to see if the symbol is defined in BLOCK or its superiors.
+ Don't search STATIC_BLOCK or GLOBAL_BLOCK. If we don't find a
+ match, store the address of STATIC_BLOCK in static_block. */
+
+static struct symbol *
+lookup_symbol_aux_local (const char *name, const char *mangled_name,
+ const struct block *block,
+ const namespace_enum namespace,
+ struct symtab **symtab,
+ const struct block **static_block)
+{
+ struct symbol *sym;
+
+ /* Check if either no block is specified or it's a global block. */
+
+ if (block == NULL || BLOCK_SUPERBLOCK (block) == NULL)