[PATCH] D33302: Don't output a PDB unless /DEBUG is specified

Zachary Turner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 17 15:59:53 PDT 2017


zturner created this revision.

Without this, someone can write `lld-link.exe /OUT:foo.exe /OUT:foo.pdb foo.obj` and it will generate a PDB.  But it's not a very useful PDB, because `.debug$S` and `.debug$T` information is not put into the PDB unless `/DEBUG` is also specified from the command line.  So, if `/DEBUG` is not specified, don't output anything.


https://reviews.llvm.org/D33302

Files:
  lld/COFF/Writer.cpp


Index: lld/COFF/Writer.cpp
===================================================================
--- lld/COFF/Writer.cpp
+++ lld/COFF/Writer.cpp
@@ -258,7 +258,7 @@
   sortExceptionTable();
   writeBuildId();
 
-  if (!Config->PDBPath.empty()) {
+  if (!Config->PDBPath.empty() && Config->Debug) {
     const llvm::codeview::DebugInfo *DI = nullptr;
     if (Config->DebugTypes & static_cast<unsigned>(coff::DebugType::CV))
       DI = BuildId->DI;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33302.99359.patch
Type: text/x-patch
Size: 447 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170517/f768ed59/attachment.bin>


More information about the llvm-commits mailing list