diff options
author | Rui Ueyama <ruiu@google.com> | 2013-11-14 22:09:08 +0000 |
---|---|---|
committer | Rui Ueyama <ruiu@google.com> | 2013-11-14 22:09:08 +0000 |
commit | b850a05f2c914fef74dbafbf61470512a976c632 (patch) | |
tree | 182add9a77e395b70dc4faedcccbac6f4f581a9b /lib/Support/Path.cpp | |
parent | 6a1a5e94e2b094aead41f171ee060d91ad25777c (diff) | |
download | llvm-b850a05f2c914fef74dbafbf61470512a976c632.tar.gz llvm-b850a05f2c914fef74dbafbf61470512a976c632.tar.bz2 llvm-b850a05f2c914fef74dbafbf61470512a976c632.tar.xz |
Recognize 0x0000 as a COFF file magic.
Summary:
Some machine-type-neutral object files containing only undefined symbols
actually do exist in the Windows standard library. Need to recognize them
as COFF files.
Reviewers: Bigcheese
CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D2164
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194734 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/Path.cpp')
-rw-r--r-- | lib/Support/Path.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Support/Path.cpp b/lib/Support/Path.cpp index 7fc9ab8967..dfa18aaa6d 100644 --- a/lib/Support/Path.cpp +++ b/lib/Support/Path.cpp @@ -853,6 +853,9 @@ error_code has_magic(const Twine &path, const Twine &magic, bool &result) { if (Magic.size() >= sizeof(Expected) && memcmp(Magic.data(), Expected, sizeof(Expected)) == 0) return file_magic::windows_resource; + // 0x0000 = COFF unknown machine type + if (Magic[1] == 0) + return file_magic::coff_object; break; } case 0xDE: // 0x0B17C0DE = BC wraper |