Skip to content

Commit 7e42e33

Browse files
committed
WebAssembly: remove even more PCRel relocations
This removes the PCRel reloc in \01l_type_metadata_table but nowhere else
1 parent a506ca6 commit 7e42e33

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/IRGen/GenDecl.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -2814,6 +2814,11 @@ IRGenModule::emitDirectRelativeReference(llvm::Constant *target,
28142814
// Convert the target to an integer.
28152815
auto targetAddr = llvm::ConstantExpr::getPtrToInt(target, SizeTy);
28162816

2817+
// WebAssembly hack: WebAssembly doesn't support PC-relative references
2818+
if (TargetInfo.OutputObjectFormat == llvm::Triple::Wasm) {
2819+
return targetAddr;
2820+
}
2821+
28172822
SmallVector<llvm::Constant*, 4> indices;
28182823
indices.push_back(llvm::ConstantInt::get(Int32Ty, 0));
28192824
for (unsigned baseIndex : baseIndices) {

0 commit comments

Comments
 (0)