diff options
| author | Nick Kledzik <kledzik@apple.com> | 2014-11-12 01:37:45 +0000 |
|---|---|---|
| committer | Nick Kledzik <kledzik@apple.com> | 2014-11-12 01:37:45 +0000 |
| commit | f44dbda5427bcbdcb7f2c22c57bff8f901ff515a (patch) | |
| tree | 66988d180aabd49b50fd4e271b92f08499e21fcc /llvm | |
| parent | 35a12a85a174f9e61dbe34048b6370a6aeb1a3d5 (diff) | |
| download | bcm5719-llvm-f44dbda5427bcbdcb7f2c22c57bff8f901ff515a.tar.gz bcm5719-llvm-f44dbda5427bcbdcb7f2c22c57bff8f901ff515a.zip | |
Object, support both mach-o archive t.o.c file names
For historical reasons archives on mach-o have two possible names for the
file containing the table of contents for the archive: "__.SYMDEF SORTED"
and "__.SYMDEF". But the libObject archive reader only supported the former.
This patch fixes llvm::object::Archive to support both names.
llvm-svn: 221747
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/lib/Object/Archive.cpp | 2 | ||||
| -rw-r--r-- | llvm/test/Object/Inputs/macho-archive-unsorted-x86_64.a | bin | 0 -> 1304 bytes | |||
| -rw-r--r-- | llvm/test/Object/archive-symtab.test | 1 |
3 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Object/Archive.cpp b/llvm/lib/Object/Archive.cpp index 070fe812eec..d169dbee46e 100644 --- a/llvm/lib/Object/Archive.cpp +++ b/llvm/lib/Object/Archive.cpp @@ -240,7 +240,7 @@ Archive::Archive(MemoryBufferRef Source, std::error_code &ec) if (ec) return; Name = NameOrErr.get(); - if (Name == "__.SYMDEF SORTED") { + if (Name == "__.SYMDEF SORTED" || Name == "__.SYMDEF") { SymbolTable = i; ++i; } diff --git a/llvm/test/Object/Inputs/macho-archive-unsorted-x86_64.a b/llvm/test/Object/Inputs/macho-archive-unsorted-x86_64.a Binary files differnew file mode 100644 index 00000000000..6a2b570f160 --- /dev/null +++ b/llvm/test/Object/Inputs/macho-archive-unsorted-x86_64.a diff --git a/llvm/test/Object/archive-symtab.test b/llvm/test/Object/archive-symtab.test index 0899828bdfb..01f17bcc8b6 100644 --- a/llvm/test/Object/archive-symtab.test +++ b/llvm/test/Object/archive-symtab.test @@ -61,6 +61,7 @@ RUN: llvm-ranlib %t.a RUN: llvm-nm -M %t.a | FileCheck %s RUN: llvm-nm -M %p/Inputs/macho-archive-x86_64.a | FileCheck %s --check-prefix=BSD-MachO +RUN: llvm-nm -M %p/Inputs/macho-archive-unsorted-x86_64.a | FileCheck %s --check-prefix=BSD-MachO BSD-MachO: Archive map BSD-MachO: _bar in bar.o |

