Fixup SYMBOL_SECTION for objfiles_relocate().
This commit is contained in:
parent
3d4ae3c0c6
commit
7a78d0eec8
4 changed files with 33 additions and 12 deletions
|
@ -1,3 +1,12 @@
|
||||||
|
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>
|
2000-08-04 Kevin Buettner <kevinb@redhat.com>
|
||||||
|
|
||||||
* minsyms.c (build_minimal_symbol_hash_tables): New function.
|
* minsyms.c (build_minimal_symbol_hash_tables): New function.
|
||||||
|
|
|
@ -564,6 +564,9 @@ objfile_relocate (struct objfile *objfile, struct section_offsets *new_offsets)
|
||||||
for (j = 0; j < BLOCK_NSYMS (b); ++j)
|
for (j = 0; j < BLOCK_NSYMS (b); ++j)
|
||||||
{
|
{
|
||||||
struct symbol *sym = BLOCK_SYM (b, j);
|
struct symbol *sym = BLOCK_SYM (b, j);
|
||||||
|
|
||||||
|
fixup_symbol_section (sym, objfile);
|
||||||
|
|
||||||
/* The RS6000 code from which this was taken skipped
|
/* The RS6000 code from which this was taken skipped
|
||||||
any symbols in STRUCT_NAMESPACE or UNDEF_NAMESPACE.
|
any symbols in STRUCT_NAMESPACE or UNDEF_NAMESPACE.
|
||||||
But I'm leaving out that test, on the theory that
|
But I'm leaving out that test, on the theory that
|
||||||
|
@ -606,16 +609,22 @@ objfile_relocate (struct objfile *objfile, struct section_offsets *new_offsets)
|
||||||
for (psym = objfile->global_psymbols.list;
|
for (psym = objfile->global_psymbols.list;
|
||||||
psym < objfile->global_psymbols.next;
|
psym < objfile->global_psymbols.next;
|
||||||
psym++)
|
psym++)
|
||||||
|
{
|
||||||
|
fixup_psymbol_section (*psym, objfile);
|
||||||
if (SYMBOL_SECTION (*psym) >= 0)
|
if (SYMBOL_SECTION (*psym) >= 0)
|
||||||
SYMBOL_VALUE_ADDRESS (*psym) += ANOFFSET (delta,
|
SYMBOL_VALUE_ADDRESS (*psym) += ANOFFSET (delta,
|
||||||
SYMBOL_SECTION (*psym));
|
SYMBOL_SECTION (*psym));
|
||||||
|
}
|
||||||
for (psym = objfile->static_psymbols.list;
|
for (psym = objfile->static_psymbols.list;
|
||||||
psym < objfile->static_psymbols.next;
|
psym < objfile->static_psymbols.next;
|
||||||
psym++)
|
psym++)
|
||||||
|
{
|
||||||
|
fixup_psymbol_section (*psym, objfile);
|
||||||
if (SYMBOL_SECTION (*psym) >= 0)
|
if (SYMBOL_SECTION (*psym) >= 0)
|
||||||
SYMBOL_VALUE_ADDRESS (*psym) += ANOFFSET (delta,
|
SYMBOL_VALUE_ADDRESS (*psym) += ANOFFSET (delta,
|
||||||
SYMBOL_SECTION (*psym));
|
SYMBOL_SECTION (*psym));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
struct minimal_symbol *msym;
|
struct minimal_symbol *msym;
|
||||||
|
|
|
@ -81,10 +81,6 @@ static struct partial_symbol *lookup_partial_symbol (struct partial_symtab *,
|
||||||
const char *, int,
|
const char *, int,
|
||||||
namespace_enum);
|
namespace_enum);
|
||||||
|
|
||||||
static struct partial_symbol *fixup_psymbol_section (struct
|
|
||||||
partial_symbol *,
|
|
||||||
struct objfile *);
|
|
||||||
|
|
||||||
static struct symtab *lookup_symtab_1 (char *);
|
static struct symtab *lookup_symtab_1 (char *);
|
||||||
|
|
||||||
static void cplusplus_hint (char *);
|
static void cplusplus_hint (char *);
|
||||||
|
@ -520,7 +516,10 @@ fixup_section (struct general_symbol_info *ginfo, struct objfile *objfile)
|
||||||
msym = lookup_minimal_symbol (ginfo->name, NULL, objfile);
|
msym = lookup_minimal_symbol (ginfo->name, NULL, objfile);
|
||||||
|
|
||||||
if (msym)
|
if (msym)
|
||||||
|
{
|
||||||
ginfo->bfd_section = SYMBOL_BFD_SECTION (msym);
|
ginfo->bfd_section = SYMBOL_BFD_SECTION (msym);
|
||||||
|
ginfo->section = SYMBOL_SECTION (msym);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
struct symbol *
|
struct symbol *
|
||||||
|
@ -537,7 +536,7 @@ fixup_symbol_section (struct symbol *sym, struct objfile *objfile)
|
||||||
return sym;
|
return sym;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct partial_symbol *
|
struct partial_symbol *
|
||||||
fixup_psymbol_section (struct partial_symbol *psym, struct objfile *objfile)
|
fixup_psymbol_section (struct partial_symbol *psym, struct objfile *objfile)
|
||||||
{
|
{
|
||||||
if (!psym)
|
if (!psym)
|
||||||
|
|
|
@ -1414,6 +1414,10 @@ extern int in_prologue (CORE_ADDR pc, CORE_ADDR func_start);
|
||||||
extern struct symbol *fixup_symbol_section (struct symbol *,
|
extern struct symbol *fixup_symbol_section (struct symbol *,
|
||||||
struct objfile *);
|
struct objfile *);
|
||||||
|
|
||||||
|
extern struct partial_symbol *fixup_psymbol_section (struct partial_symbol
|
||||||
|
*psym,
|
||||||
|
struct objfile *objfile);
|
||||||
|
|
||||||
/* Symbol searching */
|
/* Symbol searching */
|
||||||
|
|
||||||
/* When using search_symbols, a list of the following structs is returned.
|
/* When using search_symbols, a list of the following structs is returned.
|
||||||
|
|
Loading…
Reference in a new issue