This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
[rfa] Revert the problematic free()
- From: Andrew Cagney <ac131313 at redhat dot com>
- To: binutils at sources dot redhat dot com
- Date: Sat, 05 Apr 2003 09:36:58 -0500
- Subject: [rfa] Revert the problematic free()
Hello,
The attached disables the free() that is causing GDB vs BFD vs STABS
memory corruption bugs. It isn't that much of a disaster as it is
simply restoring the previous behavior.
ok?
Andrew
2003-04-05 Andrew Cagney <cagney at redhat dot com>
* simple.c (bfd_simple_get_relocated_section_contents): Disable
free that leads to GDB vs BFD memory corruption.
Index: simple.c
===================================================================
RCS file: /cvs/src/src/bfd/simple.c,v
retrieving revision 1.7
diff -u -r1.7 simple.c
--- simple.c 1 Apr 2003 00:12:12 -0000 1.7
+++ simple.c 5 Apr 2003 14:31:32 -0000
@@ -261,8 +261,19 @@
if (contents == NULL && data != NULL)
free (data);
+#if 0
+ /* NOTE: cagney/2003-04-05: This free, which was introduced on
+ 2003-03-31 to stop a memory leak, caused a memory corruption
+ between GDB and BFD. The problem, which is stabs specific, can
+ be identified by a bunch of failures in relocate.exp vis:
+
+ gdb.base/relocate.exp: get address of static_bar
+
+ Details of the problem can be found on the binutils@ mailing
+ list, see the discussion thread: "gdb.mi/mi-cli.exp failures". */
if (storage_needed != 0)
free (symbol_table);
+#endif
bfd_map_over_sections (abfd, simple_restore_output_info, saved_offsets);
free (saved_offsets);