Re-submit r283825: Add section header stream to PDB.
It was reverted because the change that depends on was reverted.
Now it was submitted as r283925, so we can submit this as well.
llvm-svn: 283926
diff --git a/lld/COFF/PDB.cpp b/lld/COFF/PDB.cpp
index bbc8296..53f50f3 100644
--- a/lld/COFF/PDB.cpp
+++ b/lld/COFF/PDB.cpp
@@ -30,7 +30,7 @@
static ExitOnError ExitOnErr;
-void coff::createPDB(StringRef Path) {
+void coff::createPDB(StringRef Path, ArrayRef<uint8_t> SectionTable) {
BumpPtrAllocator Alloc;
pdb::PDBFileBuilder Builder(Alloc);
ExitOnErr(Builder.initialize(4096)); // 4096 is blocksize
@@ -63,6 +63,10 @@
auto &IpiBuilder = Builder.getIpiBuilder();
IpiBuilder.setVersionHeader(pdb::PdbTpiV80);
+ // Add COFF section header stream.
+ ExitOnErr(
+ DbiBuilder.addDbgStream(pdb::DbgHeaderType::SectionHdr, SectionTable));
+
// Write to a file.
ExitOnErr(Builder.commit(Path));
}