This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Fix immediate Darwin gdb crash
On Tue, Oct 23, 2012 at 12:17:02PM +1030, Alan Modra wrote:
> On Mon, Oct 22, 2012 at 10:50:54AM -0400, Josh Matthews wrote:
> > --- a/bfd/mach-o.c
> > +++ b/bfd/mach-o.c
> > @@ -4863,6 +4863,10 @@ bfd_mach_o_close_and_cleanup (bfd *abfd)
> > free (dsym_filename);
> > }
> > }
> > + else if (bfd_get_format (abfd) == bfd_archive)
> > + {
> > + abfd->tdata.mach_o_fat_data = NULL;
>
> I think the correct patch is to simply return here. Reason: mach-o.c
> seems to not support archives, at least, tdata is not the correct
> struct artdata. So no function in archive.c that looks at struct
> artdata can be called.
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);
--
Alan Modra
Australia Development Lab, IBM