aboutsummaryrefslogtreecommitdiff
path: root/gdb/coffread.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/coffread.c')
-rw-r--r--gdb/coffread.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gdb/coffread.c b/gdb/coffread.c
index 912943c..db41896 100644
--- a/gdb/coffread.c
+++ b/gdb/coffread.c
@@ -518,7 +518,7 @@ coff_symfile_read (struct objfile *objfile, int mainline)
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;
@@ -598,7 +598,7 @@ coff_symfile_read (struct objfile *objfile, int mainline)
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. */
@@ -619,6 +619,9 @@ coff_symfile_read (struct objfile *objfile, int mainline)
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)