summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/PDB
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/DebugInfo/PDB')
-rw-r--r--llvm/lib/DebugInfo/PDB/Native/GSIStreamBuilder.cpp21
-rw-r--r--llvm/lib/DebugInfo/PDB/Native/PublicsStream.cpp7
2 files changed, 11 insertions, 17 deletions
diff --git a/llvm/lib/DebugInfo/PDB/Native/GSIStreamBuilder.cpp b/llvm/lib/DebugInfo/PDB/Native/GSIStreamBuilder.cpp
index eb7a0bbcc3d..46951a0b88e 100644
--- a/llvm/lib/DebugInfo/PDB/Native/GSIStreamBuilder.cpp
+++ b/llvm/lib/DebugInfo/PDB/Native/GSIStreamBuilder.cpp
@@ -153,7 +153,6 @@ Error GSIStreamBuilder::finalizeMsfLayout() {
if (!Idx)
return Idx.takeError();
PSH->StreamIndex = *Idx;
-
Idx = Msf.addStream(calculateGlobalsHashStreamSize());
if (!Idx)
return Idx.takeError();
@@ -253,32 +252,22 @@ Error GSIStreamBuilder::commitSymbolRecordStream(
Error GSIStreamBuilder::commitPublicsHashStream(
WritableBinaryStreamRef Stream) {
- // Skip the publics stream header so that we can write the GSH header first.
- // Then seek back to the beginning and update the publics stream header with
- // the byte offset after the GSH header.
BinaryStreamWriter Writer(Stream);
- Writer.setOffset(sizeof(PublicsStreamHeader));
-
- if (auto EC = PSH->commit(Writer))
- return EC;
- uint32_t OffsetAfterGSIHashes = Writer.getOffset();
-
- Writer.setOffset(0);
-
- // FIXME: Fill these in. They are for incremental linking.
PublicsStreamHeader Header;
- Header.AddrMap = PSH->Records.size() * 4;
+ // FIXME: Fill these in. They are for incremental linking.
Header.NumThunks = 0;
Header.SizeOfThunk = 0;
Header.ISectThunkTable = 0;
Header.OffThunkTable = 0;
Header.NumSections = 0;
- Header.SymHash = OffsetAfterGSIHashes;
+ Header.SymHash = PSH->calculateSerializedLength();
+ Header.AddrMap = PSH->Records.size() * 4;
if (auto EC = Writer.writeObject(Header))
return EC;
- Writer.setOffset(OffsetAfterGSIHashes);
+ if (auto EC = PSH->commit(Writer))
+ return EC;
std::vector<ulittle32_t> AddrMap = computeAddrMap(PSH->Records);
if (auto EC = Writer.writeArray(makeArrayRef(AddrMap)))
diff --git a/llvm/lib/DebugInfo/PDB/Native/PublicsStream.cpp b/llvm/lib/DebugInfo/PDB/Native/PublicsStream.cpp
index c716720b5a7..a3a44ceddca 100644
--- a/llvm/lib/DebugInfo/PDB/Native/PublicsStream.cpp
+++ b/llvm/lib/DebugInfo/PDB/Native/PublicsStream.cpp
@@ -46,7 +46,12 @@ PublicsStream::PublicsStream(std::unique_ptr<MappedBlockStream> Stream)
PublicsStream::~PublicsStream() = default;
uint32_t PublicsStream::getSymHash() const { return Header->SymHash; }
-uint32_t PublicsStream::getAddrMap() const { return Header->AddrMap; }
+uint16_t PublicsStream::getThunkTableSection() const {
+ return Header->ISectThunkTable;
+}
+uint32_t PublicsStream::getThunkTableOffset() const {
+ return Header->OffThunkTable;
+}
// Publics stream contains fixed-size headers and a serialized hash table.
// This implementation is not complete yet. It reads till the end of the
OpenPOWER on IntegriCloud