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: Fix immediate Darwin gdb crash


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


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