+2019-07-22 Christian Biesinger <cbiesinger@google.com>
+
+ * compile/compile-object-load.c (compile_object_load): Pass GLOBAL_SCOPE.
+ * solib-spu.c (spu_lookup_lib_symbol): Pass GLOBAL_SCOPE.
+ * solib-svr4.c (elf_lookup_lib_symbol): Pass GLOBAL_SCOPE.
+ * symtab.c (lookup_global_symbol_from_objfile): Add a scope parameter.
+ * symtab.h (lookup_global_symbol_from_objfile): Likewise.
+
+
2019-07-24 Yoshinori Sato <ysato@users.sourceforge.jp>
* h8300-tdep.c (h8300_register_name_common): New.
objfile = objfile_holder.get ();
func_sym = lookup_global_symbol_from_objfile (objfile,
+ GLOBAL_BLOCK,
GCC_FE_WRAPPER_FUNCTION,
VAR_DOMAIN).symbol;
if (func_sym == NULL)
const domain_enum domain)
{
if (bfd_get_arch (objfile->obfd) == bfd_arch_spu)
- return lookup_global_symbol_from_objfile (objfile, name, domain);
+ return lookup_global_symbol_from_objfile (objfile, GLOBAL_BLOCK, name,
+ domain);
if (svr4_so_ops.lookup_lib_global_symbol != NULL)
return svr4_so_ops.lookup_lib_global_symbol (objfile, name, domain);
if (abfd == NULL || scan_dyntag (DT_SYMBOLIC, abfd, NULL, NULL) != 1)
return {};
- return lookup_global_symbol_from_objfile (objfile, name, domain);
+ return lookup_global_symbol_from_objfile (objfile, GLOBAL_BLOCK, name,
+ domain);
}
void
struct block_symbol
lookup_global_symbol_from_objfile (struct objfile *main_objfile,
+ enum block_enum block_index,
const char *name,
const domain_enum domain)
{
+ gdb_assert (block_index == GLOBAL_BLOCK || block_index == STATIC_BLOCK);
+
for (objfile *objfile : main_objfile->separate_debug_objfiles ())
{
struct block_symbol result
- = lookup_symbol_in_objfile (objfile, GLOBAL_BLOCK, name, domain);
+ = lookup_symbol_in_objfile (objfile, block_index, name, domain);
- if (result.symbol != NULL)
+ if (result.symbol != nullptr)
return result;
}
extern const char *main_name ();
extern enum language main_language (void);
-/* Lookup symbol NAME from DOMAIN in MAIN_OBJFILE's global blocks.
+/* Lookup symbol NAME from DOMAIN in MAIN_OBJFILE's global or static blocks,
+ as specified by BLOCK_INDEX.
This searches MAIN_OBJFILE as well as any associated separate debug info
objfiles of MAIN_OBJFILE.
+ BLOCK_INDEX can be GLOBAL_BLOCK or STATIC_BLOCK.
Upon success fixes up the symbol's section if necessary. */
extern struct block_symbol
lookup_global_symbol_from_objfile (struct objfile *main_objfile,
+ enum block_enum block_index,
const char *name,
const domain_enum domain);