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

Andy Wingo via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 15 05:55:16 PST 2021


wingo added a comment.

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

> A table needs a symtab entry if:
>
> - it is used in a reloc (call_indirect issued a symbol reference); or
> - it is not the indirect function table (check via name and isFunctionTable())

Thinking again.  Apologies for the late tergiversations -- if you have a compilation unit with a function bitcast but no call_indirect and no other tables, in practice you have a relocatable table.  The linker can assign `__indirect_function_table` to any table number because there are no uses to relocate.  (I had locally added a hasNonRelocatableUses flag to the MCSymbolWasm for tracking this.)  But, a linker would only assign non-zero table numbers if there is a table symtab entry, and old linkers won't accept table symtab entries, so you really need to gate the presence of the symtab entry on the reference-types feature.  You can't decide automatically :/

I think this problem is important to solve so I will continue to think about it.  The previous feature-detection-in-the-writer appeared to solve the problem fwiw.


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