aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp
diff options
context:
space:
mode:
authorAndy Wingo <wingo@igalia.com>2021-02-12 11:22:13 +0100
committerAndy Wingo <wingo@igalia.com>2021-02-22 10:13:36 +0100
commit861dbe1a021e6439af837b72b219fb9c449a57ae (patch)
tree6afa4286c0f944c3078e6b245ffec22bf2d4e35d /llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp
parentf10137399a3c9239a6acd1d3df12a40766b64759 (diff)
downloadllvm-861dbe1a021e6439af837b72b219fb9c449a57ae.zip
llvm-861dbe1a021e6439af837b72b219fb9c449a57ae.tar.gz
llvm-861dbe1a021e6439af837b72b219fb9c449a57ae.tar.bz2
[WebAssembly] call_indirect issues table number relocs
If the reference-types feature is enabled, call_indirect will explicitly reference its corresponding function table via `TABLE_NUMBER` relocations against a table symbol. Also, as before, address-taken functions can also cause the function table to be created, only with reference-types they additionally cause a symbol table entry to be emitted. We abuse the used-in-reloc flag on symbols to indicate which tables should end up in the symbol table. We do this because unfortunately older wasm-ld will carp if it see a table symbol. Differential Revision: https://reviews.llvm.org/D90948
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp')
-rw-r--r--llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp
index 280fbf9..95f2744 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp
@@ -161,6 +161,8 @@ MCOperand WebAssemblyMCInstLower::lowerSymbolOperand(const MachineOperand &MO,
report_fatal_error("Global indexes with offsets not supported");
if (WasmSym->isEvent())
report_fatal_error("Event indexes with offsets not supported");
+ if (WasmSym->isTable())
+ report_fatal_error("Table indexes with offsets not supported");
Expr = MCBinaryExpr::createAdd(
Expr, MCConstantExpr::create(MO.getOffset(), Ctx), Ctx);