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
This commit is contained in:
Rui Ueyama 2015-07-28 01:06:58 +00:00
parent 35959592a3
commit 2832ce95a5
1 changed files with 4 additions and 0 deletions

View File

@ -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;