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

Sam Clegg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 3 08:22:28 PST 2021


sbc100 added a comment.

In D90948#2538707 <https://reviews.llvm.org/D90948#2538707>, @wingo wrote:

> OK one nit I just realized.  It would be nice to allow linking MVP and reftypes inputs.  However this will not be possible if the reftypes input imports a table.  This is because table numbers are assigned first to imports, then to module-local definitions.  The MVP input would have `call_indirect` against table 0, expecting it to be the indirect function table, but instead it is an import from the reftypes module.  I guess the linker just emits an error in that case.
>
> It would be possible to have a command-line tool to migrate an MVP object file to a reftypes object file, parsing function code and reconstructing relocs.  I guess the linker itself isn't the right place for that though.

Yup that does sounds like a showstopper for linking mixed inputs.    Should we have the linker error out in only cases were there are imported tables?  Or should error out on any kind of mixed inputs?   I guess it depends how useful linking mixed object files is, and how often folks will be using table imports.

I think maybe we should start out by making mixed inputs a hard error.  We could try to relax it later if there is demand.   Does that sounds reasonable @tlively ?


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