2010-01-11 Tristan Gingold <gingold@adacore.com>
authorTristan Gingold <gingold@adacore.com>
Mon, 11 Jan 2010 15:29:36 +0000 (15:29 +0000)
committerTristan Gingold <gingold@adacore.com>
Mon, 11 Jan 2010 15:29:36 +0000 (15:29 +0000)
        * archive.c (bfd_slurp_armap): Also check for Mach-O sorted armap.

bfd/ChangeLog
bfd/archive.c

index 5c5e01bccf92c8cda3982ca4bf3aa88322b71b29..aaf318611fac8ff927a7f624c49849f1fb41991a 100644 (file)
@@ -1,3 +1,7 @@
+2010-01-11  Tristan Gingold  <gingold@adacore.com>
+
+        * archive.c (bfd_slurp_armap): Also check for Mach-O sorted armap.
+
 2010-01-11  Nick Clifton  <nickc@redhat.com>
 
        * elf32-v850.c (v850_elf_perform_relocation): Fix overflow
index 6ba743cf5a9d23d22b6f691cf6bc7cedd4368fe5..321337eaac6acc1d8f0535ad538df2742ca3c714 100644 (file)
@@ -1054,6 +1054,24 @@ bfd_slurp_armap (bfd *abfd)
       return FALSE;
 #endif
     }
+  else if (CONST_STRNEQ (nextname, "#1/20           "))
+    {
+      /* Mach-O has a special name for armap when the map is sorted by name.
+         However because this name has a space it is slightly more difficult
+         to check it.  */
+      struct ar_hdr hdr;
+      char extname[21];
+
+      if (bfd_bread (&hdr, sizeof (hdr), abfd) != sizeof (hdr))
+        return FALSE;
+      /* Read the extended name.  We know its length.  */
+      if (bfd_bread (extname, 20, abfd) != 20)
+        return FALSE;
+      if (bfd_seek (abfd, (file_ptr) -(sizeof (hdr) + 20), SEEK_CUR) != 0)
+        return FALSE;
+      if (CONST_STRNEQ (extname, "__.SYMDEF SORTED"))
+        return do_slurp_bsd_armap (abfd);
+    }
 
   bfd_has_map (abfd) = FALSE;
   return TRUE;
This page took 0.04017 seconds and 4 git commands to generate.