This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Fix immediate Darwin gdb crash
- From: Alan Modra <amodra at gmail dot com>
- To: Josh Matthews <josh at joshmatthews dot net>, binutils at sourceware dot org
- Date: Tue, 6 Nov 2012 17:14:11 +1030
- Subject: Re: Fix immediate Darwin gdb crash
- References: <CAOvJiVXv8c1UW=BELYxVZxi6x4bSrBbFY5VsX=4HTJxA--9HeQ@mail.gmail.com> <20121023014702.GT3263@bubble.grove.modra.org> <20121023023502.GU3263@bubble.grove.modra.org>
On Tue, Oct 23, 2012 at 01:05:02PM +1030, Alan Modra wrote:
> That isn't quite correct. binutils built for mach-o does support
> archives but not when using mach_o_fat_vec. For mach_o_fat_vec, no
> function in archive.c should be called. Try this:
>
> if (bfd_get_format (abfd) != bfd_archive
> || abfd->xvec != &mach_o_fat_vec)
> return _bfd_generic_close_and_cleanup (abfd);
Committed.
* mach-o.c (bfd_mach_o_close_and_cleanup): Don't call
_bfd_generic_close_and_cleanup for mach_o_fat archives.
Index: bfd/mach-o.c
===================================================================
RCS file: /cvs/src/src/bfd/mach-o.c,v
retrieving revision 1.104
diff -u -p -r1.104 mach-o.c
--- bfd/mach-o.c 20 Aug 2012 14:32:31 -0000 1.104
+++ bfd/mach-o.c 6 Nov 2012 01:52:14 -0000
@@ -4864,6 +4864,9 @@ bfd_mach_o_close_and_cleanup (bfd *abfd)
}
}
+ if (bfd_get_format (abfd) == bfd_archive
+ && abfd->xvec == &mach_o_fat_vec)
+ return TRUE;
return _bfd_generic_close_and_cleanup (abfd);
}
--
Alan Modra
Australia Development Lab, IBM