Index: lld/trunk/COFF/Writer.cpp =================================================================== --- lld/trunk/COFF/Writer.cpp +++ lld/trunk/COFF/Writer.cpp @@ -93,7 +93,8 @@ // variable sized field (PDB Path) auto *P = reinterpret_cast(B + OutputSectionOff + sizeof(*R)); - memcpy(P, Config->PDBPath.data(), Config->PDBPath.size()); + if (!Config->PDBPath.empty()) + memcpy(P, Config->PDBPath.data(), Config->PDBPath.size()); P[Config->PDBPath.size()] = '\0'; } };