mirror of
https://github.com/RPCSX/llvm.git
synced 2024-11-24 12:19:53 +00:00
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221747 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
dc70865b5b
commit
9abbcb7453
@ -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;
|
||||
}
|
||||
|
BIN
test/Object/Inputs/macho-archive-unsorted-x86_64.a
Normal file
BIN
test/Object/Inputs/macho-archive-unsorted-x86_64.a
Normal file
Binary file not shown.
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user