[PATCH] D61323: [WebAssembly] Support EXPLICIT_NAME symbols in llvm-readobj
Dan Gohman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 30 10:02:21 PDT 2019
sunfish created this revision.
sunfish added a reviewer: sbc100.
Herald added subscribers: rupprecht, aheejin, jgravelle-google, dschuff.
Herald added a project: LLVM.
Teach llvm-readobj about `WASM_SYMBOL_EXPLICIT_NAME`.
Repository:
rL LLVM
https://reviews.llvm.org/D61323
Files:
test/tools/llvm-readobj/Inputs/imports.obj.wasm
test/tools/llvm-readobj/wasm-imports.test
tools/llvm-readobj/WasmDumper.cpp
Index: tools/llvm-readobj/WasmDumper.cpp
===================================================================
--- tools/llvm-readobj/WasmDumper.cpp
+++ tools/llvm-readobj/WasmDumper.cpp
@@ -50,6 +50,7 @@
ENUM_ENTRY(VISIBILITY_HIDDEN),
ENUM_ENTRY(UNDEFINED),
ENUM_ENTRY(EXPORTED),
+ ENUM_ENTRY(EXPLICIT_NAME),
#undef ENUM_ENTRY
};
Index: test/tools/llvm-readobj/wasm-imports.test
===================================================================
--- test/tools/llvm-readobj/wasm-imports.test
+++ test/tools/llvm-readobj/wasm-imports.test
@@ -0,0 +1,48 @@
+RUN: llvm-readobj --symbols %p/Inputs/imports.obj.wasm | FileCheck %s
+
+CHECK: File: {{.*}}/Inputs/imports.obj.wasm
+CHECK-NEXT: Format: WASM
+CHECK-NEXT: Arch: wasm32
+CHECK-NEXT: AddressSize: 32bit
+CHECK-NEXT: Symbols [
+CHECK-NEXT: Symbol {
+CHECK-NEXT: Name: test
+CHECK-NEXT: Type: FUNCTION (0x0)
+CHECK-NEXT: Flags [ (0x4)
+CHECK-NEXT: VISIBILITY_HIDDEN (0x4)
+CHECK-NEXT: ]
+CHECK-NEXT: ElementIndex: 0x3
+CHECK-NEXT: }
+CHECK-NEXT: Symbol {
+CHECK-NEXT: Name: foo
+CHECK-NEXT: Type: FUNCTION (0x0)
+CHECK-NEXT: Flags [ (0x10)
+CHECK-NEXT: UNDEFINED (0x10)
+CHECK-NEXT: ]
+CHECK-NEXT: ImportName: foo
+CHECK-NEXT: ImportModule: red
+CHECK-NEXT: ElementIndex: 0x0
+CHECK-NEXT: }
+CHECK-NEXT: Symbol {
+CHECK-NEXT: Name: bar
+CHECK-NEXT: Type: FUNCTION (0x0)
+CHECK-NEXT: Flags [ (0x50)
+CHECK-NEXT: EXPLICIT_NAME (0x40)
+CHECK-NEXT: UNDEFINED (0x10)
+CHECK-NEXT: ]
+CHECK-NEXT: ImportName: green
+CHECK-NEXT: ImportModule: env
+CHECK-NEXT: ElementIndex: 0x1
+CHECK-NEXT: }
+CHECK-NEXT: Symbol {
+CHECK-NEXT: Name: qux
+CHECK-NEXT: Type: FUNCTION (0x0)
+CHECK-NEXT: Flags [ (0x50)
+CHECK-NEXT: EXPLICIT_NAME (0x40)
+CHECK-NEXT: UNDEFINED (0x10)
+CHECK-NEXT: ]
+CHECK-NEXT: ImportName: purple
+CHECK-NEXT: ImportModule: blue
+CHECK-NEXT: ElementIndex: 0x2
+CHECK-NEXT: }
+CHECK-NEXT: ]
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61323.197364.patch
Type: text/x-patch
Size: 2019 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190430/e43f7f45/attachment.bin>
More information about the llvm-commits
mailing list