[WebAssembly] call_indirect issues table number relocs
authorAndy Wingo <wingo@igalia.com>
Tue, 5 Jan 2021 10:05:18 +0000 (11:05 +0100)
committerAndy Wingo <wingo@igalia.com>
Tue, 19 Jan 2021 08:32:45 +0000 (09:32 +0100)
commit418df4a6ab35d343cc0f2608c90a73dd9b8d0ab1
treef3d6011995253f49392ff11db261b3e65910fd4b
parentb86e7ae66cb988dda33445c29fa64f93e7ca9c3c
[WebAssembly] call_indirect issues table number relocs

This patch changes to make call_indirect explicitly refer to the
corresponding function table, residualizing TABLE_NUMBER relocs against
it.

With this change, wasm-ld now sees all references to tables, and can
link multiple tables.

Differential Revision: https://reviews.llvm.org/D90948
19 files changed:
lld/test/wasm/call-indirect.ll
lld/test/wasm/compress-relocs.ll
lld/test/wasm/shared.ll
llvm/lib/MC/WasmObjectWriter.cpp
llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp
llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyInstPrinter.cpp
llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCTargetDesc.h
llvm/lib/Target/WebAssembly/WebAssemblyFastISel.cpp
llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
llvm/lib/Target/WebAssembly/WebAssemblyInstrCall.td
llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp
llvm/test/CodeGen/WebAssembly/function-pointer64.ll
llvm/test/CodeGen/WebAssembly/multivalue.ll
llvm/test/MC/WebAssembly/basic-assembly.s
llvm/test/MC/WebAssembly/call-indirect-relocs.s [new file with mode: 0644]
llvm/test/MC/WebAssembly/reloc-code.ll
llvm/test/MC/WebAssembly/tail-call-encodings.s
llvm/test/MC/WebAssembly/type-index.s
llvm/test/MC/WebAssembly/weak-alias.s