aboutsummaryrefslogtreecommitdiff
path: root/gdb/objfiles.c
diff options
context:
space:
mode:
authorJohn Gilmore <gnu@cygnus>1992-06-13 07:24:30 +0000
committerJohn Gilmore <gnu@cygnus>1992-06-13 07:24:30 +0000
commit346168a2c65e34dc6f2d073bbc0d158fb1aaa219 (patch)
tree2c1e1d19d889426541c4be6d08b0e4e3d50d9c24 /gdb/objfiles.c
parent9342ecb9445e97793a516e97eff233e991b9d84d (diff)
downloadgdb-346168a2c65e34dc6f2d073bbc0d158fb1aaa219.zip
gdb-346168a2c65e34dc6f2d073bbc0d158fb1aaa219.tar.gz
gdb-346168a2c65e34dc6f2d073bbc0d158fb1aaa219.tar.bz2
* elfread.c (record_minimal_symbol_and_info): Kludged to put
extra info in the minimal symbol. (elf_symtab_read): The extra info is the size of an ELF object, which was kludged to us in the `udata' field of the BFD symbol. Gag me with a crowbar... (elf_symfile_read): Keep track of both the absolute load address, and the offset between load addr and symbols. Handle STABS as well as DWARF sections, passing the absolute load address to elfstab_build_psymtabs. * objfiles.c (free_objfile): Eliminate storage leaks. Contributed by <Peter.Schauer@regent.e-technik.tu-muenchen.dbp.de>. * symfile.c (symfile_bfd_open): Comment where name is freed. * symmisc.c (extend_psymbol_list): Comment where list is freed.
Diffstat (limited to 'gdb/objfiles.c')
-rw-r--r--gdb/objfiles.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/gdb/objfiles.c b/gdb/objfiles.c
index 1ad5d94..9b30c0f 100644
--- a/gdb/objfiles.c
+++ b/gdb/objfiles.c
@@ -267,15 +267,15 @@ free_objfile (objfile)
if (objfile -> obfd != NULL)
{
+ char *name = bfd_get_filename (objfile->obfd);
bfd_close (objfile -> obfd);
+ free (name);
}
/* Remove it from the chain of all objfiles. */
unlink_objfile (objfile);
-#if 0 /* FIXME!! */
-
/* Before the symbol table code was redone to make it easier to
selectively load and remove information particular to a specific
linkage unit, gdb used to do these things whenever the monolithic
@@ -289,8 +289,6 @@ free_objfile (objfile)
#endif
clear_pc_function_cache ();
-#endif
-
/* The last thing we do is free the objfile struct itself for the
non-reusable case, or detach from the mapped file for the reusable
case. Note that the mmalloc_detach or the mfree is the last thing
@@ -319,6 +317,10 @@ free_objfile (objfile)
{
mfree (objfile -> md, objfile -> name);
}
+ if (objfile->global_psymbols.list)
+ mfree (objfile->md, objfile->global_psymbols.list);
+ if (objfile->static_psymbols.list)
+ mfree (objfile->md, objfile->static_psymbols.list);
/* Free the obstacks for non-reusable objfiles */
obstack_free (&objfile -> psymbol_obstack, 0);
obstack_free (&objfile -> symbol_obstack, 0);