summaryrefslogtreecommitdiffstats
path: root/lld/wasm/InputFiles.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lld/wasm/InputFiles.cpp')
-rw-r--r--lld/wasm/InputFiles.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lld/wasm/InputFiles.cpp b/lld/wasm/InputFiles.cpp
index 807651ac4f1..b62b1feb74d 100644
--- a/lld/wasm/InputFiles.cpp
+++ b/lld/wasm/InputFiles.cpp
@@ -155,7 +155,9 @@ uint32_t ObjFile::calcNewValue(const WasmRelocation &Reloc) const {
if (isa<DataSymbol>(Sym) && Sym->isUndefined()) {
if (Sym->isWeak() || Config->Relocatable)
return 0;
- if (Config->Shared && Reloc.Type == R_WASM_MEMORY_ADDR_I32)
+ // R_WASM_MEMORY_ADDR_I32 relocations in PIC code are turned into runtime
+ // fixups in __wasm_apply_relocs
+ if (Config->Pic && Reloc.Type == R_WASM_MEMORY_ADDR_I32)
return 0;
if (Reloc.Type != R_WASM_GLOBAL_INDEX_LEB) {
llvm_unreachable(
OpenPOWER on IntegriCloud