diff options
author | Kevin Buettner <kevinb@redhat.com> | 2000-08-04 23:13:50 +0000 |
---|---|---|
committer | Kevin Buettner <kevinb@redhat.com> | 2000-08-04 23:13:50 +0000 |
commit | 7a78d0eec8f3c753f2ba505458d876142e575cf4 (patch) | |
tree | baafcaef505dd585237dc57c6903dca3d0fadbfb | |
parent | 3d4ae3c0c6cbd480d202a6b1dcb6d3a5b75f9915 (diff) | |
download | gdb-7a78d0eec8f3c753f2ba505458d876142e575cf4.zip gdb-7a78d0eec8f3c753f2ba505458d876142e575cf4.tar.gz gdb-7a78d0eec8f3c753f2ba505458d876142e575cf4.tar.bz2 |
Fixup SYMBOL_SECTION for objfiles_relocate().
-rw-r--r-- | gdb/ChangeLog | 9 | ||||
-rw-r--r-- | gdb/objfiles.c | 21 | ||||
-rw-r--r-- | gdb/symtab.c | 11 | ||||
-rw-r--r-- | gdb/symtab.h | 4 |
4 files changed, 33 insertions, 12 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 8abe74d..bdaaa2a 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,14 @@ 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. (compact_minimal_symbols): Don't construct hash tables here. (install_minimal_symbols): Instead, construct them here. diff --git a/gdb/objfiles.c b/gdb/objfiles.c index 5cdfb98..f5b1119 100644 --- a/gdb/objfiles.c +++ b/gdb/objfiles.c @@ -564,6 +564,9 @@ objfile_relocate (struct objfile *objfile, struct section_offsets *new_offsets) 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 @@ -606,15 +609,21 @@ objfile_relocate (struct objfile *objfile, struct section_offsets *new_offsets) 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)); + } } { diff --git a/gdb/symtab.c b/gdb/symtab.c index e43afd4..633f6f7 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -81,10 +81,6 @@ static struct partial_symbol *lookup_partial_symbol (struct partial_symtab *, 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 *); @@ -520,7 +516,10 @@ fixup_section (struct general_symbol_info *ginfo, struct objfile *objfile) 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 * @@ -537,7 +536,7 @@ fixup_symbol_section (struct symbol *sym, struct objfile *objfile) return sym; } -static struct partial_symbol * +struct partial_symbol * fixup_psymbol_section (struct partial_symbol *psym, struct objfile *objfile) { if (!psym) diff --git a/gdb/symtab.h b/gdb/symtab.h index 7fb78db..101759f 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -1414,6 +1414,10 @@ extern int in_prologue (CORE_ADDR pc, CORE_ADDR func_start); 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. |