forked from OSchip/llvm-project
[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 llvm-svn: 330854
This commit is contained in:
parent
4264a38916
commit
9067b46e1b
|
@ -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.
|
||||
|
|
|
@ -412,6 +412,7 @@ Error WasmObjectFile::parseLinkingSectionSymtab(const uint8_t *&Ptr,
|
|||
wasm::WasmImport &Import = *ImportedFunctions[Info.ElementIndex];
|
||||
FunctionType = &Signatures[Import.SigIndex];
|
||||
Info.Name = Import.Field;
|
||||
Info.Module = Import.Module;
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
Loading…
Reference in New Issue