diff options
| author | Sam Clegg <sbc@chromium.org> | 2018-02-23 05:08:53 +0000 |
|---|---|---|
| committer | Sam Clegg <sbc@chromium.org> | 2018-02-23 05:08:53 +0000 |
| commit | 93102974386d5fe5ea217ec3d4aeda55395db4ff (patch) | |
| tree | 06f3eb15d4047c4949f48cc9f1cec2fdbda7e2e1 /lld/wasm/SymbolTable.h | |
| parent | 6c899ba6dee1a6cd1e1a49900bb5f3b6353a5487 (diff) | |
| download | bcm5719-llvm-93102974386d5fe5ea217ec3d4aeda55395db4ff.tar.gz bcm5719-llvm-93102974386d5fe5ea217ec3d4aeda55395db4ff.zip | |
[WebAssembly] Add explicit symbol table
This change modified lld to in response the llvm change which
moved to a more explicit symbol table in the object format.
Based on patches by Nicholas Wilson:
1. https://reviews.llvm.org/D41955
2. https://reviews.llvm.org/D42585
The primary difference that we see in the test output is that
for relocatable (-r) output we now have symbol table which
replaces exports/imports and globals.
See: https://github.com/WebAssembly/tool-conventions/issues/38
Differential Revision: https://reviews.llvm.org/D43264
llvm-svn: 325861
Diffstat (limited to 'lld/wasm/SymbolTable.h')
| -rw-r--r-- | lld/wasm/SymbolTable.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lld/wasm/SymbolTable.h b/lld/wasm/SymbolTable.h index 751bd1f4924..32492a5d101 100644 --- a/lld/wasm/SymbolTable.h +++ b/lld/wasm/SymbolTable.h @@ -17,6 +17,7 @@ #include "llvm/Support/raw_ostream.h" using llvm::wasm::WasmSignature; +using llvm::wasm::WasmGlobalType; namespace lld { namespace wasm { @@ -50,17 +51,26 @@ public: Symbol *addDefinedFunction(StringRef Name, uint32_t Flags, InputFile *F, InputFunction *Function = nullptr); Symbol *addDefinedData(StringRef Name, uint32_t Flags, InputFile *F, - InputSegment *Segment = nullptr, uint32_t Address = 0); + InputSegment *Segment = nullptr, uint32_t Address = 0, + uint32_t Size = 0); + Symbol *addDefinedGlobal(StringRef Name, uint32_t Flags, InputFile *F, + InputGlobal *G); Symbol *addUndefined(StringRef Name, Symbol::Kind Kind, uint32_t Flags, InputFile *F, const WasmSignature *Signature = nullptr); Symbol *addUndefinedFunction(StringRef Name, const WasmSignature *Type); + Symbol *addUndefined(StringRef Name, WasmSymbolType Type, uint32_t Flags, + InputFile *F, const WasmSignature *Signature = nullptr, + const WasmGlobalType *GlobalType = nullptr); void addLazy(ArchiveFile *F, const Archive::Symbol *Sym); bool addComdat(StringRef Name, ObjFile *); DefinedData *addSyntheticDataSymbol(StringRef Name, uint32_t Flags = 0); + DefinedGlobal *addSyntheticGlobal(StringRef Name, uint32_t Flags, + InputGlobal *Global); DefinedFunction *addSyntheticFunction(StringRef Name, const WasmSignature *Type, uint32_t Flags = 0); + private: std::pair<Symbol *, bool> insert(StringRef Name); |

