+2000-08-04 Kevin Buettner <kevinb@redhat.com>
+
+ * symtab.h (fixup_psymbol_section): Declare.
+ * symtab.c (fixup_psymbol_section): Make extern.
+ (fixup_section): Fix up section as well as bfd_section.
+ * objfiles.c (objfile_relocate): Call fixup_symbol_section
+ or fixup_psymbol_section before attempting to access
+ the SYMBOL_SECTION component of a symbol or partial symbol.
+
2000-08-04 Kevin Buettner <kevinb@redhat.com>
* minsyms.c (build_minimal_symbol_hash_tables): New function.
for (j = 0; j < BLOCK_NSYMS (b); ++j)
{
struct symbol *sym = BLOCK_SYM (b, j);
+
+ fixup_symbol_section (sym, objfile);
+
/* The RS6000 code from which this was taken skipped
any symbols in STRUCT_NAMESPACE or UNDEF_NAMESPACE.
But I'm leaving out that test, on the theory that
for (psym = objfile->global_psymbols.list;
psym < objfile->global_psymbols.next;
psym++)
- if (SYMBOL_SECTION (*psym) >= 0)
- SYMBOL_VALUE_ADDRESS (*psym) += ANOFFSET (delta,
- SYMBOL_SECTION (*psym));
+ {
+ fixup_psymbol_section (*psym, objfile);
+ if (SYMBOL_SECTION (*psym) >= 0)
+ SYMBOL_VALUE_ADDRESS (*psym) += ANOFFSET (delta,
+ SYMBOL_SECTION (*psym));
+ }
for (psym = objfile->static_psymbols.list;
psym < objfile->static_psymbols.next;
psym++)
- if (SYMBOL_SECTION (*psym) >= 0)
- SYMBOL_VALUE_ADDRESS (*psym) += ANOFFSET (delta,
- SYMBOL_SECTION (*psym));
+ {
+ fixup_psymbol_section (*psym, objfile);
+ if (SYMBOL_SECTION (*psym) >= 0)
+ SYMBOL_VALUE_ADDRESS (*psym) += ANOFFSET (delta,
+ SYMBOL_SECTION (*psym));
+ }
}
{
const char *, int,
namespace_enum);
-static struct partial_symbol *fixup_psymbol_section (struct
- partial_symbol *,
- struct objfile *);
-
static struct symtab *lookup_symtab_1 (char *);
static void cplusplus_hint (char *);
msym = lookup_minimal_symbol (ginfo->name, NULL, objfile);
if (msym)
- ginfo->bfd_section = SYMBOL_BFD_SECTION (msym);
+ {
+ ginfo->bfd_section = SYMBOL_BFD_SECTION (msym);
+ ginfo->section = SYMBOL_SECTION (msym);
+ }
}
struct symbol *
return sym;
}
-static struct partial_symbol *
+struct partial_symbol *
fixup_psymbol_section (struct partial_symbol *psym, struct objfile *objfile)
{
if (!psym)
extern struct symbol *fixup_symbol_section (struct symbol *,
struct objfile *);
+extern struct partial_symbol *fixup_psymbol_section (struct partial_symbol
+ *psym,
+ struct objfile *objfile);
+
/* Symbol searching */
/* When using search_symbols, a list of the following structs is returned.