aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Support
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2013-11-15 21:22:02 +0000
committerRui Ueyama <ruiu@google.com>2013-11-15 21:22:02 +0000
commit8a631b2cbe2f8621eb3679a4898205da577453b7 (patch)
tree54ce815755814be364f60b3263be96586ba52112 /lib/Support
parent0cbdb81de76274c3f1731d92dc09864d2277d690 (diff)
downloadexternal_llvm-8a631b2cbe2f8621eb3679a4898205da577453b7.zip
external_llvm-8a631b2cbe2f8621eb3679a4898205da577453b7.tar.gz
external_llvm-8a631b2cbe2f8621eb3679a4898205da577453b7.tar.bz2
Path: Recognize COFF import library file magic.
Summary: Make identify_magic to recognize COFF import file. Reviewers: Bigcheese CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2165 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194852 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support')
-rw-r--r--lib/Support/Path.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Support/Path.cpp b/lib/Support/Path.cpp
index dfa18aa..c869b30 100644
--- a/lib/Support/Path.cpp
+++ b/lib/Support/Path.cpp
@@ -848,6 +848,10 @@ error_code has_magic(const Twine &path, const Twine &magic, bool &result) {
return file_magic::unknown;
switch ((unsigned char)Magic[0]) {
case 0x00: {
+ // COFF short import library file
+ if (Magic[1] == (char)0x00 && Magic[2] == (char)0xff &&
+ Magic[3] == (char)0xff)
+ return file_magic::coff_import_library;
// Windows resource file
const char Expected[] = { 0, 0, 0, 0, '\x20', 0, 0, 0, '\xff' };
if (Magic.size() >= sizeof(Expected) &&