aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@gnat.com>2011-05-03 16:22:39 +0000
committerJoel Brobecker <brobecker@gnat.com>2011-05-03 16:22:39 +0000
commitdd3295eed0cca68ab628d4aa8224935ee03f3acb (patch)
tree80edc1d57948ce6d05f944ff4aca94e40ed38123 /gdb
parent9ed350ad08d99ba48448acdc7cd917d75e5f4159 (diff)
downloadgdb-dd3295eed0cca68ab628d4aa8224935ee03f3acb.zip
gdb-dd3295eed0cca68ab628d4aa8224935ee03f3acb.tar.gz
gdb-dd3295eed0cca68ab628d4aa8224935ee03f3acb.tar.bz2
Revert "elfread.c (elf_symtab_read): Stop memory leak"
It turns out that this change is not correct, and it causes a crash on sparc-solaris while trying to load ld.so. This is because the memory is actually still referenced after elf_symtab_read completes. gdb/ChangeLog: * elfread.c (elf_symtab_read): Revert the previous change that tried to stop a memory leak.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/elfread.c3
2 files changed, 6 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 2422cad..6d6cac6 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,9 @@
+2011-05-03 Joel Brobecker <brobecker@adacore.com>
+
+ Revert:
+ | 2011-03-07 Michael Snyder <msnyder@vmware.com>
+ | * elfread.c (elf_symtab_read): Stop memory leak.
+
2011-05-03 Pierre Muller <muller@ics.u-strasbg.fr>
* nto-tdep.c (nto_target): Replace deprecated call to
diff --git a/gdb/elfread.c b/gdb/elfread.c
index d3050cc..6c6a7af 100644
--- a/gdb/elfread.c
+++ b/gdb/elfread.c
@@ -257,7 +257,6 @@ elf_symtab_read (struct objfile *objfile, int type,
char *filesymname = "";
struct dbx_symfile_info *dbx = objfile->deprecated_sym_stab_info;
int stripped = (bfd_get_symcount (objfile->obfd) == 0);
- struct cleanup *back_to = make_cleanup (null_cleanup, NULL);
for (i = 0; i < number_of_symbols; i++)
{
@@ -486,7 +485,6 @@ elf_symtab_read (struct objfile *objfile, int type,
+ (sizeof (CORE_ADDR) * max_index));
sectinfo = (struct stab_section_info *)
xmalloc (size);
- make_cleanup (xfree, sectinfo);
memset (sectinfo, 0, size);
sectinfo->num_sections = max_index;
if (filesym == NULL)
@@ -595,7 +593,6 @@ elf_symtab_read (struct objfile *objfile, int type,
}
}
}
- do_cleanups (back_to);
}
/* Build minimal symbols named `function@got.plt' (see SYMBOL_GOT_PLT_SUFFIX)