[PATCH] D90948: [WebAssembly] call_indirect issues table number relocs

Andy Wingo via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 28 02:05:05 PST 2021


wingo added a comment.

Thanks again for comments!

I would like to preserve the property that allows the linker to omit `__indirect_function_table` if it is not needed.  Right now the linker has two ways it treats incoming files: if the input has table symtab entries, the input is assumed to have symbols for all tables and relocs for all table references.  Otherwise, if the input has tables (import or not) but no symbols, it is an MVP input which requires an indirect function table.  It would be sufficient to link the two if we ensure that the indirect function table is allocated table number 0.

Is the suggestion that for reftypes objects, we would omit the symbol for `__indirect_function_table`, and omit relocations against it?  It would mean that the linker would have to grovel reftypes inputs for table imports that aren't in the symtab, in order to know if a reftypes object uses the indirect function table.  This is doable but it is less optimal: since the linker doesn't have a precise idea of where the indirect function table is used, it has to assume that if it's live in the input, it's live in the output.  If each table reference has a reloc, this isn't the case, and we can have more precise GC.  But given the tradeoffs, do you prefer that solution?


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