COFF: Skip non-DWARF debug info sections.
Leaving them in an executable is basically harmless but wastes disk space.
Because no one is using non-DWARF debug info linked by LLD, we can just
remove them.
llvm-svn: 243364
diff --git a/lld/COFF/InputFiles.cpp b/lld/COFF/InputFiles.cpp
index e9008d0..6bb1246 100644
--- a/lld/COFF/InputFiles.cpp
+++ b/lld/COFF/InputFiles.cpp
@@ -145,6 +145,10 @@
Directives = std::string((const char *)Data.data(), Data.size());
continue;
}
+ // Skip non-DWARF debug info. MSVC linker converts the sections into
+ // a PDB file, but we don't support that.
+ if (Name == ".debug" || Name.startswith(".debug$"))
+ continue;
// We want to preserve DWARF debug sections only when /debug is on.
if (!Config->Debug && Name.startswith(".debug"))
continue;