summaryrefslogtreecommitdiffstats
path: root/llvm/lib/BinaryFormat/Magic.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/BinaryFormat/Magic.cpp')
-rw-r--r--llvm/lib/BinaryFormat/Magic.cpp4
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.
OpenPOWER on IntegriCloud