aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Object/WasmObjectFile.cpp
diff options
context:
space:
mode:
authorAndy Wingo <wingo@igalia.com>2021-01-05 12:08:58 +0100
committerAndy Wingo <wingo@igalia.com>2021-01-14 11:13:13 +0100
commit53e3b81faaf32a495189182e0e4d635cbe19c5dd (patch)
treedbdff47d372ea6a44a61f18aaff51619a5424338 /llvm/lib/Object/WasmObjectFile.cpp
parent4bb11b3eafbde75ab026ec180cae62799ba0fb3c (diff)
downloadllvm-53e3b81faaf32a495189182e0e4d635cbe19c5dd.zip
llvm-53e3b81faaf32a495189182e0e4d635cbe19c5dd.tar.gz
llvm-53e3b81faaf32a495189182e0e4d635cbe19c5dd.tar.bz2
[lld][WebAssembly] Add support for handling table symbols
This commit adds table symbol support in a partial way, while still including some special cases for the __indirect_function_table symbol. No change in tests. Differential Revision: https://reviews.llvm.org/D94075
Diffstat (limited to 'llvm/lib/Object/WasmObjectFile.cpp')
-rw-r--r--llvm/lib/Object/WasmObjectFile.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/Object/WasmObjectFile.cpp b/llvm/lib/Object/WasmObjectFile.cpp
index c9b13e4..dac16d2 100644
--- a/llvm/lib/Object/WasmObjectFile.cpp
+++ b/llvm/lib/Object/WasmObjectFile.cpp
@@ -527,7 +527,7 @@ Error WasmObjectFile::parseLinkingSectionSymtab(ReadContext &Ctx) {
wasm::WasmSymbolInfo Info;
const wasm::WasmSignature *Signature = nullptr;
const wasm::WasmGlobalType *GlobalType = nullptr;
- uint8_t TableType = 0;
+ const wasm::WasmTableType *TableType = nullptr;
const wasm::WasmEventType *EventType = nullptr;
Info.Kind = readUint8(Ctx);
@@ -609,7 +609,7 @@ Error WasmObjectFile::parseLinkingSectionSymtab(ReadContext &Ctx) {
Info.Name = readString(Ctx);
unsigned TableIndex = Info.ElementIndex - NumImportedTables;
wasm::WasmTable &Table = Tables[TableIndex];
- TableType = Table.Type.ElemType;
+ TableType = &Table.Type;
if (Table.SymbolName.empty())
Table.SymbolName = Info.Name;
} else {
@@ -620,8 +620,7 @@ Error WasmObjectFile::parseLinkingSectionSymtab(ReadContext &Ctx) {
} else {
Info.Name = Import.Field;
}
- TableType = Import.Table.ElemType;
- // FIXME: Parse limits here too.
+ TableType = &Import.Table;
if (!Import.Module.empty()) {
Info.ImportModule = Import.Module;
}