gas: detect DCTI couples in sparc
[deliverable/binutils-gdb.git] / bfd / mach-o.c
index bbd8d1e862896604f6f6405969955454f045f2d3..16099803ff5e550ea769e4b1e7511d33042d3ff6 100644 (file)
@@ -1,5 +1,5 @@
 /* Mach-O support for BFD.
-   Copyright (C) 1999-2015 Free Software Foundation, Inc.
+   Copyright (C) 1999-2016 Free Software Foundation, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
 
@@ -5708,7 +5708,7 @@ bfd_mach_o_follow_dsym (bfd *abfd)
   if (abfd == NULL || bfd_get_flavour (abfd) != bfd_target_mach_o_flavour)
     return NULL;
 
-  if (abfd->my_archive)
+  if (abfd->my_archive && !bfd_is_thin_archive (abfd->my_archive))
     base_bfd = abfd->my_archive;
   /* BFD may have been opened from a stream. */
   if (base_bfd->filename == NULL)
@@ -5798,14 +5798,26 @@ bfd_mach_o_close_and_cleanup (bfd *abfd)
       if (mdata->dsym_bfd != NULL)
         {
           bfd *fat_bfd = mdata->dsym_bfd->my_archive;
+#if 0
+         /* FIXME: PR 19435: This calculation to find the memory allocated by
+            bfd_mach_o_follow_dsym for the filename does not always end up
+            selecting the correct pointer.  Unfortunately this problem is
+            very hard to reproduce on a non Mach-O native system, so until it
+            can be traced and fixed on such a system, this code will remain
+            commented out.  This does mean that there will be a memory leak,
+            but it is small, and happens when we are closing down, so it
+            should not matter too much.  */
           char *dsym_filename = (char *)(fat_bfd
                                          ? fat_bfd->filename
                                          : mdata->dsym_bfd->filename);
+#endif
           bfd_close (mdata->dsym_bfd);
           mdata->dsym_bfd = NULL;
           if (fat_bfd)
             bfd_close (fat_bfd);
+#if 0
           free (dsym_filename);
+#endif
         }
     }
 
This page took 0.027209 seconds and 4 git commands to generate.