This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: objdump segfault


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]