This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: objdump segfault
- From: Alan Modra <amodra at gmail dot com>
- To: NightStrike <nightstrike at gmail dot com>
- Cc: binutils <binutils at sourceware dot org>
- Date: Mon, 15 Apr 2013 10:15:59 +0930
- Subject: Re: objdump segfault
- References: <CAF1jjLsmfY1vRQhWQ6HeeWO_4BEGwVvJtBPB2UhGGrmazpnBDQ at mail dot gmail dot com>
On Sun, Apr 14, 2013 at 06:01:14AM -1000, NightStrike wrote:
> If I use ar to add one archive to another, followed by a ranlib, an
> objdump on the subsequent archive segfaults.
We were attempting to close the archive twice, due to a bug in
_bfd_archive_close_and_cleanup. I think this should fix it.
* archive.c (_bfd_archive_close_and_cleanup): Clear parent
cache slot for archives.
Index: bfd/archive.c
===================================================================
RCS file: /cvs/src/src/bfd/archive.c,v
retrieving revision 1.98
diff -u -p -r1.98 archive.c
--- bfd/archive.c 15 Feb 2013 18:26:06 -0000 1.98
+++ bfd/archive.c 15 Apr 2013 00:28:20 -0000
@@ -2732,7 +2732,7 @@ _bfd_archive_close_and_cleanup (bfd *abf
bfd_ardata (abfd)->cache = NULL;
}
}
- else if (arch_eltdata (abfd) != NULL)
+ if (arch_eltdata (abfd) != NULL)
{
struct areltdata *ared = arch_eltdata (abfd);
htab_t htab = (htab_t) ared->parent_cache;
--
Alan Modra
Australia Development Lab, IBM