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-03-01 16:49:00 +0100
commit2632ba6a358a62c5cbaddc141de81b756b68698f (patch)
tree2b1d689a5c3b4bd072f1c4d62a738d3254b928f0 /llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp
parentb62928b21ec8c8c5f41c7b30adc14bbd027c908c (diff)
downloadllvm-2632ba6a358a62c5cbaddc141de81b756b68698f.zip
llvm-2632ba6a358a62c5cbaddc141de81b756b68698f.tar.gz
llvm-2632ba6a358a62c5cbaddc141de81b756b68698f.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. 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);