diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2013-07-10 22:07:59 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2013-07-10 22:07:59 +0000 |
commit | 555099207b0bca5da5a127580e8909d2a477f281 (patch) | |
tree | 0cb56b72793ed0dd4882754a92b413247fae233d /llvm/lib/Object/Archive.cpp | |
parent | 7a73449b318225963dd9ceb4f75afe242ff21984 (diff) | |
download | bcm5719-llvm-555099207b0bca5da5a127580e8909d2a477f281.tar.gz bcm5719-llvm-555099207b0bca5da5a127580e8909d2a477f281.zip |
Find the symbol table on archives created on OS X.
llvm-svn: 186041
Diffstat (limited to 'llvm/lib/Object/Archive.cpp')
-rw-r--r-- | llvm/lib/Object/Archive.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/llvm/lib/Object/Archive.cpp b/llvm/lib/Object/Archive.cpp index 91cc4efde22..60c6d21f482 100644 --- a/llvm/lib/Object/Archive.cpp +++ b/llvm/lib/Object/Archive.cpp @@ -236,9 +236,9 @@ Archive::Archive(MemoryBuffer *source, error_code &ec) // Second member : // (may exist, if it exists, points to the string table) // Note : The string table is used if the filename exceeds 15 characters // BSD archive format - // First member : __.SYMDEF (points to the symbol table) - // There is no string table, if the filename exceeds 15 characters or has a - // embedded space, the filename has #1/<size>, The size represents the size + // First member : __.SYMDEF or "__.SYMDEF SORTED" (the symbol table) + // There is no string table, if the filename exceeds 15 characters or has a + // embedded space, the filename has #1/<size>, The size represents the size // of the filename that needs to be read after the archive header // COFF archive format // First member : / @@ -256,6 +256,17 @@ Archive::Archive(MemoryBuffer *source, error_code &ec) return; } + if (Name.startswith("#1/")) { + Format = K_BSD; + // We know this is BSD, so getName will work since there is no string table. + ec = i->getName(Name); + if (ec) + return; + if (Name == StringRef("__.SYMDEF SORTED\0\0\0", 20)) + SymbolTable = i; + return; + } + if (Name == "/") { SymbolTable = i; |