aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/MC/WasmObjectWriter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/MC/WasmObjectWriter.cpp')
-rw-r--r--llvm/lib/MC/WasmObjectWriter.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/lib/MC/WasmObjectWriter.cpp b/llvm/lib/MC/WasmObjectWriter.cpp
index 9c91969..9d5a290 100644
--- a/llvm/lib/MC/WasmObjectWriter.cpp
+++ b/llvm/lib/MC/WasmObjectWriter.cpp
@@ -1785,6 +1785,18 @@ uint64_t WasmObjectWriter::writeOneObject(MCAssembler &Asm,
WS.setIndex(InvalidIndex);
continue;
}
+ // In bitcode generated by split-LTO-unit mode in ThinLTO, these lines can
+ // appear:
+ // module asm ".lto_set_conditional symbolA,symbolA.[moduleId]"
+ // ...
+ // (Here [moduleId] will be replaced by a real module hash ID)
+ //
+ // Here the original symbol (symbolA here) has been renamed to the new name
+ // created by attaching its module ID, so the original symbol does not
+ // appear in the bitcode anymore, and thus not in DataLocations. We should
+ // ignore them.
+ if (WS.isData() && WS.isDefined() && !DataLocations.count(&WS))
+ continue;
LLVM_DEBUG(dbgs() << "adding to symtab: " << WS << "\n");
uint32_t Flags = 0;