summaryrefslogtreecommitdiff
path: root/test/dump/relocations.txt
blob: 195a69b3a1958d8b120c8a245fcd15b8f674a50d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
;;; TOOL: run-objdump
;;; ARGS0: -r
;;; ARGS1: --headers
(module
  (type $t (func (param i32)))
  (import "__extern" "foo" (func (param i32) (result i32)))
  (global $g i32 (i32.const 0))
  (func $f (param i32) (result i32)
    get_global 0
    call 1
    call 0)
  (export "f" (func $f))
  (table anyfunc (elem $f)))
(;; STDOUT ;;;

relocations.wasm:	file format wasm 0x1

Sections:

     Type start=0x0000000a end=0x00000014 (size=0x0000000a) count: 2
   Import start=0x00000016 end=0x00000026 (size=0x00000010) count: 1
 Function start=0x00000028 end=0x0000002a (size=0x00000002) count: 1
    Table start=0x0000002c end=0x00000031 (size=0x00000005) count: 1
   Global start=0x00000033 end=0x00000039 (size=0x00000006) count: 1
   Export start=0x0000003b end=0x00000040 (size=0x00000005) count: 1
     Elem start=0x00000042 end=0x0000004d (size=0x0000000b) count: 1
     Code start=0x0000004f end=0x00000065 (size=0x00000016) count: 1
   Custom start=0x00000067 end=0x00000082 (size=0x0000001b) "linking"
   Custom start=0x00000084 end=0x00000094 (size=0x00000010) "reloc.Elem"
   Custom start=0x00000096 end=0x000000ac (size=0x00000016) "reloc.Code"

Code Disassembly:

000051 func[1] <$f>:
 000052: 23 80 80 80 80 00          | global.get 0 <$g>
           000053: R_WASM_GLOBAL_INDEX_LEB 1 <$g>
 000058: 10 81 80 80 80 00          | call 1 <$f>
           000059: R_WASM_FUNCTION_INDEX_LEB 0 <$f>
 00005e: 10 80 80 80 80 00          | call 0 <__extern.foo>
           00005f: R_WASM_FUNCTION_INDEX_LEB 2 <__extern.foo>
 000064: 0b                         | end
;;; STDOUT ;;)