summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-readobj/WasmDumper.cpp
diff options
context:
space:
mode:
authorDan Gohman <dan433584@gmail.com>2019-02-07 22:03:32 +0000
committerDan Gohman <dan433584@gmail.com>2019-02-07 22:03:32 +0000
commit29874cea31cee5b1fc2c5b54544921f9eff8f366 (patch)
treef7d4a1afb2dffcbc9b5154d2417dcf344d5c6f71 /llvm/tools/llvm-readobj/WasmDumper.cpp
parent9b84eeaa3ee8db9ab2640ec7305843ac800119dc (diff)
downloadbcm5719-llvm-29874cea31cee5b1fc2c5b54544921f9eff8f366.tar.gz
bcm5719-llvm-29874cea31cee5b1fc2c5b54544921f9eff8f366.zip
[WebAssembly] Fix imported function symbol names that differ from their import names in the .o format
Add a flag to allow symbols to have a wasm import name which differs from the linker symbol name, allowing the linker to link code using the import_module attribute. This is the MC/Object portion of the patch. Differential Revision: https://reviews.llvm.org/D57632 llvm-svn: 353474
Diffstat (limited to 'llvm/tools/llvm-readobj/WasmDumper.cpp')
-rw-r--r--llvm/tools/llvm-readobj/WasmDumper.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/tools/llvm-readobj/WasmDumper.cpp b/llvm/tools/llvm-readobj/WasmDumper.cpp
index 9ff222e9607..edcd0731553 100644
--- a/llvm/tools/llvm-readobj/WasmDumper.cpp
+++ b/llvm/tools/llvm-readobj/WasmDumper.cpp
@@ -224,8 +224,10 @@ void WasmDumper::printSymbol(const SymbolRef &Sym) {
W.printEnum("Type", Symbol.Info.Kind, makeArrayRef(WasmSymbolTypes));
W.printFlags("Flags", Symbol.Info.Flags, makeArrayRef(WasmSymbolFlags));
- if (Symbol.Info.Flags & wasm::WASM_SYMBOL_UNDEFINED)
- W.printString("Module", Symbol.Info.Module);
+ if (Symbol.Info.Flags & wasm::WASM_SYMBOL_UNDEFINED) {
+ W.printString("ImportName", Symbol.Info.ImportName);
+ W.printString("ImportModule", Symbol.Info.ImportModule);
+ }
if (Symbol.Info.Kind != wasm::WASM_SYMBOL_TYPE_DATA) {
W.printHex("ElementIndex", Symbol.Info.ElementIndex);
} else if (!(Symbol.Info.Flags & wasm::WASM_SYMBOL_UNDEFINED)) {
OpenPOWER on IntegriCloud