[llvm] r330854 - [WebAssebmly] Add Module name to WasmSymbol
Sam Clegg via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 25 11:24:08 PDT 2018
Author: sbc
Date: Wed Apr 25 11:24:08 2018
New Revision: 330854
URL: http://llvm.org/viewvc/llvm-project?rev=330854&view=rev
Log:
[WebAssebmly] Add Module name to WasmSymbol
Imports in a wasm module can have custom module name. This change
adds the module name to the WasmSymbol structure so that the linker
can preserve this module name.
This is needed to fix: https://bugs.llvm.org/show_bug.cgi?id=37168
Differential Revision: https://reviews.llvm.org/D45797
Modified:
llvm/trunk/include/llvm/BinaryFormat/Wasm.h
llvm/trunk/lib/Object/WasmObjectFile.cpp
Modified: llvm/trunk/include/llvm/BinaryFormat/Wasm.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/BinaryFormat/Wasm.h?rev=330854&r1=330853&r2=330854&view=diff
==============================================================================
--- llvm/trunk/include/llvm/BinaryFormat/Wasm.h (original)
+++ llvm/trunk/include/llvm/BinaryFormat/Wasm.h Wed Apr 25 11:24:08 2018
@@ -145,6 +145,7 @@ struct WasmSymbolInfo {
StringRef Name;
uint8_t Kind;
uint32_t Flags;
+ StringRef Module; // For undefined symbols the module name of the import
union {
// For function or global symbols, the index in function or global index
// space.
Modified: llvm/trunk/lib/Object/WasmObjectFile.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/WasmObjectFile.cpp?rev=330854&r1=330853&r2=330854&view=diff
==============================================================================
--- llvm/trunk/lib/Object/WasmObjectFile.cpp (original)
+++ llvm/trunk/lib/Object/WasmObjectFile.cpp Wed Apr 25 11:24:08 2018
@@ -412,6 +412,7 @@ Error WasmObjectFile::parseLinkingSectio
wasm::WasmImport &Import = *ImportedFunctions[Info.ElementIndex];
FunctionType = &Signatures[Import.SigIndex];
Info.Name = Import.Field;
+ Info.Module = Import.Module;
}
break;
More information about the llvm-commits
mailing list