summaryrefslogtreecommitdiff
path: root/bolt/lib/Core/DebugData.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'bolt/lib/Core/DebugData.cpp')
-rw-r--r--bolt/lib/Core/DebugData.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/bolt/lib/Core/DebugData.cpp b/bolt/lib/Core/DebugData.cpp
index 2b56357df9c0..f1204925a98a 100644
--- a/bolt/lib/Core/DebugData.cpp
+++ b/bolt/lib/Core/DebugData.cpp
@@ -732,8 +732,16 @@ void DebugLoclistWriter::addList(AttrInfo &AttrVal,
uint32_t DebugLoclistWriter::LoclistBaseOffset = 0;
void DebugLoclistWriter::finalizeDWARF5(
DebugInfoBinaryPatcher &DebugInfoPatcher, DebugAbbrevWriter &AbbrevWriter) {
- if (LocBodyBuffer->empty())
+ if (LocBodyBuffer->empty()) {
+ std::optional<AttrInfo> AttrInfoVal =
+ findAttributeInfo(CU.getUnitDIE(), dwarf::DW_AT_loclists_base);
+ // Pointing to first one, because it doesn't matter. There are no uses of it
+ // in this CU.
+ if (!isSplitDwarf() && AttrInfoVal)
+ DebugInfoPatcher.addLE32Patch(AttrInfoVal->Offset,
+ getDWARF5RngListLocListHeaderSize());
return;
+ }
std::unique_ptr<DebugBufferVector> LocArrayBuffer =
std::make_unique<DebugBufferVector>();