;;; TOOL: run-wasm-link
;;; FLAGS: --incremental -r
(module
  (import "__extern" "bar" (func (param i32) (result i32)))
  (func $func1 (param i32)
     get_local 0
     call 0
     call 1)
  (table anyfunc (elem $func1 $func1 $func1))
)
(module
  (import "__extern" "does_nothing" (func (param f64)))
  (func $func2 (param i64)
     f64.const 1
     call 0
     i64.const 10
     call 1)
  (table anyfunc (elem $func2 $func2))
)
(module
  (import "__extern" "hello_world" (func (param f32)))
  (func $func3 (param i32)
     f32.const 1
     call 0
     i32.const 10
     call 1)
  (table anyfunc (elem $func3 $func3))
)
(;; STDOUT ;;;

******************************************************************
WARNING: wasm-link is deprecated. Where possible, use lld instead.
******************************************************************

******************************************************************
WARNING: wasm-link is deprecated. Where possible, use lld instead.
******************************************************************

******************************************************************
WARNING: wasm-link is deprecated. Where possible, use lld instead.
******************************************************************

linked.wasm:	file format wasm 0x1

Sections:

     Type start=0x0000000a end=0x00000024 (size=0x0000001a) count: 6
   Import start=0x0000002a end=0x00000069 (size=0x0000003f) count: 3
 Function start=0x0000006f end=0x00000073 (size=0x00000004) count: 3
    Table start=0x00000079 end=0x0000007e (size=0x00000005) count: 1
     Elem start=0x00000084 end=0x000000ad (size=0x00000029) count: 1
     Code start=0x000000af end=0x000000f1 (size=0x00000042) count: 3
   Custom start=0x000000f7 end=0x00000118 (size=0x00000021) "name"
   Custom start=0x0000011e end=0x00000126 (size=0x00000008) "linking"
   Custom start=0x0000012c end=0x0000014e (size=0x00000022) "reloc.Elem"
   Custom start=0x00000154 end=0x00000173 (size=0x0000001f) "reloc.Code"

Section Details:

Type:
 - type[0] (i32) -> i32
 - type[1] (i32) -> nil
 - type[2] (f64) -> nil
 - type[3] (i64) -> nil
 - type[4] (f32) -> nil
 - type[5] (i32) -> nil
Import:
 - func[0] sig=0 <- __extern.bar
 - func[1] sig=2 <- __extern.does_nothing
 - func[2] sig=4 <- __extern.hello_world
Function:
 - func[3] sig=1 <func1>
 - func[4] sig=3 <func2>
 - func[5] sig=5 <func3>
Table:
 - table[0] type=anyfunc initial=7 max=7
Elem:
 - segment[0] table=0
 - init i32=0
  - elem[0] = func[3] <func1>
  - elem[1] = func[3] <func1>
  - elem[2] = func[3] <func1>
  - elem[3] = func[4] <func2>
  - elem[4] = func[4] <func2>
  - elem[5] = func[5] <func3>
  - elem[6] = func[5] <func3>
Custom:
 - name: "name"
 - func[3] func1
 - func[4] func2
 - func[5] func3
Custom:
 - name: "linking"
Custom:
 - name: "reloc.Elem"
  - section: Elem
   - R_WEBASSEMBLY_FUNCTION_INDEX_LEB offset=0x000006(file=0x00008a) index=3
   - R_WEBASSEMBLY_FUNCTION_INDEX_LEB offset=0x00000b(file=0x00008f) index=3
   - R_WEBASSEMBLY_FUNCTION_INDEX_LEB offset=0x000010(file=0x000094) index=3
   - R_WEBASSEMBLY_FUNCTION_INDEX_LEB offset=0x000015(file=0x000099) index=4
   - R_WEBASSEMBLY_FUNCTION_INDEX_LEB offset=0x00001a(file=0x00009e) index=4
   - R_WEBASSEMBLY_FUNCTION_INDEX_LEB offset=0x00001f(file=0x0000a3) index=5
   - R_WEBASSEMBLY_FUNCTION_INDEX_LEB offset=0x000024(file=0x0000a8) index=5
Custom:
 - name: "reloc.Code"
  - section: Code
   - R_WEBASSEMBLY_FUNCTION_INDEX_LEB offset=0x000006(file=0x0000b5) index=0
   - R_WEBASSEMBLY_FUNCTION_INDEX_LEB offset=0x00000c(file=0x0000bb) index=3
   - R_WEBASSEMBLY_FUNCTION_INDEX_LEB offset=0x00001e(file=0x0000cd) index=1
   - R_WEBASSEMBLY_FUNCTION_INDEX_LEB offset=0x000026(file=0x0000d5) index=4
   - R_WEBASSEMBLY_FUNCTION_INDEX_LEB offset=0x000034(file=0x0000e3) index=2
   - R_WEBASSEMBLY_FUNCTION_INDEX_LEB offset=0x00003c(file=0x0000eb) index=5

Code Disassembly:

0000b0 <func1>:
 0000b2: 20 00                      | get_local 0
 0000b4: 10 80 80 80 80 00          | call 0
           0000b5: R_WEBASSEMBLY_FUNCTION_INDEX_LEB 0
 0000ba: 10 83 80 80 80 00          | call 3 <func1>
           0000bb: R_WEBASSEMBLY_FUNCTION_INDEX_LEB 3 <func1>
 0000c0: 0b                         | end
0000c1 <func2>:
 0000c3: 44 00 00 00 00 00 00 f0 3f | f64.const 0x1p+0
 0000cc: 10 81 80 80 80 00          | call 1
           0000cd: R_WEBASSEMBLY_FUNCTION_INDEX_LEB 1
 0000d2: 42 0a                      | i64.const 10
 0000d4: 10 84 80 80 80 00          | call 4 <func2>
           0000d5: R_WEBASSEMBLY_FUNCTION_INDEX_LEB 4 <func2>
 0000da: 0b                         | end
0000db <func3>:
 0000dd: 43 00 00 80 3f             | f32.const 0x1p+0
 0000e2: 10 82 80 80 80 00          | call 2
           0000e3: R_WEBASSEMBLY_FUNCTION_INDEX_LEB 2
 0000e8: 41 0a                      | i32.const 10
 0000ea: 10 85 80 80 80 00          | call 5 <func3>
           0000eb: R_WEBASSEMBLY_FUNCTION_INDEX_LEB 5 <func3>
 0000f0: 0b                         | end
;;; STDOUT ;;)
