+2002-02-20 Daniel Jacobowitz <drow@mvista.com>
+
+ * coffread.c (coff_symfile_read): Clean up minimal symbols earlier.
+ * dbxread.c (elfstab_build_psymtabs): Don't call
+ install_minimal_symbols.
+ (stabsect_build_psymtabs): Likewise.
+ * elfread.c (elf_symfile_read): Call install_minimal_symbols
+ earlier.
+ * somread.c (som_symfile_read): Call install_minimal_symbols
+ and do_cleanups earlier.
+ * nlmread.c (nlm_symfile_read): Likewise.
+ * mdebugread.c (elfmdebug_build_psymtabs): Call
+ install_minimal_symbols and make appropriate cleanups.
+
2003-02-20 Kevin Buettner <kevinb@redhat.com>
* solib.c (reload_shared_libraries): New function.
unsigned int num_symbols;
int symtab_offset;
int stringtab_offset;
- struct cleanup *back_to;
+ struct cleanup *back_to, *cleanup_minimal_symbols;
int stabstrsize;
int len;
char * target;
error ("\"%s\": can't get string table", name);
init_minimal_symbol_collection ();
- make_cleanup_discard_minimal_symbols ();
+ cleanup_minimal_symbols = make_cleanup_discard_minimal_symbols ();
/* Now that the executable file is positioned at symbol table,
process it and define symbols accordingly. */
install_minimal_symbols (objfile);
+ /* Free the installed minimal symbol data. */
+ do_cleanups (cleanup_minimal_symbols);
+
bfd_map_over_sections (abfd, coff_locate_sections, (void *) info);
if (info->stabsects)
buildsym_new_init ();
free_header_files ();
init_header_files ();
- install_minimal_symbols (objfile);
processing_acc_compilation = 1;
/* In an elf file, we've already installed the minimal symbols that came
from the elf (non-stab) symbol table, so always act like an
- incremental load here. */
+ incremental load here. dbx_symfile_read should not generate any new
+ minimal symbols, since we will have already read the ELF dynamic symbol
+ table and normal symbol entries won't be in the ".stab" section; but in
+ case it does, it will install them itself. */
dbx_symfile_read (objfile, 0);
if (back_to)
buildsym_new_init ();
free_header_files ();
init_header_files ();
- install_minimal_symbols (objfile);
/* Now, do an incremental load */
elf_symtab_read (objfile, 1);
+ /* Install any minimal symbols that have been collected as the current
+ minimal symbols for this objfile. The debug readers below this point
+ should not generate new minimal symbols; if they do it's their
+ responsibility to install them. "mdebug" appears to be the only one
+ which will do this. */
+
+ install_minimal_symbols (objfile);
+ do_cleanups (back_to);
+
/* Now process debugging information, which is contained in
special ELF sections. */
if (DWARF2_BUILD_FRAME_INFO_P ())
DWARF2_BUILD_FRAME_INFO(objfile);
-
- /* Install any minimal symbols that have been collected as the current
- minimal symbols for this objfile. */
-
- install_minimal_symbols (objfile);
-
- do_cleanups (back_to);
}
/* This cleans up the objfile's sym_stab_info pointer, and the chain of
{
bfd *abfd = objfile->obfd;
struct ecoff_debug_info *info;
+ struct cleanup *back_to;
+
+ /* FIXME: It's not clear whether we should be getting minimal symbol
+ information from .mdebug in an ELF file, or whether we will.
+ Re-initialize the minimal symbol reader in case we do. */
+
+ init_minimal_symbol_collection ();
+ back_to = make_cleanup_discard_minimal_symbols ();
info = ((struct ecoff_debug_info *)
obstack_alloc (&objfile->psymbol_obstack,
bfd_errmsg (bfd_get_error ()));
mdebug_build_psymtabs (objfile, swap, info);
+
+ install_minimal_symbols (objfile);
+ do_cleanups (back_to);
}
\f
nlm_symtab_read (abfd, offset, objfile);
+ /* Install any minimal symbols that have been collected as the current
+ minimal symbols for this objfile. */
+
+ install_minimal_symbols (objfile);
+ do_cleanups (back_to);
+
stabsect_build_psymtabs (objfile, mainline, ".stab",
".stabstr", ".text");
/* FIXME: We could locate and read the optional native debugging format
here and add the symbols to the minimal symbol table. */
-
- /* Install any minimal symbols that have been collected as the current
- minimal symbols for this objfile. */
-
- install_minimal_symbols (objfile);
-
- do_cleanups (back_to);
}
som_symtab_read (abfd, objfile, objfile->section_offsets);
+ /* Install any minimal symbols that have been collected as the current
+ minimal symbols for this objfile.
+ Further symbol-reading is done incrementally, file-by-file,
+ in a step known as "psymtab-to-symtab" expansion. hp-symtab-read.c
+ contains the code to do the actual DNTT scanning and symtab building. */
+ install_minimal_symbols (objfile);
+ do_cleanups (back_to);
+
/* Now read information from the stabs debug sections.
This is a no-op for SOM.
Perhaps it is intended for some kind of mixed STABS/SOM
together with a scan of the GNTT. See hp-psymtab-read.c. */
hpread_build_psymtabs (objfile, mainline);
- /* Install any minimal symbols that have been collected as the current
- minimal symbols for this objfile.
- Further symbol-reading is done incrementally, file-by-file,
- in a step known as "psymtab-to-symtab" expansion. hp-symtab-read.c
- contains the code to do the actual DNTT scanning and symtab building. */
- install_minimal_symbols (objfile);
-
/* Force hppa-tdep.c to re-read the unwind descriptors. */
objfile->obj_private = NULL;
- do_cleanups (back_to);
}
/* Initialize anything that needs initializing when a completely new symbol