[PATCH] D90948: [WebAssembly] call_indirect issues table number relocs
Andy Wingo via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 11 23:30:08 PST 2021
wingo added a comment.
In D90948#2558286 <https://reviews.llvm.org/D90948#2558286>, @tlively wrote:
> Actually, one question.
>
>> We keep the hack that table symbols only go to the symbol table if they are marked as used in relocations.
>
> It seems like it would be simpler to not create a symbol table in the first place in cases where it will not be emitted into the binary anyway. In `LowerCallResults`, can we do
>
> MIB.addSym(WebAssembly::getOrCreateFunctionTableSymbol(
> MF.getContext(), "__indirect_function_table"));
>
> only if `MF.getSubtarget<WebAssemblySubtarget>().hasReferenceTypes()` and otherwise continue doing `MIB.addImm(0)`?
This could work, but the issue comes as to whether or not to emit the `__indirect_function_table` import. Currently the mechanism from D91637 <https://reviews.llvm.org/D91637> (which, looking at it now, landed in November already -- how has this task gone on for so long???) is that the `__indirect_function_table` import is added the output file only if needed. We need some way for a compilation unit to record that it actually needs the indirect function table. Currently we use the presence of the table symbol in the symtab.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D90948/new/
https://reviews.llvm.org/D90948
More information about the llvm-commits
mailing list