This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Odd crash with strip
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: "R.K." <reikku at earthlink dot net>, binutils at sources dot redhat dot com, bug-binutils at gnu dot org
- Date: Wed, 11 Jan 2006 08:58:33 +1030
- Subject: Re: Odd crash with strip
- References: <20060110014234.7ccfc68d.reikku@earthlink.net> <20060110221353.GA431@bubble.grove.modra.org>
On Wed, Jan 11, 2006 at 08:43:53AM +1030, Alan Modra wrote:
> * objcopy.c (copy_object): Set isympp and osympp to NULL after free.
Reviewing my own patch before committing would have been better..
There was a good reason why the test is "osympp != isympp" rather than
"osympp != NULL", and changing isympp too early breaks this test.
* objcopy.c (copy_object): Fix thinko.
Index: binutils/objcopy.c
===================================================================
RCS file: /cvs/src/src/binutils/objcopy.c,v
retrieving revision 1.91
diff -u -p -r1.91 objcopy.c
--- binutils/objcopy.c 10 Jan 2006 22:14:18 -0000 1.91
+++ binutils/objcopy.c 10 Jan 2006 22:24:01 -0000
@@ -1281,16 +1281,13 @@ copy_object (bfd *ibfd, bfd *obfd)
}
if (isympp)
- {
- free (isympp);
- isympp = NULL;
- }
+ free (isympp);
if (osympp != isympp)
- {
- free (osympp);
- osympp = NULL;
- }
+ free (osympp);
+
+ isympp = NULL;
+ osympp = NULL;
/* BFD mandates that all output sections be created and sizes set before
any output is done. Thus, we traverse all sections multiple times. */
--
Alan Modra
IBM OzLabs - Linux Technology Centre