diff options
author | Tristan Gingold <gingold@adacore.com> | 2010-01-11 15:29:36 +0000 |
---|---|---|
committer | Tristan Gingold <gingold@adacore.com> | 2010-01-11 15:29:36 +0000 |
commit | cba0723b0f0fb521d83dc1d7cd1cdcdb4991dd02 (patch) | |
tree | eefd17d4349cf94842891dc539c03d9073ccae8c /bfd/archive.c | |
parent | 2c610e4b46f46d5ca5aa0982051791dcbea0f67e (diff) | |
download | gdb-cba0723b0f0fb521d83dc1d7cd1cdcdb4991dd02.zip gdb-cba0723b0f0fb521d83dc1d7cd1cdcdb4991dd02.tar.gz gdb-cba0723b0f0fb521d83dc1d7cd1cdcdb4991dd02.tar.bz2 |
2010-01-11 Tristan Gingold <gingold@adacore.com>
* archive.c (bfd_slurp_armap): Also check for Mach-O sorted armap.
Diffstat (limited to 'bfd/archive.c')
-rw-r--r-- | bfd/archive.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/bfd/archive.c b/bfd/archive.c index 6ba743c..321337e 100644 --- a/bfd/archive.c +++ b/bfd/archive.c @@ -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; |