diff options
author | Eric Beckmann <ecbeckmann@google.com> | 2017-07-01 03:59:54 +0000 |
---|---|---|
committer | Eric Beckmann <ecbeckmann@google.com> | 2017-07-01 03:59:54 +0000 |
commit | 602afcf7e9865ae3db0e7399e1b3f14a90718a73 (patch) | |
tree | 933c15cb78538116c363994345a88f4e4a54b36e /llvm/lib/BinaryFormat/Magic.cpp | |
parent | d29d3da349dabcdd2568b56ca93f726e8d827a4a (diff) | |
download | bcm5719-llvm-602afcf7e9865ae3db0e7399e1b3f14a90718a73.tar.gz bcm5719-llvm-602afcf7e9865ae3db0e7399e1b3f14a90718a73.zip |
Revert "Revert "Replace trivial use of external rc.exe by writing our own .res file.""
Summary:
This reverts commit 51931072a7c9a52540baf76fc30ef391d2529a2f.
This revert was originally done because the integrations of the new
WindowsResource library into LLD was causing error in chromium, due to
bugs in how resource sections were handled. These bugs were fixed,
meaning that the features may be reintegrated.
Subscribers: hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D34922
llvm-svn: 306941
Diffstat (limited to 'llvm/lib/BinaryFormat/Magic.cpp')
-rw-r--r-- | llvm/lib/BinaryFormat/Magic.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/BinaryFormat/Magic.cpp b/llvm/lib/BinaryFormat/Magic.cpp index 5d0a71fc780..b19a07a9066 100644 --- a/llvm/lib/BinaryFormat/Magic.cpp +++ b/llvm/lib/BinaryFormat/Magic.cpp @@ -51,7 +51,8 @@ file_magic llvm::identify_magic(StringRef Magic) { return file_magic::coff_import_library; } // Windows resource file - if (startswith(Magic, "\0\0\0\0\x20\0\0\0\xFF")) + if (Magic.size() >= sizeof(COFF::WinResMagic) && + memcmp(Magic.data(), COFF::WinResMagic, sizeof(COFF::WinResMagic)) == 0) return file_magic::windows_resource; // 0x0000 = COFF unknown machine type if (Magic[1] == 0) |