The current PIC model for WebAssembly is more like ELF in that it
allows symbol interposition.
This means that more functions end up being addressed via the GOT
and fewer directly added to the wasm table.
One effect is a reduction in the number of wasm table entries similar
to the previous attempt in https://reviews.llvm.org/D61539 which was
reverted.
Differential Revision: https://reviews.llvm.org/D61772
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360402
91177308-0d34-0410-b5e6-
96231b3b80d8
if (GV && !GV->hasDefaultVisibility())
return true;
- if (TT.isOSBinFormatMachO() || TT.isOSBinFormatWasm()) {
+ if (TT.isOSBinFormatMachO()) {
if (RM == Reloc::Static)
return true;
return GV && GV->isStrongDefinitionForLinker();
}
- assert(TT.isOSBinFormatELF());
+ assert(TT.isOSBinFormatELF() || TT.isOSBinFormatWasm());
assert(RM != Reloc::DynamicNoPIC);
bool IsExecutable =
return true;
}
- // ELF supports preemption of other symbols.
+ // ELF & wasm support preemption of other symbols.
return false;
}
declare i32 @bar()
declare hidden i32 @hidden_function()
-@indirect_func = global i32 ()* @foo
+@indirect_func = hidden global i32 ()* @foo
@alias_func = hidden alias i32 (), i32 ()* @local_function
define i32 @local_function() {