From 2832ce95a50e2f6702c40bcc7a703b0b59ca9969 Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Tue, 28 Jul 2015 01:06:58 +0000 Subject: [PATCH] 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 --- lld/COFF/InputFiles.cpp | 4 ++++ 1 file changed, 4 insertions(+) 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 @@ std::error_code ObjectFile::initializeChunks() { 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; -- 2.7.4