diff options
author | Zachary Turner <zturner@google.com> | 2018-03-07 18:40:41 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2018-03-07 18:40:41 +0000 |
commit | d860fa6400e8207b1d68745cd6340ace0b70d7b4 (patch) | |
tree | 3d7d9bd07f3274982e0c3b348e480f53f875d855 /llvm/lib/BinaryFormat/Magic.cpp | |
parent | f8c2dce236c54db72f8d51bdde6ac3d13f4850c9 (diff) | |
download | bcm5719-llvm-d860fa6400e8207b1d68745cd6340ace0b70d7b4.tar.gz bcm5719-llvm-d860fa6400e8207b1d68745cd6340ace0b70d7b4.zip |
Teach identify_file_magic to identify PDB files.
llvm-svn: 326924
Diffstat (limited to 'llvm/lib/BinaryFormat/Magic.cpp')
-rw-r--r-- | llvm/lib/BinaryFormat/Magic.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/BinaryFormat/Magic.cpp b/llvm/lib/BinaryFormat/Magic.cpp index 42546eaa732..22ea2280433 100644 --- a/llvm/lib/BinaryFormat/Magic.cpp +++ b/llvm/lib/BinaryFormat/Magic.cpp @@ -181,7 +181,7 @@ file_magic llvm::identify_magic(StringRef Magic) { return file_magic::coff_object; break; - case 'M': // Possible MS-DOS stub on Windows PE file + case 'M': // Possible MS-DOS stub on Windows PE file or MSF/PDB file. if (startswith(Magic, "MZ") && Magic.size() >= 0x3c + 4) { uint32_t off = read32le(Magic.data() + 0x3c); // PE/COFF file, either EXE or DLL. @@ -189,6 +189,8 @@ file_magic llvm::identify_magic(StringRef Magic) { StringRef(COFF::PEMagic, sizeof(COFF::PEMagic)))) return file_magic::pecoff_executable; } + if (Magic.startswith("Microsoft C/C++ MSF 7.00\r\n")) + return file_magic::pdb; break; case 0x64: // x86-64 or ARM64 Windows. |