[PATCH] D96001: [WebAssembly][lld] Preassign table number 0 to indirect function table for MVP inputs

Sam Clegg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 5 09:09:07 PST 2021


sbc100 added inline comments.


================
Comment at: lld/wasm/InputFiles.cpp:351
+      } else {
+        ts->setTableNumber(tableNumber);
+      }
----------------
wingo wrote:
> sbc100 wrote:
> > Can we simplify the code here by asserting that the table number is always zero and that there is only one table.
> > 
> > In fact, perhaps this should be called `synthesizeTableSymbol` (non-plural) and just return after for first call to `addTable`?
> Humm, good question!  Old linkers would not propagate "additional" tables from input to output.  Also, old compilers wouldn't define a table locally -- the indirect function table would only be imported.  So maybe it would be good to avoid adding a new form of acceptable input, in which object files have many table symbols.
> 
> If we tighten this restriction, we can issue an error for inputs that
>  - have no table symbols. and:
>    - import any table not named __indirect_function_table, or
>    - import more than one table, or
>    - define any table
> 
> WDYT?
Sounds great!  


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D96001/new/

https://reviews.llvm.org/D96001



More information about the llvm-commits mailing list