summaryrefslogtreecommitdiffstats
path: root/lld/COFF/PDB.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lld/COFF/PDB.cpp')
-rw-r--r--lld/COFF/PDB.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/lld/COFF/PDB.cpp b/lld/COFF/PDB.cpp
index 53f50f30095..283b75a9c20 100644
--- a/lld/COFF/PDB.cpp
+++ b/lld/COFF/PDB.cpp
@@ -19,6 +19,7 @@
#include "llvm/DebugInfo/PDB/Raw/PDBFileBuilder.h"
#include "llvm/DebugInfo/PDB/Raw/TpiStream.h"
#include "llvm/DebugInfo/PDB/Raw/TpiStreamBuilder.h"
+#include "llvm/Object/COFF.h"
#include "llvm/Support/Endian.h"
#include "llvm/Support/FileOutputBuffer.h"
#include <memory>
@@ -63,6 +64,14 @@ void coff::createPDB(StringRef Path, ArrayRef<uint8_t> SectionTable) {
auto &IpiBuilder = Builder.getIpiBuilder();
IpiBuilder.setVersionHeader(pdb::PdbTpiV80);
+ // Add Section Map stream.
+ ArrayRef<object::coff_section> Sections = {
+ (object::coff_section *)SectionTable.data(),
+ SectionTable.size() / sizeof(object::coff_section)};
+ std::vector<pdb::SecMapEntry> SectionMap =
+ pdb::DbiStreamBuilder::createSectionMap(Sections);
+ DbiBuilder.setSectionMap(SectionMap);
+
// Add COFF section header stream.
ExitOnErr(
DbiBuilder.addDbgStream(pdb::DbgHeaderType::SectionHdr, SectionTable));
OpenPOWER on IntegriCloud