summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/dump/relocations-block-types.txt2
-rw-r--r--test/dump/relocations.txt16
-rw-r--r--test/dump/symbol-tables.txt61
3 files changed, 71 insertions, 8 deletions
diff --git a/test/dump/relocations-block-types.txt b/test/dump/relocations-block-types.txt
index 5f0ffb9c..a1a12650 100644
--- a/test/dump/relocations-block-types.txt
+++ b/test/dump/relocations-block-types.txt
@@ -29,6 +29,8 @@ Code[1]:
- func[0] size=20 <multivalue_block>
Custom:
- name: "linking"
+ - symbol table [count=1]
+ - 0: F <multivalue_block> func=0 exported no_strip binding=global vis=hidden
Custom:
- name: "reloc.Code"
- relocations for section: 3 (Code) [1]
diff --git a/test/dump/relocations.txt b/test/dump/relocations.txt
index 8d7071de..d856413a 100644
--- a/test/dump/relocations.txt
+++ b/test/dump/relocations.txt
@@ -29,18 +29,18 @@ Sections:
Export start=0x00000050 end=0x00000055 (size=0x00000005) count: 1
Elem start=0x00000057 end=0x0000005e (size=0x00000007) count: 1
Code start=0x00000060 end=0x00000082 (size=0x00000022) count: 1
- Custom start=0x00000084 end=0x0000009f (size=0x0000001b) "linking"
- Custom start=0x000000a1 end=0x000000ba (size=0x00000019) "reloc.Code"
+ Custom start=0x00000084 end=0x000000a1 (size=0x0000001d) "linking"
+ Custom start=0x000000a3 end=0x000000bc (size=0x00000019) "reloc.Code"
Code Disassembly:
-000062 func[2] <$f>:
- 000063: 23 80 80 80 80 00 | global.get 0 <$g>
- 000064: R_WASM_GLOBAL_INDEX_LEB 0 <$g>
- 000069: 10 82 80 80 80 00 | call 2 <$f>
- 00006a: R_WASM_FUNCTION_INDEX_LEB 1 <$f>
+000062 func[2] <f>:
+ 000063: 23 80 80 80 80 00 | global.get 0 <g>
+ 000064: R_WASM_GLOBAL_INDEX_LEB 3 <g>
+ 000069: 10 82 80 80 80 00 | call 2 <f>
+ 00006a: R_WASM_FUNCTION_INDEX_LEB 2 <f>
00006f: 10 80 80 80 80 00 | call 0 <__extern.foo>
- 000070: R_WASM_FUNCTION_INDEX_LEB 2 <__extern.foo>
+ 000070: R_WASM_FUNCTION_INDEX_LEB 0 <__extern.foo>
000075: 41 d2 09 | i32.const 1234
000078: 41 00 | i32.const 0
00007a: 11 82 80 80 80 00 00 | call_indirect 2 0
diff --git a/test/dump/symbol-tables.txt b/test/dump/symbol-tables.txt
new file mode 100644
index 00000000..26385d4f
--- /dev/null
+++ b/test/dump/symbol-tables.txt
@@ -0,0 +1,61 @@
+;;; TOOL: run-objdump
+;;; ARGS0: -r
+;;; ARGS1: -x
+(module
+ (type (;0;) (func))
+ (import "env" "b" (func (;0;) (type 0)))
+ (func $a (type 0)
+ call 0)
+ (func (type 0)
+ call 0)
+ (func $b (type 0)
+ call 0)
+ (export "a" (func $a)))
+(;; STDOUT ;;;
+
+symbol-tables.wasm: file format wasm 0x1
+
+Section Details:
+
+Type[1]:
+ - type[0] () -> nil
+Import[1]:
+ - func[0] sig=0 <env.b> <- env.b
+Function[3]:
+ - func[1] sig=0 <a>
+ - func[2] sig=0
+ - func[3] sig=0 <b>
+Export[1]:
+ - func[1] <a> -> "a"
+Code[3]:
+ - func[1] size=8 <a>
+ - func[2] size=8
+ - func[3] size=8 <b>
+Custom:
+ - name: "linking"
+ - symbol table [count=3]
+ - 0: F <env.b> func=0 undefined binding=global vis=default
+ - 1: F <a> func=1 exported no_strip binding=global vis=hidden
+ - 2: F <b> func=3 binding=global vis=default
+Custom:
+ - name: "reloc.Code"
+ - relocations for section: 4 (Code) [3]
+ - R_WASM_FUNCTION_INDEX_LEB offset=0x000004(file=0x00002c) symbol=0 <env.b>
+ - R_WASM_FUNCTION_INDEX_LEB offset=0x00000d(file=0x000035) symbol=0 <env.b>
+ - R_WASM_FUNCTION_INDEX_LEB offset=0x000016(file=0x00003e) symbol=0 <env.b>
+
+Code Disassembly:
+
+00002a func[1] <a>:
+ 00002b: 10 80 80 80 80 00 | call 0 <env.b>
+ 00002c: R_WASM_FUNCTION_INDEX_LEB 0 <env.b>
+ 000031: 0b | end
+000033 func[2]:
+ 000034: 10 80 80 80 80 00 | call 0 <env.b>
+ 000035: R_WASM_FUNCTION_INDEX_LEB 0 <env.b>
+ 00003a: 0b | end
+00003c func[3] <b>:
+ 00003d: 10 80 80 80 80 00 | call 0 <env.b>
+ 00003e: R_WASM_FUNCTION_INDEX_LEB 0 <env.b>
+ 000043: 0b | end
+;;; STDOUT ;;)