summaryrefslogtreecommitdiff
path: root/test/dump
diff options
context:
space:
mode:
authorBen Smith <binji@chromium.org>2016-03-09 15:35:50 -0800
committerBen Smith <binji@chromium.org>2016-03-09 17:38:02 -0800
commit8b95260131a607bee33d8d70bfd64bb9319da62b (patch)
treed57ba2f1f04426a3e35edc0f00b91025061708cd /test/dump
parent902593052e7b54b2c75d0861941687373e070fab (diff)
downloadwabt-8b95260131a607bee33d8d70bfd64bb9319da62b.tar.gz
wabt-8b95260131a607bee33d8d70bfd64bb9319da62b.tar.bz2
wabt-8b95260131a607bee33d8d70bfd64bb9319da62b.zip
sections have size and name as string
Diffstat (limited to 'test/dump')
-rw-r--r--test/dump/basic.txt121
-rw-r--r--test/dump/binary.txt361
-rw-r--r--test/dump/block-257-exprs-br.txt168
-rw-r--r--test/dump/block-257-exprs.txt159
-rw-r--r--test/dump/block.txt82
-rw-r--r--test/dump/br-block-named.txt84
-rw-r--r--test/dump/br-block.txt102
-rw-r--r--test/dump/br-loop-inner-expr.txt94
-rw-r--r--test/dump/br-loop-inner.txt88
-rw-r--r--test/dump/br-loop.txt71
-rw-r--r--test/dump/brif-loop.txt64
-rw-r--r--test/dump/brif.txt64
-rw-r--r--test/dump/brtable.txt98
-rw-r--r--test/dump/call.txt60
-rw-r--r--test/dump/callimport.txt95
-rw-r--r--test/dump/callindirect-after-import.txt116
-rw-r--r--test/dump/callindirect.txt75
-rw-r--r--test/dump/cast.txt76
-rw-r--r--test/dump/compare.txt349
-rw-r--r--test/dump/const.txt235
-rw-r--r--test/dump/convert.txt108
-rw-r--r--test/dump/dedupe-sig.txt77
-rw-r--r--test/dump/export-multi.txt73
-rw-r--r--test/dump/expr-br.txt62
-rw-r--r--test/dump/expr-brif.txt71
-rw-r--r--test/dump/func-exported.txt65
-rw-r--r--test/dump/func-multi.txt66
-rw-r--r--test/dump/func-named.txt50
-rw-r--r--test/dump/getlocal-param.txt92
-rw-r--r--test/dump/getlocal.txt100
-rw-r--r--test/dump/grow-memory.txt71
-rw-r--r--test/dump/if-then-else-list.txt82
-rw-r--r--test/dump/if-then-list.txt64
-rw-r--r--test/dump/if.txt114
-rw-r--r--test/dump/import.txt69
-rw-r--r--test/dump/load-aligned.txt351
-rw-r--r--test/dump/load.txt198
-rw-r--r--test/dump/locals.txt66
-rw-r--r--test/dump/loop-257-exprs-br.txt177
-rw-r--r--test/dump/loop-257-exprs.txt159
-rw-r--r--test/dump/loop.txt58
-rw-r--r--test/dump/memory-1-byte.txt21
-rw-r--r--test/dump/memory-data-size.txt72
-rw-r--r--test/dump/memory-hex.txt38
-rw-r--r--test/dump/memory-size.txt65
-rw-r--r--test/dump/memory.txt44
-rw-r--r--test/dump/nop.txt52
-rw-r--r--test/dump/param-multi.txt58
-rw-r--r--test/dump/result.txt106
-rw-r--r--test/dump/return.txt70
-rw-r--r--test/dump/select.txt112
-rw-r--r--test/dump/setlocal-param.txt118
-rw-r--r--test/dump/setlocal.txt137
-rw-r--r--test/dump/signatures.txt67
-rw-r--r--test/dump/store-aligned.txt421
-rw-r--r--test/dump/store.txt180
-rw-r--r--test/dump/table.txt104
-rw-r--r--test/dump/unary.txt112
-rw-r--r--test/dump/unreachable.txt52
59 files changed, 3894 insertions, 2670 deletions
diff --git a/test/dump/basic.txt b/test/dump/basic.txt
index f2e6a16f..f757e982 100644
--- a/test/dump/basic.txt
+++ b/test/dump/basic.txt
@@ -8,53 +8,82 @@
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
0000004: 0a00 0000 ; WASM_BINARY_VERSION
-0000008: 00 ; WASM_BINARY_SECTION_MEMORY
-0000009: 01 ; min mem pages
-000000a: 01 ; max mem pages
-000000b: 00 ; export mem
-000000c: 01 ; WASM_BINARY_SECTION_SIGNATURES
-000000d: 01 ; num signatures
+; section "memory"
+0000008: 00 ; section size (guess)
+0000009: 06 ; string length
+000000a: 6d65 6d6f 7279 ; section id: "memory"
+0000010: 01 ; min mem pages
+0000011: 01 ; max mem pages
+0000012: 00 ; export mem
+0000008: 0a ; FIXUP section size
+; section "signatures"
+0000013: 00 ; section size (guess)
+0000014: 0a ; string length
+0000015: 7369 676e 6174 7572 6573 ; section id: "signatures"
+000001f: 01 ; num signatures
; signature 0
-000000e: 02 ; num params
-000000f: 01 ; result_type
-0000010: 01 ; param type
-0000011: 01 ; param type
-0000012: 0a ; WASM_BINARY_SECTION_FUNCTION_SIGNATURES
-0000013: 01 ; num functions
-0000014: 00 ; function 0 signature index
-0000015: 0b ; WASM_BINARY_SECTION_FUNCTION_BODIES
-0000016: 01 ; num functions
+0000020: 02 ; num params
+0000021: 01 ; result_type
+0000022: 01 ; param type
+0000023: 01 ; param type
+0000013: 10 ; FIXUP section size
+; section "function_signatures"
+0000024: 00 ; section size (guess)
+0000025: 13 ; string length
+0000026: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
+0000036: 7265 73 ; section id: "function_signatures"
+0000039: 01 ; num functions
+000003a: 00 ; function 0 signature index
+0000024: 16 ; FIXUP section size
+; section "function_bodies"
+000003b: 00 ; section size (guess)
+000003c: 0f ; string length
+000003d: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
+000004c: 01 ; num functions
; function body 0
-0000017: 00 ; func body size (guess)
-0000018: 00 ; local decl count
-0000019: 33 ; OPCODE_I32_STORE_MEM
-000001a: 02 ; alignment
-000001b: 00 ; store offset
-000001c: 0a ; OPCODE_I32_CONST
-000001d: 00 ; i32 literal
-000001e: 40 ; OPCODE_I32_ADD
-000001f: 2a ; OPCODE_I32_LOAD_MEM
-0000020: 02 ; alignment
-0000021: 00 ; load offset
-0000022: 0a ; OPCODE_I32_CONST
-0000023: 00 ; i32 literal
-0000024: 0a ; OPCODE_I32_CONST
-0000025: 01 ; i32 literal
-0000026: 40 ; OPCODE_I32_ADD
-0000027: 0e ; OPCODE_GET_LOCAL
-0000028: 00 ; remapped local index
-0000029: 0e ; OPCODE_GET_LOCAL
-000002a: 01 ; remapped local index
-0000017: 13 ; FIXUP func body size
-000002b: 09 ; WASM_BINARY_SECTION_EXPORTS
-000002c: 01 ; num exports
-000002d: 00 ; export func index
-000002e: 01 ; string length
-000002f: 66 ; export name
-0000030: 06 ; WASM_BINARY_SECTION_END
+000004d: 00 ; func body size (guess)
+000004e: 00 ; local decl count
+000004f: 33 ; OPCODE_I32_STORE_MEM
+0000050: 02 ; alignment
+0000051: 00 ; store offset
+0000052: 0a ; OPCODE_I32_CONST
+0000053: 00 ; i32 literal
+0000054: 40 ; OPCODE_I32_ADD
+0000055: 2a ; OPCODE_I32_LOAD_MEM
+0000056: 02 ; alignment
+0000057: 00 ; load offset
+0000058: 0a ; OPCODE_I32_CONST
+0000059: 00 ; i32 literal
+000005a: 0a ; OPCODE_I32_CONST
+000005b: 01 ; i32 literal
+000005c: 40 ; OPCODE_I32_ADD
+000005d: 0e ; OPCODE_GET_LOCAL
+000005e: 00 ; remapped local index
+000005f: 0e ; OPCODE_GET_LOCAL
+0000060: 01 ; remapped local index
+000004d: 13 ; FIXUP func body size
+000003b: 25 ; FIXUP section size
+; section "export_table"
+0000061: 00 ; section size (guess)
+0000062: 0c ; string length
+0000063: 6578 706f 7274 5f74 6162 6c65 ; section id: "export_table"
+000006f: 01 ; num exports
+0000070: 00 ; export func index
+0000071: 01 ; string length
+0000072: 66 ; export name
+0000061: 11 ; FIXUP section size
+; section "end"
+0000073: 00 ; section size (guess)
+0000074: 03 ; string length
+0000075: 656e 64 ; section id: "end"
+0000073: 04 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0001 0100 0101 0201
-0000010: 0101 0a01 000b 0113 0033 0200 0a00 402a
-0000020: 0200 0a00 0a01 400e 000e 0109 0100 0166
-0000030: 06
+0000000: 0061 736d 0a00 0000 0a06 6d65 6d6f 7279
+0000010: 0101 0010 0a73 6967 6e61 7475 7265 7301
+0000020: 0201 0101 1613 6675 6e63 7469 6f6e 5f73
+0000030: 6967 6e61 7475 7265 7301 0025 0f66 756e
+0000040: 6374 696f 6e5f 626f 6469 6573 0113 0033
+0000050: 0200 0a00 402a 0200 0a00 0a01 400e 000e
+0000060: 0111 0c65 7870 6f72 745f 7461 626c 6501
+0000070: 0001 6604 0365 6e64
;;; STDOUT ;;)
diff --git a/test/dump/binary.txt b/test/dump/binary.txt
index d7aaf417..f219dd0e 100644
--- a/test/dump/binary.txt
+++ b/test/dump/binary.txt
@@ -102,177 +102,198 @@
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
0000004: 0a00 0000 ; WASM_BINARY_VERSION
-0000008: 01 ; WASM_BINARY_SECTION_SIGNATURES
-0000009: 01 ; num signatures
+; section "signatures"
+0000008: 00 ; section size (guess)
+0000009: 0a ; string length
+000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
+0000014: 01 ; num signatures
; signature 0
-000000a: 00 ; num params
-000000b: 00 ; result_type
-000000c: 0a ; WASM_BINARY_SECTION_FUNCTION_SIGNATURES
-000000d: 01 ; num functions
-000000e: 00 ; function 0 signature index
-000000f: 0b ; WASM_BINARY_SECTION_FUNCTION_BODIES
-0000010: 01 ; num functions
+0000015: 00 ; num params
+0000016: 00 ; result_type
+0000008: 0e ; FIXUP section size
+; section "function_signatures"
+0000017: 00 ; section size (guess)
+0000018: 13 ; string length
+0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
+0000029: 7265 73 ; section id: "function_signatures"
+000002c: 01 ; num functions
+000002d: 00 ; function 0 signature index
+0000017: 16 ; FIXUP section size
+; section "function_bodies"
+000002e: 00 ; section size (guess)
+000002f: 0f ; string length
+0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
+000003f: 01 ; num functions
; function body 0
-0000011: 00 ; func body size (guess)
-0000012: 00 ; local decl count
-0000013: 40 ; OPCODE_I32_ADD
-0000014: 41 ; OPCODE_I32_SUB
-0000015: 42 ; OPCODE_I32_MUL
-0000016: 43 ; OPCODE_I32_DIV_S
-0000017: 44 ; OPCODE_I32_DIV_U
-0000018: 45 ; OPCODE_I32_REM_S
-0000019: 46 ; OPCODE_I32_REM_U
-000001a: 47 ; OPCODE_I32_AND
-000001b: 48 ; OPCODE_I32_OR
-000001c: 49 ; OPCODE_I32_XOR
-000001d: 4a ; OPCODE_I32_SHL
-000001e: 4b ; OPCODE_I32_SHR_U
-000001f: 4c ; OPCODE_I32_SHR_S
-0000020: b7 ; OPCODE_I32_ROL
-0000021: b6 ; OPCODE_I32_ROR
-0000022: 0a ; OPCODE_I32_CONST
-0000023: 00 ; i32 literal
-0000024: 0a ; OPCODE_I32_CONST
-0000025: 00 ; i32 literal
-0000026: 0a ; OPCODE_I32_CONST
-0000027: 00 ; i32 literal
-0000028: 0a ; OPCODE_I32_CONST
-0000029: 00 ; i32 literal
-000002a: 0a ; OPCODE_I32_CONST
-000002b: 00 ; i32 literal
-000002c: 0a ; OPCODE_I32_CONST
-000002d: 00 ; i32 literal
-000002e: 0a ; OPCODE_I32_CONST
-000002f: 00 ; i32 literal
-0000030: 0a ; OPCODE_I32_CONST
-0000031: 00 ; i32 literal
-0000032: 0a ; OPCODE_I32_CONST
-0000033: 00 ; i32 literal
-0000034: 0a ; OPCODE_I32_CONST
-0000035: 00 ; i32 literal
-0000036: 0a ; OPCODE_I32_CONST
-0000037: 00 ; i32 literal
-0000038: 0a ; OPCODE_I32_CONST
-0000039: 00 ; i32 literal
-000003a: 0a ; OPCODE_I32_CONST
-000003b: 00 ; i32 literal
-000003c: 0a ; OPCODE_I32_CONST
-000003d: 00 ; i32 literal
-000003e: 0a ; OPCODE_I32_CONST
-000003f: 00 ; i32 literal
-0000040: 0a ; OPCODE_I32_CONST
-0000041: 00 ; i32 literal
-0000042: 5b ; OPCODE_I64_ADD
-0000043: 5c ; OPCODE_I64_SUB
-0000044: 5d ; OPCODE_I64_MUL
-0000045: 5e ; OPCODE_I64_DIV_S
-0000046: 5f ; OPCODE_I64_DIV_U
-0000047: 60 ; OPCODE_I64_REM_S
-0000048: 61 ; OPCODE_I64_REM_U
-0000049: 62 ; OPCODE_I64_AND
-000004a: 63 ; OPCODE_I64_OR
-000004b: 64 ; OPCODE_I64_XOR
-000004c: 65 ; OPCODE_I64_SHL
-000004d: 66 ; OPCODE_I64_SHR_U
-000004e: 67 ; OPCODE_I64_SHR_S
-000004f: b9 ; OPCODE_I64_ROL
-0000050: b8 ; OPCODE_I64_ROR
-0000051: 0b ; OPCODE_I64_CONST
-0000052: 00 ; i64 literal
-0000053: 0b ; OPCODE_I64_CONST
-0000054: 00 ; i64 literal
-0000055: 0b ; OPCODE_I64_CONST
-0000056: 00 ; i64 literal
-0000057: 0b ; OPCODE_I64_CONST
-0000058: 00 ; i64 literal
-0000059: 0b ; OPCODE_I64_CONST
-000005a: 00 ; i64 literal
-000005b: 0b ; OPCODE_I64_CONST
-000005c: 00 ; i64 literal
-000005d: 0b ; OPCODE_I64_CONST
-000005e: 00 ; i64 literal
-000005f: 0b ; OPCODE_I64_CONST
-0000060: 00 ; i64 literal
-0000061: 0b ; OPCODE_I64_CONST
-0000062: 00 ; i64 literal
-0000063: 0b ; OPCODE_I64_CONST
-0000064: 00 ; i64 literal
-0000065: 0b ; OPCODE_I64_CONST
-0000066: 00 ; i64 literal
-0000067: 0b ; OPCODE_I64_CONST
-0000068: 00 ; i64 literal
-0000069: 0b ; OPCODE_I64_CONST
-000006a: 00 ; i64 literal
-000006b: 0b ; OPCODE_I64_CONST
-000006c: 00 ; i64 literal
-000006d: 0b ; OPCODE_I64_CONST
-000006e: 00 ; i64 literal
-000006f: 0b ; OPCODE_I64_CONST
-0000070: 00 ; i64 literal
-0000071: 75 ; OPCODE_F32_ADD
-0000072: 76 ; OPCODE_F32_SUB
-0000073: 77 ; OPCODE_F32_MUL
-0000074: 78 ; OPCODE_F32_DIV
-0000075: 79 ; OPCODE_F32_MIN
-0000076: 7a ; OPCODE_F32_MAX
-0000077: 7d ; OPCODE_F32_COPYSIGN
-0000078: 0d ; OPCODE_F32_CONST
-0000079: 0000 0000 ; f32 literal
-000007d: 0d ; OPCODE_F32_CONST
-000007e: 0000 0000 ; f32 literal
-0000082: 0d ; OPCODE_F32_CONST
-0000083: 0000 0000 ; f32 literal
-0000087: 0d ; OPCODE_F32_CONST
-0000088: 0000 0000 ; f32 literal
-000008c: 0d ; OPCODE_F32_CONST
-000008d: 0000 0000 ; f32 literal
-0000091: 0d ; OPCODE_F32_CONST
-0000092: 0000 0000 ; f32 literal
-0000096: 0d ; OPCODE_F32_CONST
-0000097: 0000 0000 ; f32 literal
-000009b: 0d ; OPCODE_F32_CONST
-000009c: 0000 0000 ; f32 literal
-00000a0: 89 ; OPCODE_F64_ADD
-00000a1: 8a ; OPCODE_F64_SUB
-00000a2: 8b ; OPCODE_F64_MUL
-00000a3: 8c ; OPCODE_F64_DIV
-00000a4: 8d ; OPCODE_F64_MIN
-00000a5: 8e ; OPCODE_F64_MAX
-00000a6: 91 ; OPCODE_F64_COPYSIGN
-00000a7: 0c ; OPCODE_F64_CONST
-00000a8: 0000 0000 0000 0000 ; f64 literal
-00000b0: 0c ; OPCODE_F64_CONST
-00000b1: 0000 0000 0000 0000 ; f64 literal
-00000b9: 0c ; OPCODE_F64_CONST
-00000ba: 0000 0000 0000 0000 ; f64 literal
-00000c2: 0c ; OPCODE_F64_CONST
-00000c3: 0000 0000 0000 0000 ; f64 literal
-00000cb: 0c ; OPCODE_F64_CONST
-00000cc: 0000 0000 0000 0000 ; f64 literal
-00000d4: 0c ; OPCODE_F64_CONST
-00000d5: 0000 0000 0000 0000 ; f64 literal
-00000dd: 0c ; OPCODE_F64_CONST
-00000de: 0000 0000 0000 0000 ; f64 literal
-00000e6: 0c ; OPCODE_F64_CONST
-00000e7: 0000 0000 0000 0000 ; f64 literal
-; move data: [12, ef) -> [13, f0)
-0000011: dd01 ; FIXUP func body size
-00000f0: 06 ; WASM_BINARY_SECTION_END
+0000040: 00 ; func body size (guess)
+0000041: 00 ; local decl count
+0000042: 40 ; OPCODE_I32_ADD
+0000043: 41 ; OPCODE_I32_SUB
+0000044: 42 ; OPCODE_I32_MUL
+0000045: 43 ; OPCODE_I32_DIV_S
+0000046: 44 ; OPCODE_I32_DIV_U
+0000047: 45 ; OPCODE_I32_REM_S
+0000048: 46 ; OPCODE_I32_REM_U
+0000049: 47 ; OPCODE_I32_AND
+000004a: 48 ; OPCODE_I32_OR
+000004b: 49 ; OPCODE_I32_XOR
+000004c: 4a ; OPCODE_I32_SHL
+000004d: 4b ; OPCODE_I32_SHR_U
+000004e: 4c ; OPCODE_I32_SHR_S
+000004f: b7 ; OPCODE_I32_ROL
+0000050: b6 ; OPCODE_I32_ROR
+0000051: 0a ; OPCODE_I32_CONST
+0000052: 00 ; i32 literal
+0000053: 0a ; OPCODE_I32_CONST
+0000054: 00 ; i32 literal
+0000055: 0a ; OPCODE_I32_CONST
+0000056: 00 ; i32 literal
+0000057: 0a ; OPCODE_I32_CONST
+0000058: 00 ; i32 literal
+0000059: 0a ; OPCODE_I32_CONST
+000005a: 00 ; i32 literal
+000005b: 0a ; OPCODE_I32_CONST
+000005c: 00 ; i32 literal
+000005d: 0a ; OPCODE_I32_CONST
+000005e: 00 ; i32 literal
+000005f: 0a ; OPCODE_I32_CONST
+0000060: 00 ; i32 literal
+0000061: 0a ; OPCODE_I32_CONST
+0000062: 00 ; i32 literal
+0000063: 0a ; OPCODE_I32_CONST
+0000064: 00 ; i32 literal
+0000065: 0a ; OPCODE_I32_CONST
+0000066: 00 ; i32 literal
+0000067: 0a ; OPCODE_I32_CONST
+0000068: 00 ; i32 literal
+0000069: 0a ; OPCODE_I32_CONST
+000006a: 00 ; i32 literal
+000006b: 0a ; OPCODE_I32_CONST
+000006c: 00 ; i32 literal
+000006d: 0a ; OPCODE_I32_CONST
+000006e: 00 ; i32 literal
+000006f: 0a ; OPCODE_I32_CONST
+0000070: 00 ; i32 literal
+0000071: 5b ; OPCODE_I64_ADD
+0000072: 5c ; OPCODE_I64_SUB
+0000073: 5d ; OPCODE_I64_MUL
+0000074: 5e ; OPCODE_I64_DIV_S
+0000075: 5f ; OPCODE_I64_DIV_U
+0000076: 60 ; OPCODE_I64_REM_S
+0000077: 61 ; OPCODE_I64_REM_U
+0000078: 62 ; OPCODE_I64_AND
+0000079: 63 ; OPCODE_I64_OR
+000007a: 64 ; OPCODE_I64_XOR
+000007b: 65 ; OPCODE_I64_SHL
+000007c: 66 ; OPCODE_I64_SHR_U
+000007d: 67 ; OPCODE_I64_SHR_S
+000007e: b9 ; OPCODE_I64_ROL
+000007f: b8 ; OPCODE_I64_ROR
+0000080: 0b ; OPCODE_I64_CONST
+0000081: 00 ; i64 literal
+0000082: 0b ; OPCODE_I64_CONST
+0000083: 00 ; i64 literal
+0000084: 0b ; OPCODE_I64_CONST
+0000085: 00 ; i64 literal
+0000086: 0b ; OPCODE_I64_CONST
+0000087: 00 ; i64 literal
+0000088: 0b ; OPCODE_I64_CONST
+0000089: 00 ; i64 literal
+000008a: 0b ; OPCODE_I64_CONST
+000008b: 00 ; i64 literal
+000008c: 0b ; OPCODE_I64_CONST
+000008d: 00 ; i64 literal
+000008e: 0b ; OPCODE_I64_CONST
+000008f: 00 ; i64 literal
+0000090: 0b ; OPCODE_I64_CONST
+0000091: 00 ; i64 literal
+0000092: 0b ; OPCODE_I64_CONST
+0000093: 00 ; i64 literal
+0000094: 0b ; OPCODE_I64_CONST
+0000095: 00 ; i64 literal
+0000096: 0b ; OPCODE_I64_CONST
+0000097: 00 ; i64 literal
+0000098: 0b ; OPCODE_I64_CONST
+0000099: 00 ; i64 literal
+000009a: 0b ; OPCODE_I64_CONST
+000009b: 00 ; i64 literal
+000009c: 0b ; OPCODE_I64_CONST
+000009d: 00 ; i64 literal
+000009e: 0b ; OPCODE_I64_CONST
+000009f: 00 ; i64 literal
+00000a0: 75 ; OPCODE_F32_ADD
+00000a1: 76 ; OPCODE_F32_SUB
+00000a2: 77 ; OPCODE_F32_MUL
+00000a3: 78 ; OPCODE_F32_DIV
+00000a4: 79 ; OPCODE_F32_MIN
+00000a5: 7a ; OPCODE_F32_MAX
+00000a6: 7d ; OPCODE_F32_COPYSIGN
+00000a7: 0d ; OPCODE_F32_CONST
+00000a8: 0000 0000 ; f32 literal
+00000ac: 0d ; OPCODE_F32_CONST
+00000ad: 0000 0000 ; f32 literal
+00000b1: 0d ; OPCODE_F32_CONST
+00000b2: 0000 0000 ; f32 literal
+00000b6: 0d ; OPCODE_F32_CONST
+00000b7: 0000 0000 ; f32 literal
+00000bb: 0d ; OPCODE_F32_CONST
+00000bc: 0000 0000 ; f32 literal
+00000c0: 0d ; OPCODE_F32_CONST
+00000c1: 0000 0000 ; f32 literal
+00000c5: 0d ; OPCODE_F32_CONST
+00000c6: 0000 0000 ; f32 literal
+00000ca: 0d ; OPCODE_F32_CONST
+00000cb: 0000 0000 ; f32 literal
+00000cf: 89 ; OPCODE_F64_ADD
+00000d0: 8a ; OPCODE_F64_SUB
+00000d1: 8b ; OPCODE_F64_MUL
+00000d2: 8c ; OPCODE_F64_DIV
+00000d3: 8d ; OPCODE_F64_MIN
+00000d4: 8e ; OPCODE_F64_MAX
+00000d5: 91 ; OPCODE_F64_COPYSIGN
+00000d6: 0c ; OPCODE_F64_CONST
+00000d7: 0000 0000 0000 0000 ; f64 literal
+00000df: 0c ; OPCODE_F64_CONST
+00000e0: 0000 0000 0000 0000 ; f64 literal
+00000e8: 0c ; OPCODE_F64_CONST
+00000e9: 0000 0000 0000 0000 ; f64 literal
+00000f1: 0c ; OPCODE_F64_CONST
+00000f2: 0000 0000 0000 0000 ; f64 literal
+00000fa: 0c ; OPCODE_F64_CONST
+00000fb: 0000 0000 0000 0000 ; f64 literal
+0000103: 0c ; OPCODE_F64_CONST
+0000104: 0000 0000 0000 0000 ; f64 literal
+000010c: 0c ; OPCODE_F64_CONST
+000010d: 0000 0000 0000 0000 ; f64 literal
+0000115: 0c ; OPCODE_F64_CONST
+0000116: 0000 0000 0000 0000 ; f64 literal
+; move data: [41, 11e) -> [42, 11f)
+0000040: dd01 ; FIXUP func body size
+; move data: [2f, 11f) -> [30, 120)
+000002e: f001 ; FIXUP section size
+; section "end"
+0000120: 00 ; section size (guess)
+0000121: 03 ; string length
+0000122: 656e 64 ; section id: "end"
+0000120: 04 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0101 0000 0a01 000b
-0000010: 01dd 0100 4041 4243 4445 4647 4849 4a4b
-0000020: 4cb7 b60a 000a 000a 000a 000a 000a 000a
-0000030: 000a 000a 000a 000a 000a 000a 000a 000a
-0000040: 000a 005b 5c5d 5e5f 6061 6263 6465 6667
-0000050: b9b8 0b00 0b00 0b00 0b00 0b00 0b00 0b00
-0000060: 0b00 0b00 0b00 0b00 0b00 0b00 0b00 0b00
-0000070: 0b00 7576 7778 797a 7d0d 0000 0000 0d00
-0000080: 0000 000d 0000 0000 0d00 0000 000d 0000
-0000090: 0000 0d00 0000 000d 0000 0000 0d00 0000
-00000a0: 0089 8a8b 8c8d 8e91 0c00 0000 0000 0000
-00000b0: 000c 0000 0000 0000 0000 0c00 0000 0000
-00000c0: 0000 000c 0000 0000 0000 0000 0c00 0000
-00000d0: 0000 0000 000c 0000 0000 0000 0000 0c00
-00000e0: 0000 0000 0000 000c 0000 0000 0000 0000
-00000f0: 06
+0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
+0000010: 7572 6573 0100 0016 1366 756e 6374 696f
+0000020: 6e5f 7369 676e 6174 7572 6573 0100 f001
+0000030: 0f66 756e 6374 696f 6e5f 626f 6469 6573
+0000040: 01dd 0100 4041 4243 4445 4647 4849 4a4b
+0000050: 4cb7 b60a 000a 000a 000a 000a 000a 000a
+0000060: 000a 000a 000a 000a 000a 000a 000a 000a
+0000070: 000a 005b 5c5d 5e5f 6061 6263 6465 6667
+0000080: b9b8 0b00 0b00 0b00 0b00 0b00 0b00 0b00
+0000090: 0b00 0b00 0b00 0b00 0b00 0b00 0b00 0b00
+00000a0: 0b00 7576 7778 797a 7d0d 0000 0000 0d00
+00000b0: 0000 000d 0000 0000 0d00 0000 000d 0000
+00000c0: 0000 0d00 0000 000d 0000 0000 0d00 0000
+00000d0: 0089 8a8b 8c8d 8e91 0c00 0000 0000 0000
+00000e0: 000c 0000 0000 0000 0000 0c00 0000 0000
+00000f0: 0000 000c 0000 0000 0000 0000 0c00 0000
+0000100: 0000 0000 000c 0000 0000 0000 0000 0c00
+0000110: 0000 0000 0000 000c 0000 0000 0000 0000
+0000120: 0403 656e 64
;;; STDOUT ;;)
diff --git a/test/dump/block-257-exprs-br.txt b/test/dump/block-257-exprs-br.txt
index 420aa67f..37566e8d 100644
--- a/test/dump/block-257-exprs-br.txt
+++ b/test/dump/block-257-exprs-br.txt
@@ -49,68 +49,33 @@
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
0000004: 0a00 0000 ; WASM_BINARY_VERSION
-0000008: 01 ; WASM_BINARY_SECTION_SIGNATURES
-0000009: 01 ; num signatures
+; section "signatures"
+0000008: 00 ; section size (guess)
+0000009: 0a ; string length
+000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
+0000014: 01 ; num signatures
; signature 0
-000000a: 00 ; num params
-000000b: 00 ; result_type
-000000c: 0a ; WASM_BINARY_SECTION_FUNCTION_SIGNATURES
-000000d: 01 ; num functions
-000000e: 00 ; function 0 signature index
-000000f: 0b ; WASM_BINARY_SECTION_FUNCTION_BODIES
-0000010: 01 ; num functions
+0000015: 00 ; num params
+0000016: 00 ; result_type
+0000008: 0e ; FIXUP section size
+; section "function_signatures"
+0000017: 00 ; section size (guess)
+0000018: 13 ; string length
+0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
+0000029: 7265 73 ; section id: "function_signatures"
+000002c: 01 ; num functions
+000002d: 00 ; function 0 signature index
+0000017: 16 ; FIXUP section size
+; section "function_bodies"
+000002e: 00 ; section size (guess)
+000002f: 0f ; string length
+0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
+000003f: 01 ; num functions
; function body 0
-0000011: 00 ; func body size (guess)
-0000012: 00 ; local decl count
-0000013: 01 ; OPCODE_BLOCK
-0000014: 8202 ; num expressions
-0000016: 00 ; OPCODE_NOP
-0000017: 00 ; OPCODE_NOP
-0000018: 00 ; OPCODE_NOP
-0000019: 00 ; OPCODE_NOP
-000001a: 00 ; OPCODE_NOP
-000001b: 00 ; OPCODE_NOP
-000001c: 00 ; OPCODE_NOP
-000001d: 00 ; OPCODE_NOP
-000001e: 00 ; OPCODE_NOP
-000001f: 00 ; OPCODE_NOP
-0000020: 00 ; OPCODE_NOP
-0000021: 00 ; OPCODE_NOP
-0000022: 00 ; OPCODE_NOP
-0000023: 00 ; OPCODE_NOP
-0000024: 00 ; OPCODE_NOP
-0000025: 00 ; OPCODE_NOP
-0000026: 00 ; OPCODE_NOP
-0000027: 00 ; OPCODE_NOP
-0000028: 00 ; OPCODE_NOP
-0000029: 00 ; OPCODE_NOP
-000002a: 00 ; OPCODE_NOP
-000002b: 00 ; OPCODE_NOP
-000002c: 00 ; OPCODE_NOP
-000002d: 00 ; OPCODE_NOP
-000002e: 00 ; OPCODE_NOP
-000002f: 00 ; OPCODE_NOP
-0000030: 00 ; OPCODE_NOP
-0000031: 00 ; OPCODE_NOP
-0000032: 00 ; OPCODE_NOP
-0000033: 00 ; OPCODE_NOP
-0000034: 00 ; OPCODE_NOP
-0000035: 00 ; OPCODE_NOP
-0000036: 00 ; OPCODE_NOP
-0000037: 00 ; OPCODE_NOP
-0000038: 00 ; OPCODE_NOP
-0000039: 00 ; OPCODE_NOP
-000003a: 00 ; OPCODE_NOP
-000003b: 00 ; OPCODE_NOP
-000003c: 00 ; OPCODE_NOP
-000003d: 00 ; OPCODE_NOP
-000003e: 00 ; OPCODE_NOP
-000003f: 00 ; OPCODE_NOP
-0000040: 00 ; OPCODE_NOP
-0000041: 00 ; OPCODE_NOP
-0000042: 00 ; OPCODE_NOP
-0000043: 00 ; OPCODE_NOP
-0000044: 00 ; OPCODE_NOP
+0000040: 00 ; func body size (guess)
+0000041: 00 ; local decl count
+0000042: 01 ; OPCODE_BLOCK
+0000043: 8202 ; num expressions
0000045: 00 ; OPCODE_NOP
0000046: 00 ; OPCODE_NOP
0000047: 00 ; OPCODE_NOP
@@ -320,21 +285,74 @@
0000113: 00 ; OPCODE_NOP
0000114: 00 ; OPCODE_NOP
0000115: 00 ; OPCODE_NOP
-0000116: 06 ; OPCODE_BR
-0000117: 00 ; break depth
+0000116: 00 ; OPCODE_NOP
+0000117: 00 ; OPCODE_NOP
0000118: 00 ; OPCODE_NOP
-0000119: 06 ; OPCODE_BR
-000011a: 00 ; break depth
+0000119: 00 ; OPCODE_NOP
+000011a: 00 ; OPCODE_NOP
000011b: 00 ; OPCODE_NOP
-; move data: [12, 11c) -> [13, 11d)
-0000011: 8a02 ; FIXUP func body size
-000011d: 06 ; WASM_BINARY_SECTION_END
+000011c: 00 ; OPCODE_NOP
+000011d: 00 ; OPCODE_NOP
+000011e: 00 ; OPCODE_NOP
+000011f: 00 ; OPCODE_NOP
+0000120: 00 ; OPCODE_NOP
+0000121: 00 ; OPCODE_NOP
+0000122: 00 ; OPCODE_NOP
+0000123: 00 ; OPCODE_NOP
+0000124: 00 ; OPCODE_NOP
+0000125: 00 ; OPCODE_NOP
+0000126: 00 ; OPCODE_NOP
+0000127: 00 ; OPCODE_NOP
+0000128: 00 ; OPCODE_NOP
+0000129: 00 ; OPCODE_NOP
+000012a: 00 ; OPCODE_NOP
+000012b: 00 ; OPCODE_NOP
+000012c: 00 ; OPCODE_NOP
+000012d: 00 ; OPCODE_NOP
+000012e: 00 ; OPCODE_NOP
+000012f: 00 ; OPCODE_NOP
+0000130: 00 ; OPCODE_NOP
+0000131: 00 ; OPCODE_NOP
+0000132: 00 ; OPCODE_NOP
+0000133: 00 ; OPCODE_NOP
+0000134: 00 ; OPCODE_NOP
+0000135: 00 ; OPCODE_NOP
+0000136: 00 ; OPCODE_NOP
+0000137: 00 ; OPCODE_NOP
+0000138: 00 ; OPCODE_NOP
+0000139: 00 ; OPCODE_NOP
+000013a: 00 ; OPCODE_NOP
+000013b: 00 ; OPCODE_NOP
+000013c: 00 ; OPCODE_NOP
+000013d: 00 ; OPCODE_NOP
+000013e: 00 ; OPCODE_NOP
+000013f: 00 ; OPCODE_NOP
+0000140: 00 ; OPCODE_NOP
+0000141: 00 ; OPCODE_NOP
+0000142: 00 ; OPCODE_NOP
+0000143: 00 ; OPCODE_NOP
+0000144: 00 ; OPCODE_NOP
+0000145: 06 ; OPCODE_BR
+0000146: 00 ; break depth
+0000147: 00 ; OPCODE_NOP
+0000148: 06 ; OPCODE_BR
+0000149: 00 ; break depth
+000014a: 00 ; OPCODE_NOP
+; move data: [41, 14b) -> [42, 14c)
+0000040: 8a02 ; FIXUP func body size
+; move data: [2f, 14c) -> [30, 14d)
+000002e: 9d02 ; FIXUP section size
+; section "end"
+000014d: 00 ; section size (guess)
+000014e: 03 ; string length
+000014f: 656e 64 ; section id: "end"
+000014d: 04 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0101 0000 0a01 000b
-0000010: 018a 0200 0182 0200 0000 0000 0000 0000
-0000020: 0000 0000 0000 0000 0000 0000 0000 0000
-0000030: 0000 0000 0000 0000 0000 0000 0000 0000
-0000040: 0000 0000 0000 0000 0000 0000 0000 0000
+0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
+0000010: 7572 6573 0100 0016 1366 756e 6374 696f
+0000020: 6e5f 7369 676e 6174 7572 6573 0100 9d02
+0000030: 0f66 756e 6374 696f 6e5f 626f 6469 6573
+0000040: 018a 0200 0182 0200 0000 0000 0000 0000
0000050: 0000 0000 0000 0000 0000 0000 0000 0000
0000060: 0000 0000 0000 0000 0000 0000 0000 0000
0000070: 0000 0000 0000 0000 0000 0000 0000 0000
@@ -347,5 +365,9 @@
00000e0: 0000 0000 0000 0000 0000 0000 0000 0000
00000f0: 0000 0000 0000 0000 0000 0000 0000 0000
0000100: 0000 0000 0000 0000 0000 0000 0000 0000
-0000110: 0000 0000 0000 0006 0000 0600 0006
+0000110: 0000 0000 0000 0000 0000 0000 0000 0000
+0000120: 0000 0000 0000 0000 0000 0000 0000 0000
+0000130: 0000 0000 0000 0000 0000 0000 0000 0000
+0000140: 0000 0000 0000 0006 0000 0600 0004 0365
+0000150: 6e64
;;; STDOUT ;;)
diff --git a/test/dump/block-257-exprs.txt b/test/dump/block-257-exprs.txt
index ab2cc8bc..826d70da 100644
--- a/test/dump/block-257-exprs.txt
+++ b/test/dump/block-257-exprs.txt
@@ -47,68 +47,33 @@
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
0000004: 0a00 0000 ; WASM_BINARY_VERSION
-0000008: 01 ; WASM_BINARY_SECTION_SIGNATURES
-0000009: 01 ; num signatures
+; section "signatures"
+0000008: 00 ; section size (guess)
+0000009: 0a ; string length
+000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
+0000014: 01 ; num signatures
; signature 0
-000000a: 00 ; num params
-000000b: 00 ; result_type
-000000c: 0a ; WASM_BINARY_SECTION_FUNCTION_SIGNATURES
-000000d: 01 ; num functions
-000000e: 00 ; function 0 signature index
-000000f: 0b ; WASM_BINARY_SECTION_FUNCTION_BODIES
-0000010: 01 ; num functions
+0000015: 00 ; num params
+0000016: 00 ; result_type
+0000008: 0e ; FIXUP section size
+; section "function_signatures"
+0000017: 00 ; section size (guess)
+0000018: 13 ; string length
+0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
+0000029: 7265 73 ; section id: "function_signatures"
+000002c: 01 ; num functions
+000002d: 00 ; function 0 signature index
+0000017: 16 ; FIXUP section size
+; section "function_bodies"
+000002e: 00 ; section size (guess)
+000002f: 0f ; string length
+0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
+000003f: 01 ; num functions
; function body 0
-0000011: 00 ; func body size (guess)
-0000012: 00 ; local decl count
-0000013: 01 ; OPCODE_BLOCK
-0000014: 8102 ; num expressions
-0000016: 00 ; OPCODE_NOP
-0000017: 00 ; OPCODE_NOP
-0000018: 00 ; OPCODE_NOP
-0000019: 00 ; OPCODE_NOP
-000001a: 00 ; OPCODE_NOP
-000001b: 00 ; OPCODE_NOP
-000001c: 00 ; OPCODE_NOP
-000001d: 00 ; OPCODE_NOP
-000001e: 00 ; OPCODE_NOP
-000001f: 00 ; OPCODE_NOP
-0000020: 00 ; OPCODE_NOP
-0000021: 00 ; OPCODE_NOP
-0000022: 00 ; OPCODE_NOP
-0000023: 00 ; OPCODE_NOP
-0000024: 00 ; OPCODE_NOP
-0000025: 00 ; OPCODE_NOP
-0000026: 00 ; OPCODE_NOP
-0000027: 00 ; OPCODE_NOP
-0000028: 00 ; OPCODE_NOP
-0000029: 00 ; OPCODE_NOP
-000002a: 00 ; OPCODE_NOP
-000002b: 00 ; OPCODE_NOP
-000002c: 00 ; OPCODE_NOP
-000002d: 00 ; OPCODE_NOP
-000002e: 00 ; OPCODE_NOP
-000002f: 00 ; OPCODE_NOP
-0000030: 00 ; OPCODE_NOP
-0000031: 00 ; OPCODE_NOP
-0000032: 00 ; OPCODE_NOP
-0000033: 00 ; OPCODE_NOP
-0000034: 00 ; OPCODE_NOP
-0000035: 00 ; OPCODE_NOP
-0000036: 00 ; OPCODE_NOP
-0000037: 00 ; OPCODE_NOP
-0000038: 00 ; OPCODE_NOP
-0000039: 00 ; OPCODE_NOP
-000003a: 00 ; OPCODE_NOP
-000003b: 00 ; OPCODE_NOP
-000003c: 00 ; OPCODE_NOP
-000003d: 00 ; OPCODE_NOP
-000003e: 00 ; OPCODE_NOP
-000003f: 00 ; OPCODE_NOP
-0000040: 00 ; OPCODE_NOP
-0000041: 00 ; OPCODE_NOP
-0000042: 00 ; OPCODE_NOP
-0000043: 00 ; OPCODE_NOP
-0000044: 00 ; OPCODE_NOP
+0000040: 00 ; func body size (guess)
+0000041: 00 ; local decl count
+0000042: 01 ; OPCODE_BLOCK
+0000043: 8102 ; num expressions
0000045: 00 ; OPCODE_NOP
0000046: 00 ; OPCODE_NOP
0000047: 00 ; OPCODE_NOP
@@ -319,15 +284,68 @@
0000114: 00 ; OPCODE_NOP
0000115: 00 ; OPCODE_NOP
0000116: 00 ; OPCODE_NOP
-; move data: [12, 117) -> [13, 118)
-0000011: 8502 ; FIXUP func body size
-0000118: 06 ; WASM_BINARY_SECTION_END
+0000117: 00 ; OPCODE_NOP
+0000118: 00 ; OPCODE_NOP
+0000119: 00 ; OPCODE_NOP
+000011a: 00 ; OPCODE_NOP
+000011b: 00 ; OPCODE_NOP
+000011c: 00 ; OPCODE_NOP
+000011d: 00 ; OPCODE_NOP
+000011e: 00 ; OPCODE_NOP
+000011f: 00 ; OPCODE_NOP
+0000120: 00 ; OPCODE_NOP
+0000121: 00 ; OPCODE_NOP
+0000122: 00 ; OPCODE_NOP
+0000123: 00 ; OPCODE_NOP
+0000124: 00 ; OPCODE_NOP
+0000125: 00 ; OPCODE_NOP
+0000126: 00 ; OPCODE_NOP
+0000127: 00 ; OPCODE_NOP
+0000128: 00 ; OPCODE_NOP
+0000129: 00 ; OPCODE_NOP
+000012a: 00 ; OPCODE_NOP
+000012b: 00 ; OPCODE_NOP
+000012c: 00 ; OPCODE_NOP
+000012d: 00 ; OPCODE_NOP
+000012e: 00 ; OPCODE_NOP
+000012f: 00 ; OPCODE_NOP
+0000130: 00 ; OPCODE_NOP
+0000131: 00 ; OPCODE_NOP
+0000132: 00 ; OPCODE_NOP
+0000133: 00 ; OPCODE_NOP
+0000134: 00 ; OPCODE_NOP
+0000135: 00 ; OPCODE_NOP
+0000136: 00 ; OPCODE_NOP
+0000137: 00 ; OPCODE_NOP
+0000138: 00 ; OPCODE_NOP
+0000139: 00 ; OPCODE_NOP
+000013a: 00 ; OPCODE_NOP
+000013b: 00 ; OPCODE_NOP
+000013c: 00 ; OPCODE_NOP
+000013d: 00 ; OPCODE_NOP
+000013e: 00 ; OPCODE_NOP
+000013f: 00 ; OPCODE_NOP
+0000140: 00 ; OPCODE_NOP
+0000141: 00 ; OPCODE_NOP
+0000142: 00 ; OPCODE_NOP
+0000143: 00 ; OPCODE_NOP
+0000144: 00 ; OPCODE_NOP
+0000145: 00 ; OPCODE_NOP
+; move data: [41, 146) -> [42, 147)
+0000040: 8502 ; FIXUP func body size
+; move data: [2f, 147) -> [30, 148)
+000002e: 9802 ; FIXUP section size
+; section "end"
+0000148: 00 ; section size (guess)
+0000149: 03 ; string length
+000014a: 656e 64 ; section id: "end"
+0000148: 04 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0101 0000 0a01 000b
-0000010: 0185 0200 0181 0200 0000 0000 0000 0000
-0000020: 0000 0000 0000 0000 0000 0000 0000 0000
-0000030: 0000 0000 0000 0000 0000 0000 0000 0000
-0000040: 0000 0000 0000 0000 0000 0000 0000 0000
+0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
+0000010: 7572 6573 0100 0016 1366 756e 6374 696f
+0000020: 6e5f 7369 676e 6174 7572 6573 0100 9802
+0000030: 0f66 756e 6374 696f 6e5f 626f 6469 6573
+0000040: 0185 0200 0181 0200 0000 0000 0000 0000
0000050: 0000 0000 0000 0000 0000 0000 0000 0000
0000060: 0000 0000 0000 0000 0000 0000 0000 0000
0000070: 0000 0000 0000 0000 0000 0000 0000 0000
@@ -340,5 +358,8 @@
00000e0: 0000 0000 0000 0000 0000 0000 0000 0000
00000f0: 0000 0000 0000 0000 0000 0000 0000 0000
0000100: 0000 0000 0000 0000 0000 0000 0000 0000
-0000110: 0000 0000 0000 0000 06
+0000110: 0000 0000 0000 0000 0000 0000 0000 0000
+0000120: 0000 0000 0000 0000 0000 0000 0000 0000
+0000130: 0000 0000 0000 0000 0000 0000 0000 0000
+0000140: 0000 0000 0000 0000 0403 656e 64
;;; STDOUT ;;)
diff --git a/test/dump/block.txt b/test/dump/block.txt
index 19cf16d4..0459f3e9 100644
--- a/test/dump/block.txt
+++ b/test/dump/block.txt
@@ -12,40 +12,60 @@
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
0000004: 0a00 0000 ; WASM_BINARY_VERSION
-0000008: 01 ; WASM_BINARY_SECTION_SIGNATURES
-0000009: 02 ; num signatures
+; section "signatures"
+0000008: 00 ; section size (guess)
+0000009: 0a ; string length
+000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
+0000014: 02 ; num signatures
; signature 0
-000000a: 00 ; num params
-000000b: 00 ; result_type
+0000015: 00 ; num params
+0000016: 00 ; result_type
; signature 1
-000000c: 00 ; num params
-000000d: 01 ; result_type
-000000e: 0a ; WASM_BINARY_SECTION_FUNCTION_SIGNATURES
-000000f: 02 ; num functions
-0000010: 00 ; function 0 signature index
-0000011: 01 ; function 1 signature index
-0000012: 0b ; WASM_BINARY_SECTION_FUNCTION_BODIES
-0000013: 02 ; num functions
+0000017: 00 ; num params
+0000018: 01 ; result_type
+0000008: 10 ; FIXUP section size
+; section "function_signatures"
+0000019: 00 ; section size (guess)
+000001a: 13 ; string length
+000001b: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
+000002b: 7265 73 ; section id: "function_signatures"
+000002e: 02 ; num functions
+000002f: 00 ; function 0 signature index
+0000030: 01 ; function 1 signature index
+0000019: 17 ; FIXUP section size
+; section "function_bodies"
+0000031: 00 ; section size (guess)
+0000032: 0f ; string length
+0000033: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
+0000042: 02 ; num functions
; function body 0
-0000014: 00 ; func body size (guess)
-0000015: 00 ; local decl count
-0000016: 01 ; OPCODE_BLOCK
-0000017: 03 ; num expressions
-0000018: 00 ; OPCODE_NOP
-0000019: 00 ; OPCODE_NOP
-000001a: 00 ; OPCODE_NOP
-0000014: 06 ; FIXUP func body size
+0000043: 00 ; func body size (guess)
+0000044: 00 ; local decl count
+0000045: 01 ; OPCODE_BLOCK
+0000046: 03 ; num expressions
+0000047: 00 ; OPCODE_NOP
+0000048: 00 ; OPCODE_NOP
+0000049: 00 ; OPCODE_NOP
+0000043: 06 ; FIXUP func body size
; function body 1
-000001b: 00 ; func body size (guess)
-000001c: 00 ; local decl count
-000001d: 01 ; OPCODE_BLOCK
-000001e: 01 ; num expressions
-000001f: 0a ; OPCODE_I32_CONST
-0000020: 01 ; i32 literal
-000001b: 05 ; FIXUP func body size
-0000021: 06 ; WASM_BINARY_SECTION_END
+000004a: 00 ; func body size (guess)
+000004b: 00 ; local decl count
+000004c: 01 ; OPCODE_BLOCK
+000004d: 01 ; num expressions
+000004e: 0a ; OPCODE_I32_CONST
+000004f: 01 ; i32 literal
+000004a: 05 ; FIXUP func body size
+0000031: 1e ; FIXUP section size
+; section "end"
+0000050: 00 ; section size (guess)
+0000051: 03 ; string length
+0000052: 656e 64 ; section id: "end"
+0000050: 04 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0102 0000 0001 0a02
-0000010: 0001 0b02 0600 0103 0000 0005 0001 010a
-0000020: 0106
+0000000: 0061 736d 0a00 0000 100a 7369 676e 6174
+0000010: 7572 6573 0200 0000 0117 1366 756e 6374
+0000020: 696f 6e5f 7369 676e 6174 7572 6573 0200
+0000030: 011e 0f66 756e 6374 696f 6e5f 626f 6469
+0000040: 6573 0206 0001 0300 0000 0500 0101 0a01
+0000050: 0403 656e 64
;;; STDOUT ;;)
diff --git a/test/dump/br-block-named.txt b/test/dump/br-block-named.txt
index 37a87a12..de4c883e 100644
--- a/test/dump/br-block-named.txt
+++ b/test/dump/br-block-named.txt
@@ -11,39 +11,59 @@
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
0000004: 0a00 0000 ; WASM_BINARY_VERSION
-0000008: 01 ; WASM_BINARY_SECTION_SIGNATURES
-0000009: 01 ; num signatures
+; section "signatures"
+0000008: 00 ; section size (guess)
+0000009: 0a ; string length
+000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
+0000014: 01 ; num signatures
; signature 0
-000000a: 00 ; num params
-000000b: 00 ; result_type
-000000c: 0a ; WASM_BINARY_SECTION_FUNCTION_SIGNATURES
-000000d: 01 ; num functions
-000000e: 00 ; function 0 signature index
-000000f: 0b ; WASM_BINARY_SECTION_FUNCTION_BODIES
-0000010: 01 ; num functions
+0000015: 00 ; num params
+0000016: 00 ; result_type
+0000008: 0e ; FIXUP section size
+; section "function_signatures"
+0000017: 00 ; section size (guess)
+0000018: 13 ; string length
+0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
+0000029: 7265 73 ; section id: "function_signatures"
+000002c: 01 ; num functions
+000002d: 00 ; function 0 signature index
+0000017: 16 ; FIXUP section size
+; section "function_bodies"
+000002e: 00 ; section size (guess)
+000002f: 0f ; string length
+0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
+000003f: 01 ; num functions
; function body 0
-0000011: 00 ; func body size (guess)
-0000012: 00 ; local decl count
-0000013: 01 ; OPCODE_BLOCK
-0000014: 01 ; num expressions
-0000015: 02 ; OPCODE_LOOP
-0000016: 01 ; num expressions
-0000017: 01 ; OPCODE_BLOCK
-0000018: 02 ; num expressions
-0000019: 0a ; OPCODE_I32_CONST
-000001a: 00 ; i32 literal
-000001b: 01 ; OPCODE_BLOCK
-000001c: 02 ; num expressions
-000001d: 06 ; OPCODE_BR
-000001e: 00 ; break depth
-000001f: 00 ; OPCODE_NOP
-0000020: 06 ; OPCODE_BR
-0000021: 04 ; break depth
-0000022: 00 ; OPCODE_NOP
-0000011: 11 ; FIXUP func body size
-0000023: 06 ; WASM_BINARY_SECTION_END
+0000040: 00 ; func body size (guess)
+0000041: 00 ; local decl count
+0000042: 01 ; OPCODE_BLOCK
+0000043: 01 ; num expressions
+0000044: 02 ; OPCODE_LOOP
+0000045: 01 ; num expressions
+0000046: 01 ; OPCODE_BLOCK
+0000047: 02 ; num expressions
+0000048: 0a ; OPCODE_I32_CONST
+0000049: 00 ; i32 literal
+000004a: 01 ; OPCODE_BLOCK
+000004b: 02 ; num expressions
+000004c: 06 ; OPCODE_BR
+000004d: 00 ; break depth
+000004e: 00 ; OPCODE_NOP
+000004f: 06 ; OPCODE_BR
+0000050: 04 ; break depth
+0000051: 00 ; OPCODE_NOP
+0000040: 11 ; FIXUP func body size
+000002e: 23 ; FIXUP section size
+; section "end"
+0000052: 00 ; section size (guess)
+0000053: 03 ; string length
+0000054: 656e 64 ; section id: "end"
+0000052: 04 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0101 0000 0a01 000b
-0000010: 0111 0001 0102 0101 020a 0001 0206 0000
-0000020: 0604 0006
+0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
+0000010: 7572 6573 0100 0016 1366 756e 6374 696f
+0000020: 6e5f 7369 676e 6174 7572 6573 0100 230f
+0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 7301
+0000040: 1100 0101 0201 0102 0a00 0102 0600 0006
+0000050: 0400 0403 656e 64
;;; STDOUT ;;)
diff --git a/test/dump/br-block.txt b/test/dump/br-block.txt
index 966dd88e..a83f1937 100644
--- a/test/dump/br-block.txt
+++ b/test/dump/br-block.txt
@@ -14,48 +14,68 @@
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
0000004: 0a00 0000 ; WASM_BINARY_VERSION
-0000008: 01 ; WASM_BINARY_SECTION_SIGNATURES
-0000009: 01 ; num signatures
+; section "signatures"
+0000008: 00 ; section size (guess)
+0000009: 0a ; string length
+000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
+0000014: 01 ; num signatures
; signature 0
-000000a: 00 ; num params
-000000b: 00 ; result_type
-000000c: 0a ; WASM_BINARY_SECTION_FUNCTION_SIGNATURES
-000000d: 01 ; num functions
-000000e: 00 ; function 0 signature index
-000000f: 0b ; WASM_BINARY_SECTION_FUNCTION_BODIES
-0000010: 01 ; num functions
+0000015: 00 ; num params
+0000016: 00 ; result_type
+0000008: 0e ; FIXUP section size
+; section "function_signatures"
+0000017: 00 ; section size (guess)
+0000018: 13 ; string length
+0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
+0000029: 7265 73 ; section id: "function_signatures"
+000002c: 01 ; num functions
+000002d: 00 ; function 0 signature index
+0000017: 16 ; FIXUP section size
+; section "function_bodies"
+000002e: 00 ; section size (guess)
+000002f: 0f ; string length
+0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
+000003f: 01 ; num functions
; function body 0
-0000011: 00 ; func body size (guess)
-0000012: 00 ; local decl count
-0000013: 01 ; OPCODE_BLOCK
-0000014: 01 ; num expressions
-0000015: 02 ; OPCODE_LOOP
-0000016: 01 ; num expressions
-0000017: 01 ; OPCODE_BLOCK
-0000018: 02 ; num expressions
-0000019: 0a ; OPCODE_I32_CONST
-000001a: 00 ; i32 literal
-000001b: 01 ; OPCODE_BLOCK
-000001c: 05 ; num expressions
-000001d: 06 ; OPCODE_BR
-000001e: 00 ; break depth
-000001f: 00 ; OPCODE_NOP
-0000020: 06 ; OPCODE_BR
-0000021: 00 ; break depth
-0000022: 00 ; OPCODE_NOP
-0000023: 06 ; OPCODE_BR
-0000024: 01 ; break depth
-0000025: 00 ; OPCODE_NOP
-0000026: 06 ; OPCODE_BR
-0000027: 02 ; break depth
-0000028: 00 ; OPCODE_NOP
-0000029: 06 ; OPCODE_BR
-000002a: 03 ; break depth
-000002b: 00 ; OPCODE_NOP
-0000011: 1a ; FIXUP func body size
-000002c: 06 ; WASM_BINARY_SECTION_END
+0000040: 00 ; func body size (guess)
+0000041: 00 ; local decl count
+0000042: 01 ; OPCODE_BLOCK
+0000043: 01 ; num expressions
+0000044: 02 ; OPCODE_LOOP
+0000045: 01 ; num expressions
+0000046: 01 ; OPCODE_BLOCK
+0000047: 02 ; num expressions
+0000048: 0a ; OPCODE_I32_CONST
+0000049: 00 ; i32 literal
+000004a: 01 ; OPCODE_BLOCK
+000004b: 05 ; num expressions
+000004c: 06 ; OPCODE_BR
+000004d: 00 ; break depth
+000004e: 00 ; OPCODE_NOP
+000004f: 06 ; OPCODE_BR
+0000050: 00 ; break depth
+0000051: 00 ; OPCODE_NOP
+0000052: 06 ; OPCODE_BR
+0000053: 01 ; break depth
+0000054: 00 ; OPCODE_NOP
+0000055: 06 ; OPCODE_BR
+0000056: 02 ; break depth
+0000057: 00 ; OPCODE_NOP
+0000058: 06 ; OPCODE_BR
+0000059: 03 ; break depth
+000005a: 00 ; OPCODE_NOP
+0000040: 1a ; FIXUP func body size
+000002e: 2c ; FIXUP section size
+; section "end"
+000005b: 00 ; section size (guess)
+000005c: 03 ; string length
+000005d: 656e 64 ; section id: "end"
+000005b: 04 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0101 0000 0a01 000b
-0000010: 011a 0001 0102 0101 020a 0001 0506 0000
-0000020: 0600 0006 0100 0602 0006 0300 06
+0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
+0000010: 7572 6573 0100 0016 1366 756e 6374 696f
+0000020: 6e5f 7369 676e 6174 7572 6573 0100 2c0f
+0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 7301
+0000040: 1a00 0101 0201 0102 0a00 0105 0600 0006
+0000050: 0000 0601 0006 0200 0603 0004 0365 6e64
;;; STDOUT ;;)
diff --git a/test/dump/br-loop-inner-expr.txt b/test/dump/br-loop-inner-expr.txt
index 706e0fe9..08bc4f9c 100644
--- a/test/dump/br-loop-inner-expr.txt
+++ b/test/dump/br-loop-inner-expr.txt
@@ -10,44 +10,64 @@
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
0000004: 0a00 0000 ; WASM_BINARY_VERSION
-0000008: 01 ; WASM_BINARY_SECTION_SIGNATURES
-0000009: 01 ; num signatures
+; section "signatures"
+0000008: 00 ; section size (guess)
+0000009: 0a ; string length
+000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
+0000014: 01 ; num signatures
; signature 0
-000000a: 00 ; num params
-000000b: 01 ; result_type
-000000c: 0a ; WASM_BINARY_SECTION_FUNCTION_SIGNATURES
-000000d: 01 ; num functions
-000000e: 00 ; function 0 signature index
-000000f: 0b ; WASM_BINARY_SECTION_FUNCTION_BODIES
-0000010: 01 ; num functions
+0000015: 00 ; num params
+0000016: 01 ; result_type
+0000008: 0e ; FIXUP section size
+; section "function_signatures"
+0000017: 00 ; section size (guess)
+0000018: 13 ; string length
+0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
+0000029: 7265 73 ; section id: "function_signatures"
+000002c: 01 ; num functions
+000002d: 00 ; function 0 signature index
+0000017: 16 ; FIXUP section size
+; section "function_bodies"
+000002e: 00 ; section size (guess)
+000002f: 0f ; string length
+0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
+000003f: 01 ; num functions
; function body 0
-0000011: 00 ; func body size (guess)
-0000012: 00 ; local decl count
-0000013: 02 ; OPCODE_LOOP
-0000014: 03 ; num expressions
-0000015: 03 ; OPCODE_IF
-0000016: 0a ; OPCODE_I32_CONST
-0000017: 01 ; i32 literal
-0000018: 01 ; OPCODE_BLOCK
-0000019: 01 ; num expressions
-000001a: 06 ; OPCODE_BR
-000001b: 01 ; break depth
-000001c: 00 ; OPCODE_NOP
-000001d: 03 ; OPCODE_IF
-000001e: 0a ; OPCODE_I32_CONST
-000001f: 03 ; i32 literal
-0000020: 01 ; OPCODE_BLOCK
-0000021: 01 ; num expressions
-0000022: 06 ; OPCODE_BR
-0000023: 02 ; break depth
-0000024: 0a ; OPCODE_I32_CONST
-0000025: 04 ; i32 literal
-0000026: 0a ; OPCODE_I32_CONST
-0000027: 05 ; i32 literal
-0000011: 16 ; FIXUP func body size
-0000028: 06 ; WASM_BINARY_SECTION_END
+0000040: 00 ; func body size (guess)
+0000041: 00 ; local decl count
+0000042: 02 ; OPCODE_LOOP
+0000043: 03 ; num expressions
+0000044: 03 ; OPCODE_IF
+0000045: 0a ; OPCODE_I32_CONST
+0000046: 01 ; i32 literal
+0000047: 01 ; OPCODE_BLOCK
+0000048: 01 ; num expressions
+0000049: 06 ; OPCODE_BR
+000004a: 01 ; break depth
+000004b: 00 ; OPCODE_NOP
+000004c: 03 ; OPCODE_IF
+000004d: 0a ; OPCODE_I32_CONST
+000004e: 03 ; i32 literal
+000004f: 01 ; OPCODE_BLOCK
+0000050: 01 ; num expressions
+0000051: 06 ; OPCODE_BR
+0000052: 02 ; break depth
+0000053: 0a ; OPCODE_I32_CONST
+0000054: 04 ; i32 literal
+0000055: 0a ; OPCODE_I32_CONST
+0000056: 05 ; i32 literal
+0000040: 16 ; FIXUP func body size
+000002e: 28 ; FIXUP section size
+; section "end"
+0000057: 00 ; section size (guess)
+0000058: 03 ; string length
+0000059: 656e 64 ; section id: "end"
+0000057: 04 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0101 0001 0a01 000b
-0000010: 0116 0002 0303 0a01 0101 0601 0003 0a03
-0000020: 0101 0602 0a04 0a05 06
+0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
+0000010: 7572 6573 0100 0116 1366 756e 6374 696f
+0000020: 6e5f 7369 676e 6174 7572 6573 0100 280f
+0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 7301
+0000040: 1600 0203 030a 0101 0106 0100 030a 0301
+0000050: 0106 020a 040a 0504 0365 6e64
;;; STDOUT ;;)
diff --git a/test/dump/br-loop-inner.txt b/test/dump/br-loop-inner.txt
index 26b7c425..a11777ca 100644
--- a/test/dump/br-loop-inner.txt
+++ b/test/dump/br-loop-inner.txt
@@ -9,41 +9,61 @@
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
0000004: 0a00 0000 ; WASM_BINARY_VERSION
-0000008: 01 ; WASM_BINARY_SECTION_SIGNATURES
-0000009: 01 ; num signatures
+; section "signatures"
+0000008: 00 ; section size (guess)
+0000009: 0a ; string length
+000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
+0000014: 01 ; num signatures
; signature 0
-000000a: 00 ; num params
-000000b: 00 ; result_type
-000000c: 0a ; WASM_BINARY_SECTION_FUNCTION_SIGNATURES
-000000d: 01 ; num functions
-000000e: 00 ; function 0 signature index
-000000f: 0b ; WASM_BINARY_SECTION_FUNCTION_BODIES
-0000010: 01 ; num functions
+0000015: 00 ; num params
+0000016: 00 ; result_type
+0000008: 0e ; FIXUP section size
+; section "function_signatures"
+0000017: 00 ; section size (guess)
+0000018: 13 ; string length
+0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
+0000029: 7265 73 ; section id: "function_signatures"
+000002c: 01 ; num functions
+000002d: 00 ; function 0 signature index
+0000017: 16 ; FIXUP section size
+; section "function_bodies"
+000002e: 00 ; section size (guess)
+000002f: 0f ; string length
+0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
+000003f: 01 ; num functions
; function body 0
-0000011: 00 ; func body size (guess)
-0000012: 00 ; local decl count
-0000013: 02 ; OPCODE_LOOP
-0000014: 02 ; num expressions
-0000015: 03 ; OPCODE_IF
-0000016: 0a ; OPCODE_I32_CONST
-0000017: 01 ; i32 literal
-0000018: 01 ; OPCODE_BLOCK
-0000019: 01 ; num expressions
-000001a: 06 ; OPCODE_BR
-000001b: 02 ; break depth
-000001c: 00 ; OPCODE_NOP
-000001d: 03 ; OPCODE_IF
-000001e: 0a ; OPCODE_I32_CONST
-000001f: 02 ; i32 literal
-0000020: 01 ; OPCODE_BLOCK
-0000021: 01 ; num expressions
-0000022: 06 ; OPCODE_BR
-0000023: 01 ; break depth
-0000024: 00 ; OPCODE_NOP
-0000011: 13 ; FIXUP func body size
-0000025: 06 ; WASM_BINARY_SECTION_END
+0000040: 00 ; func body size (guess)
+0000041: 00 ; local decl count
+0000042: 02 ; OPCODE_LOOP
+0000043: 02 ; num expressions
+0000044: 03 ; OPCODE_IF
+0000045: 0a ; OPCODE_I32_CONST
+0000046: 01 ; i32 literal
+0000047: 01 ; OPCODE_BLOCK
+0000048: 01 ; num expressions
+0000049: 06 ; OPCODE_BR
+000004a: 02 ; break depth
+000004b: 00 ; OPCODE_NOP
+000004c: 03 ; OPCODE_IF
+000004d: 0a ; OPCODE_I32_CONST
+000004e: 02 ; i32 literal
+000004f: 01 ; OPCODE_BLOCK
+0000050: 01 ; num expressions
+0000051: 06 ; OPCODE_BR
+0000052: 01 ; break depth
+0000053: 00 ; OPCODE_NOP
+0000040: 13 ; FIXUP func body size
+000002e: 25 ; FIXUP section size
+; section "end"
+0000054: 00 ; section size (guess)
+0000055: 03 ; string length
+0000056: 656e 64 ; section id: "end"
+0000054: 04 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0101 0000 0a01 000b
-0000010: 0113 0002 0203 0a01 0101 0602 0003 0a02
-0000020: 0101 0601 0006
+0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
+0000010: 7572 6573 0100 0016 1366 756e 6374 696f
+0000020: 6e5f 7369 676e 6174 7572 6573 0100 250f
+0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 7301
+0000040: 1300 0202 030a 0101 0106 0200 030a 0201
+0000050: 0106 0100 0403 656e 64
;;; STDOUT ;;)
diff --git a/test/dump/br-loop.txt b/test/dump/br-loop.txt
index c2ec718d..70f2224d 100644
--- a/test/dump/br-loop.txt
+++ b/test/dump/br-loop.txt
@@ -7,32 +7,53 @@
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
0000004: 0a00 0000 ; WASM_BINARY_VERSION
-0000008: 01 ; WASM_BINARY_SECTION_SIGNATURES
-0000009: 01 ; num signatures
+; section "signatures"
+0000008: 00 ; section size (guess)
+0000009: 0a ; string length
+000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
+0000014: 01 ; num signatures
; signature 0
-000000a: 00 ; num params
-000000b: 00 ; result_type
-000000c: 0a ; WASM_BINARY_SECTION_FUNCTION_SIGNATURES
-000000d: 01 ; num functions
-000000e: 00 ; function 0 signature index
-000000f: 0b ; WASM_BINARY_SECTION_FUNCTION_BODIES
-0000010: 01 ; num functions
+0000015: 00 ; num params
+0000016: 00 ; result_type
+0000008: 0e ; FIXUP section size
+; section "function_signatures"
+0000017: 00 ; section size (guess)
+0000018: 13 ; string length
+0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
+0000029: 7265 73 ; section id: "function_signatures"
+000002c: 01 ; num functions
+000002d: 00 ; function 0 signature index
+0000017: 16 ; FIXUP section size
+; section "function_bodies"
+000002e: 00 ; section size (guess)
+000002f: 0f ; string length
+0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
+000003f: 01 ; num functions
; function body 0
-0000011: 00 ; func body size (guess)
-0000012: 00 ; local decl count
-0000013: 02 ; OPCODE_LOOP
-0000014: 01 ; num expressions
-0000015: 03 ; OPCODE_IF
-0000016: 0a ; OPCODE_I32_CONST
-0000017: 01 ; i32 literal
-0000018: 01 ; OPCODE_BLOCK
-0000019: 01 ; num expressions
-000001a: 06 ; OPCODE_BR
-000001b: 01 ; break depth
-000001c: 00 ; OPCODE_NOP
-0000011: 0b ; FIXUP func body size
-000001d: 06 ; WASM_BINARY_SECTION_END
+0000040: 00 ; func body size (guess)
+0000041: 00 ; local decl count
+0000042: 02 ; OPCODE_LOOP
+0000043: 01 ; num expressions
+0000044: 03 ; OPCODE_IF
+0000045: 0a ; OPCODE_I32_CONST
+0000046: 01 ; i32 literal
+0000047: 01 ; OPCODE_BLOCK
+0000048: 01 ; num expressions
+0000049: 06 ; OPCODE_BR
+000004a: 01 ; break depth
+000004b: 00 ; OPCODE_NOP
+0000040: 0b ; FIXUP func body size
+000002e: 1d ; FIXUP section size
+; section "end"
+000004c: 00 ; section size (guess)
+000004d: 03 ; string length
+000004e: 656e 64 ; section id: "end"
+000004c: 04 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0101 0000 0a01 000b
-0000010: 010b 0002 0103 0a01 0101 0601 0006
+0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
+0000010: 7572 6573 0100 0016 1366 756e 6374 696f
+0000020: 6e5f 7369 676e 6174 7572 6573 0100 1d0f
+0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 7301
+0000040: 0b00 0201 030a 0101 0106 0100 0403 656e
+0000050: 64
;;; STDOUT ;;)
diff --git a/test/dump/brif-loop.txt b/test/dump/brif-loop.txt
index 26cac002..ab1b68d3 100644
--- a/test/dump/brif-loop.txt
+++ b/test/dump/brif-loop.txt
@@ -6,29 +6,49 @@
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
0000004: 0a00 0000 ; WASM_BINARY_VERSION
-0000008: 01 ; WASM_BINARY_SECTION_SIGNATURES
-0000009: 01 ; num signatures
+; section "signatures"
+0000008: 00 ; section size (guess)
+0000009: 0a ; string length
+000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
+0000014: 01 ; num signatures
; signature 0
-000000a: 00 ; num params
-000000b: 00 ; result_type
-000000c: 0a ; WASM_BINARY_SECTION_FUNCTION_SIGNATURES
-000000d: 01 ; num functions
-000000e: 00 ; function 0 signature index
-000000f: 0b ; WASM_BINARY_SECTION_FUNCTION_BODIES
-0000010: 01 ; num functions
+0000015: 00 ; num params
+0000016: 00 ; result_type
+0000008: 0e ; FIXUP section size
+; section "function_signatures"
+0000017: 00 ; section size (guess)
+0000018: 13 ; string length
+0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
+0000029: 7265 73 ; section id: "function_signatures"
+000002c: 01 ; num functions
+000002d: 00 ; function 0 signature index
+0000017: 16 ; FIXUP section size
+; section "function_bodies"
+000002e: 00 ; section size (guess)
+000002f: 0f ; string length
+0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
+000003f: 01 ; num functions
; function body 0
-0000011: 00 ; func body size (guess)
-0000012: 00 ; local decl count
-0000013: 02 ; OPCODE_LOOP
-0000014: 01 ; num expressions
-0000015: 07 ; OPCODE_BR_IF
-0000016: 00 ; break depth
-0000017: 00 ; OPCODE_NOP
-0000018: 0a ; OPCODE_I32_CONST
-0000019: 00 ; i32 literal
-0000011: 08 ; FIXUP func body size
-000001a: 06 ; WASM_BINARY_SECTION_END
+0000040: 00 ; func body size (guess)
+0000041: 00 ; local decl count
+0000042: 02 ; OPCODE_LOOP
+0000043: 01 ; num expressions
+0000044: 07 ; OPCODE_BR_IF
+0000045: 00 ; break depth
+0000046: 00 ; OPCODE_NOP
+0000047: 0a ; OPCODE_I32_CONST
+0000048: 00 ; i32 literal
+0000040: 08 ; FIXUP func body size
+000002e: 1a ; FIXUP section size
+; section "end"
+0000049: 00 ; section size (guess)
+000004a: 03 ; string length
+000004b: 656e 64 ; section id: "end"
+0000049: 04 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0101 0000 0a01 000b
-0000010: 0108 0002 0107 0000 0a00 06
+0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
+0000010: 7572 6573 0100 0016 1366 756e 6374 696f
+0000020: 6e5f 7369 676e 6174 7572 6573 0100 1a0f
+0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 7301
+0000040: 0800 0201 0700 000a 0004 0365 6e64
;;; STDOUT ;;)
diff --git a/test/dump/brif.txt b/test/dump/brif.txt
index 69891311..2c87fcb6 100644
--- a/test/dump/brif.txt
+++ b/test/dump/brif.txt
@@ -6,29 +6,49 @@
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
0000004: 0a00 0000 ; WASM_BINARY_VERSION
-0000008: 01 ; WASM_BINARY_SECTION_SIGNATURES
-0000009: 01 ; num signatures
+; section "signatures"
+0000008: 00 ; section size (guess)
+0000009: 0a ; string length
+000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
+0000014: 01 ; num signatures
; signature 0
-000000a: 00 ; num params
-000000b: 00 ; result_type
-000000c: 0a ; WASM_BINARY_SECTION_FUNCTION_SIGNATURES
-000000d: 01 ; num functions
-000000e: 00 ; function 0 signature index
-000000f: 0b ; WASM_BINARY_SECTION_FUNCTION_BODIES
-0000010: 01 ; num functions
+0000015: 00 ; num params
+0000016: 00 ; result_type
+0000008: 0e ; FIXUP section size
+; section "function_signatures"
+0000017: 00 ; section size (guess)
+0000018: 13 ; string length
+0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
+0000029: 7265 73 ; section id: "function_signatures"
+000002c: 01 ; num functions
+000002d: 00 ; function 0 signature index
+0000017: 16 ; FIXUP section size
+; section "function_bodies"
+000002e: 00 ; section size (guess)
+000002f: 0f ; string length
+0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
+000003f: 01 ; num functions
; function body 0
-0000011: 00 ; func body size (guess)
-0000012: 00 ; local decl count
-0000013: 01 ; OPCODE_BLOCK
-0000014: 01 ; num expressions
-0000015: 07 ; OPCODE_BR_IF
-0000016: 00 ; break depth
-0000017: 00 ; OPCODE_NOP
-0000018: 0a ; OPCODE_I32_CONST
-0000019: 01 ; i32 literal
-0000011: 08 ; FIXUP func body size
-000001a: 06 ; WASM_BINARY_SECTION_END
+0000040: 00 ; func body size (guess)
+0000041: 00 ; local decl count
+0000042: 01 ; OPCODE_BLOCK
+0000043: 01 ; num expressions
+0000044: 07 ; OPCODE_BR_IF
+0000045: 00 ; break depth
+0000046: 00 ; OPCODE_NOP
+0000047: 0a ; OPCODE_I32_CONST
+0000048: 01 ; i32 literal
+0000040: 08 ; FIXUP func body size
+000002e: 1a ; FIXUP section size
+; section "end"
+0000049: 00 ; section size (guess)
+000004a: 03 ; string length
+000004b: 656e 64 ; section id: "end"
+0000049: 04 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0101 0000 0a01 000b
-0000010: 0108 0001 0107 0000 0a01 06
+0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
+0000010: 7572 6573 0100 0016 1366 756e 6374 696f
+0000020: 6e5f 7369 676e 6174 7572 6573 0100 1a0f
+0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 7301
+0000040: 0800 0101 0700 000a 0104 0365 6e64
;;; STDOUT ;;)
diff --git a/test/dump/brtable.txt b/test/dump/brtable.txt
index e3b2b5e6..ef7d06bf 100644
--- a/test/dump/brtable.txt
+++ b/test/dump/brtable.txt
@@ -16,46 +16,66 @@
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
0000004: 0a00 0000 ; WASM_BINARY_VERSION
-0000008: 01 ; WASM_BINARY_SECTION_SIGNATURES
-0000009: 01 ; num signatures
+; section "signatures"
+0000008: 00 ; section size (guess)
+0000009: 0a ; string length
+000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
+0000014: 01 ; num signatures
; signature 0
-000000a: 00 ; num params
-000000b: 00 ; result_type
-000000c: 0a ; WASM_BINARY_SECTION_FUNCTION_SIGNATURES
-000000d: 01 ; num functions
-000000e: 00 ; function 0 signature index
-000000f: 0b ; WASM_BINARY_SECTION_FUNCTION_BODIES
-0000010: 01 ; num functions
+0000015: 00 ; num params
+0000016: 00 ; result_type
+0000008: 0e ; FIXUP section size
+; section "function_signatures"
+0000017: 00 ; section size (guess)
+0000018: 13 ; string length
+0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
+0000029: 7265 73 ; section id: "function_signatures"
+000002c: 01 ; num functions
+000002d: 00 ; function 0 signature index
+0000017: 16 ; FIXUP section size
+; section "function_bodies"
+000002e: 00 ; section size (guess)
+000002f: 0f ; string length
+0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
+000003f: 01 ; num functions
; function body 0
-0000011: 00 ; func body size (guess)
-0000012: 00 ; local decl count
-0000013: 01 ; OPCODE_BLOCK
-0000014: 01 ; num expressions
-0000015: 01 ; OPCODE_BLOCK
-0000016: 04 ; num expressions
-0000017: 01 ; OPCODE_BLOCK
-0000018: 01 ; num expressions
-0000019: 08 ; OPCODE_BR_TABLE
-000001a: 02 ; num targets
-000001b: 0000 0000 ; break depth
-000001f: 0100 0000 ; break depth
-0000023: 0000 0000 ; break depth for default
-0000027: 0a ; OPCODE_I32_CONST
-0000028: 00 ; i32 literal
-0000029: 0a ; OPCODE_I32_CONST
-000002a: 01 ; i32 literal
-000002b: 0a ; OPCODE_I32_CONST
-000002c: 02 ; i32 literal
-000002d: 06 ; OPCODE_BR
-000002e: 01 ; break depth
-000002f: 00 ; OPCODE_NOP
-0000030: 0a ; OPCODE_I32_CONST
-0000031: 03 ; i32 literal
-0000011: 20 ; FIXUP func body size
-0000032: 06 ; WASM_BINARY_SECTION_END
+0000040: 00 ; func body size (guess)
+0000041: 00 ; local decl count
+0000042: 01 ; OPCODE_BLOCK
+0000043: 01 ; num expressions
+0000044: 01 ; OPCODE_BLOCK
+0000045: 04 ; num expressions
+0000046: 01 ; OPCODE_BLOCK
+0000047: 01 ; num expressions
+0000048: 08 ; OPCODE_BR_TABLE
+0000049: 02 ; num targets
+000004a: 0000 0000 ; break depth
+000004e: 0100 0000 ; break depth
+0000052: 0000 0000 ; break depth for default
+0000056: 0a ; OPCODE_I32_CONST
+0000057: 00 ; i32 literal
+0000058: 0a ; OPCODE_I32_CONST
+0000059: 01 ; i32 literal
+000005a: 0a ; OPCODE_I32_CONST
+000005b: 02 ; i32 literal
+000005c: 06 ; OPCODE_BR
+000005d: 01 ; break depth
+000005e: 00 ; OPCODE_NOP
+000005f: 0a ; OPCODE_I32_CONST
+0000060: 03 ; i32 literal
+0000040: 20 ; FIXUP func body size
+000002e: 32 ; FIXUP section size
+; section "end"
+0000061: 00 ; section size (guess)
+0000062: 03 ; string length
+0000063: 656e 64 ; section id: "end"
+0000061: 04 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0101 0000 0a01 000b
-0000010: 0120 0001 0101 0401 0108 0200 0000 0001
-0000020: 0000 0000 0000 000a 000a 010a 0206 0100
-0000030: 0a03 06
+0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
+0000010: 7572 6573 0100 0016 1366 756e 6374 696f
+0000020: 6e5f 7369 676e 6174 7572 6573 0100 320f
+0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 7301
+0000040: 2000 0101 0104 0101 0802 0000 0000 0100
+0000050: 0000 0000 0000 0a00 0a01 0a02 0601 000a
+0000060: 0304 0365 6e64
;;; STDOUT ;;)
diff --git a/test/dump/call.txt b/test/dump/call.txt
index 911d4df2..afab3c09 100644
--- a/test/dump/call.txt
+++ b/test/dump/call.txt
@@ -5,27 +5,47 @@
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
0000004: 0a00 0000 ; WASM_BINARY_VERSION
-0000008: 01 ; WASM_BINARY_SECTION_SIGNATURES
-0000009: 01 ; num signatures
+; section "signatures"
+0000008: 00 ; section size (guess)
+0000009: 0a ; string length
+000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
+0000014: 01 ; num signatures
; signature 0
-000000a: 01 ; num params
-000000b: 00 ; result_type
-000000c: 01 ; param type
-000000d: 0a ; WASM_BINARY_SECTION_FUNCTION_SIGNATURES
-000000e: 01 ; num functions
-000000f: 00 ; function 0 signature index
-0000010: 0b ; WASM_BINARY_SECTION_FUNCTION_BODIES
-0000011: 01 ; num functions
+0000015: 01 ; num params
+0000016: 00 ; result_type
+0000017: 01 ; param type
+0000008: 0f ; FIXUP section size
+; section "function_signatures"
+0000018: 00 ; section size (guess)
+0000019: 13 ; string length
+000001a: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
+000002a: 7265 73 ; section id: "function_signatures"
+000002d: 01 ; num functions
+000002e: 00 ; function 0 signature index
+0000018: 16 ; FIXUP section size
+; section "function_bodies"
+000002f: 00 ; section size (guess)
+0000030: 0f ; string length
+0000031: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
+0000040: 01 ; num functions
; function body 0
-0000012: 00 ; func body size (guess)
-0000013: 00 ; local decl count
-0000014: 12 ; OPCODE_CALL_FUNCTION
-0000015: 00 ; func index
-0000016: 0a ; OPCODE_I32_CONST
-0000017: 01 ; i32 literal
-0000012: 05 ; FIXUP func body size
-0000018: 06 ; WASM_BINARY_SECTION_END
+0000041: 00 ; func body size (guess)
+0000042: 00 ; local decl count
+0000043: 12 ; OPCODE_CALL_FUNCTION
+0000044: 00 ; func index
+0000045: 0a ; OPCODE_I32_CONST
+0000046: 01 ; i32 literal
+0000041: 05 ; FIXUP func body size
+000002f: 17 ; FIXUP section size
+; section "end"
+0000047: 00 ; section size (guess)
+0000048: 03 ; string length
+0000049: 656e 64 ; section id: "end"
+0000047: 04 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0101 0100 010a 0100
-0000010: 0b01 0500 1200 0a01 06
+0000000: 0061 736d 0a00 0000 0f0a 7369 676e 6174
+0000010: 7572 6573 0101 0001 1613 6675 6e63 7469
+0000020: 6f6e 5f73 6967 6e61 7475 7265 7301 0017
+0000030: 0f66 756e 6374 696f 6e5f 626f 6469 6573
+0000040: 0105 0012 000a 0104 0365 6e64
;;; STDOUT ;;)
diff --git a/test/dump/callimport.txt b/test/dump/callimport.txt
index 77a212f6..717fc7f3 100644
--- a/test/dump/callimport.txt
+++ b/test/dump/callimport.txt
@@ -12,44 +12,69 @@
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
0000004: 0a00 0000 ; WASM_BINARY_VERSION
-0000008: 01 ; WASM_BINARY_SECTION_SIGNATURES
-0000009: 02 ; num signatures
+; section "signatures"
+0000008: 00 ; section size (guess)
+0000009: 0a ; string length
+000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
+0000014: 02 ; num signatures
; signature 0
-000000a: 02 ; num params
-000000b: 01 ; result_type
-000000c: 01 ; param type
-000000d: 03 ; param type
+0000015: 02 ; num params
+0000016: 01 ; result_type
+0000017: 01 ; param type
+0000018: 03 ; param type
; signature 1
-000000e: 00 ; num params
-000000f: 01 ; result_type
-0000010: 08 ; WASM_BINARY_SECTION_IMPORTS
-0000011: 01 ; num imports
+0000019: 00 ; num params
+000001a: 01 ; result_type
+0000008: 12 ; FIXUP section size
+; section "import_table"
+000001b: 00 ; section size (guess)
+000001c: 0c ; string length
+000001d: 696d 706f 7274 5f74 6162 6c65 ; section id: "import_table"
+0000029: 01 ; num imports
; import header 0
-0000012: 00 ; import signature index
-0000013: 03 ; string length
-0000014: 666f 6f ; import module name
-0000017: 03 ; string length
-0000018: 6261 72 ; import function name
-000001b: 0a ; WASM_BINARY_SECTION_FUNCTION_SIGNATURES
-000001c: 01 ; num functions
-000001d: 01 ; function 0 signature index
-000001e: 0b ; WASM_BINARY_SECTION_FUNCTION_BODIES
-000001f: 01 ; num functions
+000002a: 00 ; import signature index
+000002b: 03 ; string length
+000002c: 666f 6f ; import module name
+000002f: 03 ; string length
+0000030: 6261 72 ; import function name
+000001b: 17 ; FIXUP section size
+; section "function_signatures"
+0000033: 00 ; section size (guess)
+0000034: 13 ; string length
+0000035: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
+0000045: 7265 73 ; section id: "function_signatures"
+0000048: 01 ; num functions
+0000049: 01 ; function 0 signature index
+0000033: 16 ; FIXUP section size
+; section "function_bodies"
+000004a: 00 ; section size (guess)
+000004b: 0f ; string length
+000004c: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
+000005b: 01 ; num functions
; function body 0
-0000020: 00 ; func body size (guess)
-0000021: 00 ; local decl count
-0000022: 1f ; OPCODE_CALL_IMPORT
-0000023: 00 ; import index
-0000024: 0a ; OPCODE_I32_CONST
-0000025: 01 ; i32 literal
-0000026: 0d ; OPCODE_F32_CONST
-0000027: 0000 0040 ; f32 literal
-000002b: 12 ; OPCODE_CALL_FUNCTION
-000002c: 00 ; func index
-0000020: 0c ; FIXUP func body size
-000002d: 06 ; WASM_BINARY_SECTION_END
+000005c: 00 ; func body size (guess)
+000005d: 00 ; local decl count
+000005e: 1f ; OPCODE_CALL_IMPORT
+000005f: 00 ; import index
+0000060: 0a ; OPCODE_I32_CONST
+0000061: 01 ; i32 literal
+0000062: 0d ; OPCODE_F32_CONST
+0000063: 0000 0040 ; f32 literal
+0000067: 12 ; OPCODE_CALL_FUNCTION
+0000068: 00 ; func index
+000005c: 0c ; FIXUP func body size
+000004a: 1e ; FIXUP section size
+; section "end"
+0000069: 00 ; section size (guess)
+000006a: 03 ; string length
+000006b: 656e 64 ; section id: "end"
+0000069: 04 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0102 0201 0103 0001
-0000010: 0801 0003 666f 6f03 6261 720a 0101 0b01
-0000020: 0c00 1f00 0a01 0d00 0000 4012 0006
+0000000: 0061 736d 0a00 0000 120a 7369 676e 6174
+0000010: 7572 6573 0202 0101 0300 0117 0c69 6d70
+0000020: 6f72 745f 7461 626c 6501 0003 666f 6f03
+0000030: 6261 7216 1366 756e 6374 696f 6e5f 7369
+0000040: 676e 6174 7572 6573 0101 1e0f 6675 6e63
+0000050: 7469 6f6e 5f62 6f64 6965 7301 0c00 1f00
+0000060: 0a01 0d00 0000 4012 0004 0365 6e64
;;; STDOUT ;;)
diff --git a/test/dump/callindirect-after-import.txt b/test/dump/callindirect-after-import.txt
index b5d4e114..b283c0ad 100644
--- a/test/dump/callindirect-after-import.txt
+++ b/test/dump/callindirect-after-import.txt
@@ -20,54 +20,84 @@
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
0000004: 0a00 0000 ; WASM_BINARY_VERSION
-0000008: 01 ; WASM_BINARY_SECTION_SIGNATURES
-0000009: 03 ; num signatures
+; section "signatures"
+0000008: 00 ; section size (guess)
+0000009: 0a ; string length
+000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
+0000014: 03 ; num signatures
; signature 0
-000000a: 01 ; num params
-000000b: 00 ; result_type
-000000c: 03 ; param type
+0000015: 01 ; num params
+0000016: 00 ; result_type
+0000017: 03 ; param type
; signature 1
-000000d: 00 ; num params
-000000e: 01 ; result_type
+0000018: 00 ; num params
+0000019: 01 ; result_type
; signature 2
-000000f: 00 ; num params
-0000010: 00 ; result_type
-0000011: 08 ; WASM_BINARY_SECTION_IMPORTS
-0000012: 01 ; num imports
+000001a: 00 ; num params
+000001b: 00 ; result_type
+0000008: 13 ; FIXUP section size
+; section "import_table"
+000001c: 00 ; section size (guess)
+000001d: 0c ; string length
+000001e: 696d 706f 7274 5f74 6162 6c65 ; section id: "import_table"
+000002a: 01 ; num imports
; import header 0
-0000013: 01 ; import signature index
-0000014: 03 ; string length
-0000015: 666f 6f ; import module name
-0000018: 03 ; string length
-0000019: 6261 72 ; import function name
-000001c: 0a ; WASM_BINARY_SECTION_FUNCTION_SIGNATURES
-000001d: 02 ; num functions
-000001e: 00 ; function 0 signature index
-000001f: 02 ; function 1 signature index
-0000020: 0b ; WASM_BINARY_SECTION_FUNCTION_BODIES
-0000021: 02 ; num functions
+000002b: 01 ; import signature index
+000002c: 03 ; string length
+000002d: 666f 6f ; import module name
+0000030: 03 ; string length
+0000031: 6261 72 ; import function name
+000001c: 17 ; FIXUP section size
+; section "function_signatures"
+0000034: 00 ; section size (guess)
+0000035: 13 ; string length
+0000036: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
+0000046: 7265 73 ; section id: "function_signatures"
+0000049: 02 ; num functions
+000004a: 00 ; function 0 signature index
+000004b: 02 ; function 1 signature index
+0000034: 17 ; FIXUP section size
+; section "function_bodies"
+000004c: 00 ; section size (guess)
+000004d: 0f ; string length
+000004e: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
+000005d: 02 ; num functions
; function body 0
-0000022: 00 ; func body size (guess)
-0000023: 00 ; local decl count
-0000024: 00 ; OPCODE_NOP
-0000022: 02 ; FIXUP func body size
+000005e: 00 ; func body size (guess)
+000005f: 00 ; local decl count
+0000060: 00 ; OPCODE_NOP
+000005e: 02 ; FIXUP func body size
; function body 1
-0000025: 00 ; func body size (guess)
-0000026: 00 ; local decl count
-0000027: 13 ; OPCODE_CALL_INDIRECT
-0000028: 00 ; signature index
-0000029: 0a ; OPCODE_I32_CONST
-000002a: 00 ; i32 literal
-000002b: 0d ; OPCODE_F32_CONST
-000002c: 0000 803f ; f32 literal
-0000025: 0a ; FIXUP func body size
-0000030: 05 ; WASM_BINARY_SECTION_FUNCTION_TABLE
-0000031: 01 ; num function table entries
-0000032: 00 ; function table entry
-0000033: 06 ; WASM_BINARY_SECTION_END
+0000061: 00 ; func body size (guess)
+0000062: 00 ; local decl count
+0000063: 13 ; OPCODE_CALL_INDIRECT
+0000064: 00 ; signature index
+0000065: 0a ; OPCODE_I32_CONST
+0000066: 00 ; i32 literal
+0000067: 0d ; OPCODE_F32_CONST
+0000068: 0000 803f ; f32 literal
+0000061: 0a ; FIXUP func body size
+000004c: 1f ; FIXUP section size
+; section "function_table"
+000006c: 00 ; section size (guess)
+000006d: 0e ; string length
+000006e: 6675 6e63 7469 6f6e 5f74 6162 6c65 ; section id: "function_table"
+000007c: 01 ; num function table entries
+000007d: 00 ; function table entry
+000006c: 11 ; FIXUP section size
+; section "end"
+000007e: 00 ; section size (guess)
+000007f: 03 ; string length
+0000080: 656e 64 ; section id: "end"
+000007e: 04 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0103 0100 0300 0100
-0000010: 0008 0101 0366 6f6f 0362 6172 0a02 0002
-0000020: 0b02 0200 000a 0013 000a 000d 0000 803f
-0000030: 0501 0006
+0000000: 0061 736d 0a00 0000 130a 7369 676e 6174
+0000010: 7572 6573 0301 0003 0001 0000 170c 696d
+0000020: 706f 7274 5f74 6162 6c65 0101 0366 6f6f
+0000030: 0362 6172 1713 6675 6e63 7469 6f6e 5f73
+0000040: 6967 6e61 7475 7265 7302 0002 1f0f 6675
+0000050: 6e63 7469 6f6e 5f62 6f64 6965 7302 0200
+0000060: 000a 0013 000a 000d 0000 803f 110e 6675
+0000070: 6e63 7469 6f6e 5f74 6162 6c65 0100 0403
+0000080: 656e 64
;;; STDOUT ;;)
diff --git a/test/dump/callindirect.txt b/test/dump/callindirect.txt
index b0071317..65edaa70 100644
--- a/test/dump/callindirect.txt
+++ b/test/dump/callindirect.txt
@@ -7,32 +7,57 @@
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
0000004: 0a00 0000 ; WASM_BINARY_VERSION
-0000008: 01 ; WASM_BINARY_SECTION_SIGNATURES
-0000009: 01 ; num signatures
+; section "signatures"
+0000008: 00 ; section size (guess)
+0000009: 0a ; string length
+000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
+0000014: 01 ; num signatures
; signature 0
-000000a: 01 ; num params
-000000b: 00 ; result_type
-000000c: 01 ; param type
-000000d: 0a ; WASM_BINARY_SECTION_FUNCTION_SIGNATURES
-000000e: 01 ; num functions
-000000f: 00 ; function 0 signature index
-0000010: 0b ; WASM_BINARY_SECTION_FUNCTION_BODIES
-0000011: 01 ; num functions
+0000015: 01 ; num params
+0000016: 00 ; result_type
+0000017: 01 ; param type
+0000008: 0f ; FIXUP section size
+; section "function_signatures"
+0000018: 00 ; section size (guess)
+0000019: 13 ; string length
+000001a: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
+000002a: 7265 73 ; section id: "function_signatures"
+000002d: 01 ; num functions
+000002e: 00 ; function 0 signature index
+0000018: 16 ; FIXUP section size
+; section "function_bodies"
+000002f: 00 ; section size (guess)
+0000030: 0f ; string length
+0000031: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
+0000040: 01 ; num functions
; function body 0
-0000012: 00 ; func body size (guess)
-0000013: 00 ; local decl count
-0000014: 13 ; OPCODE_CALL_INDIRECT
-0000015: 00 ; signature index
-0000016: 0a ; OPCODE_I32_CONST
-0000017: 00 ; i32 literal
-0000018: 0a ; OPCODE_I32_CONST
-0000019: 00 ; i32 literal
-0000012: 07 ; FIXUP func body size
-000001a: 05 ; WASM_BINARY_SECTION_FUNCTION_TABLE
-000001b: 01 ; num function table entries
-000001c: 00 ; function table entry
-000001d: 06 ; WASM_BINARY_SECTION_END
+0000041: 00 ; func body size (guess)
+0000042: 00 ; local decl count
+0000043: 13 ; OPCODE_CALL_INDIRECT
+0000044: 00 ; signature index
+0000045: 0a ; OPCODE_I32_CONST
+0000046: 00 ; i32 literal
+0000047: 0a ; OPCODE_I32_CONST
+0000048: 00 ; i32 literal
+0000041: 07 ; FIXUP func body size
+000002f: 19 ; FIXUP section size
+; section "function_table"
+0000049: 00 ; section size (guess)
+000004a: 0e ; string length
+000004b: 6675 6e63 7469 6f6e 5f74 6162 6c65 ; section id: "function_table"
+0000059: 01 ; num function table entries
+000005a: 00 ; function table entry
+0000049: 11 ; FIXUP section size
+; section "end"
+000005b: 00 ; section size (guess)
+000005c: 03 ; string length
+000005d: 656e 64 ; section id: "end"
+000005b: 04 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0101 0100 010a 0100
-0000010: 0b01 0700 1300 0a00 0a00 0501 0006
+0000000: 0061 736d 0a00 0000 0f0a 7369 676e 6174
+0000010: 7572 6573 0101 0001 1613 6675 6e63 7469
+0000020: 6f6e 5f73 6967 6e61 7475 7265 7301 0019
+0000030: 0f66 756e 6374 696f 6e5f 626f 6469 6573
+0000040: 0107 0013 000a 000a 0011 0e66 756e 6374
+0000050: 696f 6e5f 7461 626c 6501 0004 0365 6e64
;;; STDOUT ;;)
diff --git a/test/dump/cast.txt b/test/dump/cast.txt
index a0c20cfb..432ab410 100644
--- a/test/dump/cast.txt
+++ b/test/dump/cast.txt
@@ -9,35 +9,55 @@
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
0000004: 0a00 0000 ; WASM_BINARY_VERSION
-0000008: 01 ; WASM_BINARY_SECTION_SIGNATURES
-0000009: 01 ; num signatures
+; section "signatures"
+0000008: 00 ; section size (guess)
+0000009: 0a ; string length
+000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
+0000014: 01 ; num signatures
; signature 0
-000000a: 00 ; num params
-000000b: 00 ; result_type
-000000c: 0a ; WASM_BINARY_SECTION_FUNCTION_SIGNATURES
-000000d: 01 ; num functions
-000000e: 00 ; function 0 signature index
-000000f: 0b ; WASM_BINARY_SECTION_FUNCTION_BODIES
-0000010: 01 ; num functions
+0000015: 00 ; num params
+0000016: 00 ; result_type
+0000008: 0e ; FIXUP section size
+; section "function_signatures"
+0000017: 00 ; section size (guess)
+0000018: 13 ; string length
+0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
+0000029: 7265 73 ; section id: "function_signatures"
+000002c: 01 ; num functions
+000002d: 00 ; function 0 signature index
+0000017: 16 ; FIXUP section size
+; section "function_bodies"
+000002e: 00 ; section size (guess)
+000002f: 0f ; string length
+0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
+000003f: 01 ; num functions
; function body 0
-0000011: 00 ; func body size (guess)
-0000012: 00 ; local decl count
-0000013: ad ; OPCODE_F32_REINTERPRET_I32
-0000014: 0a ; OPCODE_I32_CONST
-0000015: 00 ; i32 literal
-0000016: b4 ; OPCODE_I32_REINTERPRET_F32
-0000017: 0d ; OPCODE_F32_CONST
-0000018: 0000 0000 ; f32 literal
-000001c: b3 ; OPCODE_F64_REINTERPRET_I64
-000001d: 0b ; OPCODE_I64_CONST
-000001e: 00 ; i64 literal
-000001f: b5 ; OPCODE_I64_REINTERPRET_F64
-0000020: 0c ; OPCODE_F64_CONST
-0000021: 0000 0000 0000 0000 ; f64 literal
-0000011: 17 ; FIXUP func body size
-0000029: 06 ; WASM_BINARY_SECTION_END
+0000040: 00 ; func body size (guess)
+0000041: 00 ; local decl count
+0000042: ad ; OPCODE_F32_REINTERPRET_I32
+0000043: 0a ; OPCODE_I32_CONST
+0000044: 00 ; i32 literal
+0000045: b4 ; OPCODE_I32_REINTERPRET_F32
+0000046: 0d ; OPCODE_F32_CONST
+0000047: 0000 0000 ; f32 literal
+000004b: b3 ; OPCODE_F64_REINTERPRET_I64
+000004c: 0b ; OPCODE_I64_CONST
+000004d: 00 ; i64 literal
+000004e: b5 ; OPCODE_I64_REINTERPRET_F64
+000004f: 0c ; OPCODE_F64_CONST
+0000050: 0000 0000 0000 0000 ; f64 literal
+0000040: 17 ; FIXUP func body size
+000002e: 29 ; FIXUP section size
+; section "end"
+0000058: 00 ; section size (guess)
+0000059: 03 ; string length
+000005a: 656e 64 ; section id: "end"
+0000058: 04 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0101 0000 0a01 000b
-0000010: 0117 00ad 0a00 b40d 0000 0000 b30b 00b5
-0000020: 0c00 0000 0000 0000 0006
+0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
+0000010: 7572 6573 0100 0016 1366 756e 6374 696f
+0000020: 6e5f 7369 676e 6174 7572 6573 0100 290f
+0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 7301
+0000040: 1700 ad0a 00b4 0d00 0000 00b3 0b00 b50c
+0000050: 0000 0000 0000 0000 0403 656e 64
;;; STDOUT ;;)
diff --git a/test/dump/compare.txt b/test/dump/compare.txt
index 707b664d..207bc10f 100644
--- a/test/dump/compare.txt
+++ b/test/dump/compare.txt
@@ -52,181 +52,202 @@
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
0000004: 0a00 0000 ; WASM_BINARY_VERSION
-0000008: 01 ; WASM_BINARY_SECTION_SIGNATURES
-0000009: 01 ; num signatures
+; section "signatures"
+0000008: 00 ; section size (guess)
+0000009: 0a ; string length
+000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
+0000014: 01 ; num signatures
; signature 0
-000000a: 00 ; num params
-000000b: 00 ; result_type
-000000c: 0a ; WASM_BINARY_SECTION_FUNCTION_SIGNATURES
-000000d: 01 ; num functions
-000000e: 00 ; function 0 signature index
-000000f: 0b ; WASM_BINARY_SECTION_FUNCTION_BODIES
-0000010: 01 ; num functions
+0000015: 00 ; num params
+0000016: 00 ; result_type
+0000008: 0e ; FIXUP section size
+; section "function_signatures"
+0000017: 00 ; section size (guess)
+0000018: 13 ; string length
+0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
+0000029: 7265 73 ; section id: "function_signatures"
+000002c: 01 ; num functions
+000002d: 00 ; function 0 signature index
+0000017: 16 ; FIXUP section size
+; section "function_bodies"
+000002e: 00 ; section size (guess)
+000002f: 0f ; string length
+0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
+000003f: 01 ; num functions
; function body 0
-0000011: 00 ; func body size (guess)
-0000012: 00 ; local decl count
-0000013: 4d ; OPCODE_I32_EQ
-0000014: 4e ; OPCODE_I32_NE
-0000015: 4f ; OPCODE_I32_LT_S
-0000016: 51 ; OPCODE_I32_LT_U
-0000017: 50 ; OPCODE_I32_LE_S
-0000018: 52 ; OPCODE_I32_LE_U
-0000019: 53 ; OPCODE_I32_GT_S
-000001a: 55 ; OPCODE_I32_GT_U
-000001b: 54 ; OPCODE_I32_GE_S
-000001c: 56 ; OPCODE_I32_GE_U
-000001d: 0a ; OPCODE_I32_CONST
-000001e: 00 ; i32 literal
-000001f: 0a ; OPCODE_I32_CONST
-0000020: 00 ; i32 literal
-0000021: 0a ; OPCODE_I32_CONST
-0000022: 00 ; i32 literal
-0000023: 0a ; OPCODE_I32_CONST
-0000024: 00 ; i32 literal
-0000025: 0a ; OPCODE_I32_CONST
-0000026: 00 ; i32 literal
-0000027: 0a ; OPCODE_I32_CONST
-0000028: 00 ; i32 literal
-0000029: 0a ; OPCODE_I32_CONST
-000002a: 00 ; i32 literal
-000002b: 0a ; OPCODE_I32_CONST
-000002c: 00 ; i32 literal
-000002d: 0a ; OPCODE_I32_CONST
-000002e: 00 ; i32 literal
-000002f: 0a ; OPCODE_I32_CONST
-0000030: 00 ; i32 literal
-0000031: 0a ; OPCODE_I32_CONST
-0000032: 00 ; i32 literal
-0000033: 68 ; OPCODE_I64_EQ
-0000034: 0b ; OPCODE_I64_CONST
-0000035: 00 ; i64 literal
-0000036: 0b ; OPCODE_I64_CONST
-0000037: 00 ; i64 literal
-0000038: 69 ; OPCODE_I64_NE
-0000039: 0b ; OPCODE_I64_CONST
-000003a: 00 ; i64 literal
-000003b: 0b ; OPCODE_I64_CONST
-000003c: 00 ; i64 literal
-000003d: 6a ; OPCODE_I64_LT_S
-000003e: 0b ; OPCODE_I64_CONST
-000003f: 00 ; i64 literal
-0000040: 0b ; OPCODE_I64_CONST
-0000041: 00 ; i64 literal
-0000042: 6c ; OPCODE_I64_LT_U
-0000043: 0b ; OPCODE_I64_CONST
-0000044: 00 ; i64 literal
-0000045: 0b ; OPCODE_I64_CONST
-0000046: 00 ; i64 literal
-0000047: 6b ; OPCODE_I64_LE_S
-0000048: 0b ; OPCODE_I64_CONST
-0000049: 00 ; i64 literal
-000004a: 0b ; OPCODE_I64_CONST
-000004b: 00 ; i64 literal
-000004c: 6d ; OPCODE_I64_LE_U
-000004d: 0b ; OPCODE_I64_CONST
-000004e: 00 ; i64 literal
-000004f: 0b ; OPCODE_I64_CONST
-0000050: 00 ; i64 literal
-0000051: 6e ; OPCODE_I64_GT_S
-0000052: 0b ; OPCODE_I64_CONST
-0000053: 00 ; i64 literal
-0000054: 0b ; OPCODE_I64_CONST
-0000055: 00 ; i64 literal
-0000056: 70 ; OPCODE_I64_GT_U
-0000057: 0b ; OPCODE_I64_CONST
-0000058: 00 ; i64 literal
-0000059: 0b ; OPCODE_I64_CONST
-000005a: 00 ; i64 literal
-000005b: 6f ; OPCODE_I64_GE_S
-000005c: 0b ; OPCODE_I64_CONST
-000005d: 00 ; i64 literal
-000005e: 0b ; OPCODE_I64_CONST
-000005f: 00 ; i64 literal
-0000060: 71 ; OPCODE_I64_GE_U
-0000061: 0b ; OPCODE_I64_CONST
-0000062: 00 ; i64 literal
+0000040: 00 ; func body size (guess)
+0000041: 00 ; local decl count
+0000042: 4d ; OPCODE_I32_EQ
+0000043: 4e ; OPCODE_I32_NE
+0000044: 4f ; OPCODE_I32_LT_S
+0000045: 51 ; OPCODE_I32_LT_U
+0000046: 50 ; OPCODE_I32_LE_S
+0000047: 52 ; OPCODE_I32_LE_U
+0000048: 53 ; OPCODE_I32_GT_S
+0000049: 55 ; OPCODE_I32_GT_U
+000004a: 54 ; OPCODE_I32_GE_S
+000004b: 56 ; OPCODE_I32_GE_U
+000004c: 0a ; OPCODE_I32_CONST
+000004d: 00 ; i32 literal
+000004e: 0a ; OPCODE_I32_CONST
+000004f: 00 ; i32 literal
+0000050: 0a ; OPCODE_I32_CONST
+0000051: 00 ; i32 literal
+0000052: 0a ; OPCODE_I32_CONST
+0000053: 00 ; i32 literal
+0000054: 0a ; OPCODE_I32_CONST
+0000055: 00 ; i32 literal
+0000056: 0a ; OPCODE_I32_CONST
+0000057: 00 ; i32 literal
+0000058: 0a ; OPCODE_I32_CONST
+0000059: 00 ; i32 literal
+000005a: 0a ; OPCODE_I32_CONST
+000005b: 00 ; i32 literal
+000005c: 0a ; OPCODE_I32_CONST
+000005d: 00 ; i32 literal
+000005e: 0a ; OPCODE_I32_CONST
+000005f: 00 ; i32 literal
+0000060: 0a ; OPCODE_I32_CONST
+0000061: 00 ; i32 literal
+0000062: 68 ; OPCODE_I64_EQ
0000063: 0b ; OPCODE_I64_CONST
0000064: 00 ; i64 literal
-0000065: 83 ; OPCODE_F32_EQ
-0000066: 0d ; OPCODE_F32_CONST
-0000067: 0000 0000 ; f32 literal
-000006b: 0d ; OPCODE_F32_CONST
-000006c: 0000 0000 ; f32 literal
-0000070: 84 ; OPCODE_F32_NE
-0000071: 0d ; OPCODE_F32_CONST
-0000072: 0000 0000 ; f32 literal
-0000076: 0d ; OPCODE_F32_CONST
-0000077: 0000 0000 ; f32 literal
-000007b: 85 ; OPCODE_F32_LT
-000007c: 0d ; OPCODE_F32_CONST
-000007d: 0000 0000 ; f32 literal
-0000081: 0d ; OPCODE_F32_CONST
-0000082: 0000 0000 ; f32 literal
-0000086: 86 ; OPCODE_F32_LE
-0000087: 0d ; OPCODE_F32_CONST
-0000088: 0000 0000 ; f32 literal
-000008c: 0d ; OPCODE_F32_CONST
-000008d: 0000 0000 ; f32 literal
-0000091: 87 ; OPCODE_F32_GT
-0000092: 0d ; OPCODE_F32_CONST
-0000093: 0000 0000 ; f32 literal
-0000097: 0d ; OPCODE_F32_CONST
-0000098: 0000 0000 ; f32 literal
-000009c: 88 ; OPCODE_F32_GE
-000009d: 0d ; OPCODE_F32_CONST
-000009e: 0000 0000 ; f32 literal
-00000a2: 0d ; OPCODE_F32_CONST
-00000a3: 0000 0000 ; f32 literal
-00000a7: 97 ; OPCODE_F64_EQ
-00000a8: 0c ; OPCODE_F64_CONST
-00000a9: 0000 0000 0000 0000 ; f64 literal
-00000b1: 0c ; OPCODE_F64_CONST
-00000b2: 0000 0000 0000 0000 ; f64 literal
-00000ba: 98 ; OPCODE_F64_NE
-00000bb: 0c ; OPCODE_F64_CONST
-00000bc: 0000 0000 0000 0000 ; f64 literal
-00000c4: 0c ; OPCODE_F64_CONST
-00000c5: 0000 0000 0000 0000 ; f64 literal
-00000cd: 99 ; OPCODE_F64_LT
-00000ce: 0c ; OPCODE_F64_CONST
-00000cf: 0000 0000 0000 0000 ; f64 literal
+0000065: 0b ; OPCODE_I64_CONST
+0000066: 00 ; i64 literal
+0000067: 69 ; OPCODE_I64_NE
+0000068: 0b ; OPCODE_I64_CONST
+0000069: 00 ; i64 literal
+000006a: 0b ; OPCODE_I64_CONST
+000006b: 00 ; i64 literal
+000006c: 6a ; OPCODE_I64_LT_S
+000006d: 0b ; OPCODE_I64_CONST
+000006e: 00 ; i64 literal
+000006f: 0b ; OPCODE_I64_CONST
+0000070: 00 ; i64 literal
+0000071: 6c ; OPCODE_I64_LT_U
+0000072: 0b ; OPCODE_I64_CONST
+0000073: 00 ; i64 literal
+0000074: 0b ; OPCODE_I64_CONST
+0000075: 00 ; i64 literal
+0000076: 6b ; OPCODE_I64_LE_S
+0000077: 0b ; OPCODE_I64_CONST
+0000078: 00 ; i64 literal
+0000079: 0b ; OPCODE_I64_CONST
+000007a: 00 ; i64 literal
+000007b: 6d ; OPCODE_I64_LE_U
+000007c: 0b ; OPCODE_I64_CONST
+000007d: 00 ; i64 literal
+000007e: 0b ; OPCODE_I64_CONST
+000007f: 00 ; i64 literal
+0000080: 6e ; OPCODE_I64_GT_S
+0000081: 0b ; OPCODE_I64_CONST
+0000082: 00 ; i64 literal
+0000083: 0b ; OPCODE_I64_CONST
+0000084: 00 ; i64 literal
+0000085: 70 ; OPCODE_I64_GT_U
+0000086: 0b ; OPCODE_I64_CONST
+0000087: 00 ; i64 literal
+0000088: 0b ; OPCODE_I64_CONST
+0000089: 00 ; i64 literal
+000008a: 6f ; OPCODE_I64_GE_S
+000008b: 0b ; OPCODE_I64_CONST
+000008c: 00 ; i64 literal
+000008d: 0b ; OPCODE_I64_CONST
+000008e: 00 ; i64 literal
+000008f: 71 ; OPCODE_I64_GE_U
+0000090: 0b ; OPCODE_I64_CONST
+0000091: 00 ; i64 literal
+0000092: 0b ; OPCODE_I64_CONST
+0000093: 00 ; i64 literal
+0000094: 83 ; OPCODE_F32_EQ
+0000095: 0d ; OPCODE_F32_CONST
+0000096: 0000 0000 ; f32 literal
+000009a: 0d ; OPCODE_F32_CONST
+000009b: 0000 0000 ; f32 literal
+000009f: 84 ; OPCODE_F32_NE
+00000a0: 0d ; OPCODE_F32_CONST
+00000a1: 0000 0000 ; f32 literal
+00000a5: 0d ; OPCODE_F32_CONST
+00000a6: 0000 0000 ; f32 literal
+00000aa: 85 ; OPCODE_F32_LT
+00000ab: 0d ; OPCODE_F32_CONST
+00000ac: 0000 0000 ; f32 literal
+00000b0: 0d ; OPCODE_F32_CONST
+00000b1: 0000 0000 ; f32 literal
+00000b5: 86 ; OPCODE_F32_LE
+00000b6: 0d ; OPCODE_F32_CONST
+00000b7: 0000 0000 ; f32 literal
+00000bb: 0d ; OPCODE_F32_CONST
+00000bc: 0000 0000 ; f32 literal
+00000c0: 87 ; OPCODE_F32_GT
+00000c1: 0d ; OPCODE_F32_CONST
+00000c2: 0000 0000 ; f32 literal
+00000c6: 0d ; OPCODE_F32_CONST
+00000c7: 0000 0000 ; f32 literal
+00000cb: 88 ; OPCODE_F32_GE
+00000cc: 0d ; OPCODE_F32_CONST
+00000cd: 0000 0000 ; f32 literal
+00000d1: 0d ; OPCODE_F32_CONST
+00000d2: 0000 0000 ; f32 literal
+00000d6: 97 ; OPCODE_F64_EQ
00000d7: 0c ; OPCODE_F64_CONST
00000d8: 0000 0000 0000 0000 ; f64 literal
-00000e0: 9a ; OPCODE_F64_LE
-00000e1: 0c ; OPCODE_F64_CONST
-00000e2: 0000 0000 0000 0000 ; f64 literal
+00000e0: 0c ; OPCODE_F64_CONST
+00000e1: 0000 0000 0000 0000 ; f64 literal
+00000e9: 98 ; OPCODE_F64_NE
00000ea: 0c ; OPCODE_F64_CONST
00000eb: 0000 0000 0000 0000 ; f64 literal
-00000f3: 9b ; OPCODE_F64_GT
-00000f4: 0c ; OPCODE_F64_CONST
-00000f5: 0000 0000 0000 0000 ; f64 literal
+00000f3: 0c ; OPCODE_F64_CONST
+00000f4: 0000 0000 0000 0000 ; f64 literal
+00000fc: 99 ; OPCODE_F64_LT
00000fd: 0c ; OPCODE_F64_CONST
00000fe: 0000 0000 0000 0000 ; f64 literal
-0000106: 9c ; OPCODE_F64_GE
-0000107: 0c ; OPCODE_F64_CONST
-0000108: 0000 0000 0000 0000 ; f64 literal
+0000106: 0c ; OPCODE_F64_CONST
+0000107: 0000 0000 0000 0000 ; f64 literal
+000010f: 9a ; OPCODE_F64_LE
0000110: 0c ; OPCODE_F64_CONST
0000111: 0000 0000 0000 0000 ; f64 literal
-; move data: [12, 119) -> [13, 11a)
-0000011: 8702 ; FIXUP func body size
-000011a: 06 ; WASM_BINARY_SECTION_END
+0000119: 0c ; OPCODE_F64_CONST
+000011a: 0000 0000 0000 0000 ; f64 literal
+0000122: 9b ; OPCODE_F64_GT
+0000123: 0c ; OPCODE_F64_CONST
+0000124: 0000 0000 0000 0000 ; f64 literal
+000012c: 0c ; OPCODE_F64_CONST
+000012d: 0000 0000 0000 0000 ; f64 literal
+0000135: 9c ; OPCODE_F64_GE
+0000136: 0c ; OPCODE_F64_CONST
+0000137: 0000 0000 0000 0000 ; f64 literal
+000013f: 0c ; OPCODE_F64_CONST
+0000140: 0000 0000 0000 0000 ; f64 literal
+; move data: [41, 148) -> [42, 149)
+0000040: 8702 ; FIXUP func body size
+; move data: [2f, 149) -> [30, 14a)
+000002e: 9a02 ; FIXUP section size
+; section "end"
+000014a: 00 ; section size (guess)
+000014b: 03 ; string length
+000014c: 656e 64 ; section id: "end"
+000014a: 04 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0101 0000 0a01 000b
-0000010: 0187 0200 4d4e 4f51 5052 5355 5456 0a00
-0000020: 0a00 0a00 0a00 0a00 0a00 0a00 0a00 0a00
-0000030: 0a00 0a00 680b 000b 0069 0b00 0b00 6a0b
-0000040: 000b 006c 0b00 0b00 6b0b 000b 006d 0b00
-0000050: 0b00 6e0b 000b 0070 0b00 0b00 6f0b 000b
-0000060: 0071 0b00 0b00 830d 0000 0000 0d00 0000
-0000070: 0084 0d00 0000 000d 0000 0000 850d 0000
-0000080: 0000 0d00 0000 0086 0d00 0000 000d 0000
-0000090: 0000 870d 0000 0000 0d00 0000 0088 0d00
-00000a0: 0000 000d 0000 0000 970c 0000 0000 0000
-00000b0: 0000 0c00 0000 0000 0000 0098 0c00 0000
-00000c0: 0000 0000 000c 0000 0000 0000 0000 990c
-00000d0: 0000 0000 0000 0000 0c00 0000 0000 0000
-00000e0: 009a 0c00 0000 0000 0000 000c 0000 0000
-00000f0: 0000 0000 9b0c 0000 0000 0000 0000 0c00
-0000100: 0000 0000 0000 009c 0c00 0000 0000 0000
-0000110: 000c 0000 0000 0000 0000 06
+0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
+0000010: 7572 6573 0100 0016 1366 756e 6374 696f
+0000020: 6e5f 7369 676e 6174 7572 6573 0100 9a02
+0000030: 0f66 756e 6374 696f 6e5f 626f 6469 6573
+0000040: 0187 0200 4d4e 4f51 5052 5355 5456 0a00
+0000050: 0a00 0a00 0a00 0a00 0a00 0a00 0a00 0a00
+0000060: 0a00 0a00 680b 000b 0069 0b00 0b00 6a0b
+0000070: 000b 006c 0b00 0b00 6b0b 000b 006d 0b00
+0000080: 0b00 6e0b 000b 0070 0b00 0b00 6f0b 000b
+0000090: 0071 0b00 0b00 830d 0000 0000 0d00 0000
+00000a0: 0084 0d00 0000 000d 0000 0000 850d 0000
+00000b0: 0000 0d00 0000 0086 0d00 0000 000d 0000
+00000c0: 0000 870d 0000 0000 0d00 0000 0088 0d00
+00000d0: 0000 000d 0000 0000 970c 0000 0000 0000
+00000e0: 0000 0c00 0000 0000 0000 0098 0c00 0000
+00000f0: 0000 0000 000c 0000 0000 0000 0000 990c
+0000100: 0000 0000 0000 0000 0c00 0000 0000 0000
+0000110: 009a 0c00 0000 0000 0000 000c 0000 0000
+0000120: 0000 0000 9b0c 0000 0000 0000 0000 0c00
+0000130: 0000 0000 0000 009c 0c00 0000 0000 0000
+0000140: 000c 0000 0000 0000 0000 0403 656e 64
;;; STDOUT ;;)
diff --git a/test/dump/const.txt b/test/dump/const.txt
index 31d6f579..133028bb 100644
--- a/test/dump/const.txt
+++ b/test/dump/const.txt
@@ -45,114 +45,135 @@
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
0000004: 0a00 0000 ; WASM_BINARY_VERSION
-0000008: 01 ; WASM_BINARY_SECTION_SIGNATURES
-0000009: 01 ; num signatures
+; section "signatures"
+0000008: 00 ; section size (guess)
+0000009: 0a ; string length
+000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
+0000014: 01 ; num signatures
; signature 0
-000000a: 00 ; num params
-000000b: 00 ; result_type
-000000c: 0a ; WASM_BINARY_SECTION_FUNCTION_SIGNATURES
-000000d: 01 ; num functions
-000000e: 00 ; function 0 signature index
-000000f: 0b ; WASM_BINARY_SECTION_FUNCTION_BODIES
-0000010: 01 ; num functions
+0000015: 00 ; num params
+0000016: 00 ; result_type
+0000008: 0e ; FIXUP section size
+; section "function_signatures"
+0000017: 00 ; section size (guess)
+0000018: 13 ; string length
+0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
+0000029: 7265 73 ; section id: "function_signatures"
+000002c: 01 ; num functions
+000002d: 00 ; function 0 signature index
+0000017: 16 ; FIXUP section size
+; section "function_bodies"
+000002e: 00 ; section size (guess)
+000002f: 0f ; string length
+0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
+000003f: 01 ; num functions
; function body 0
-0000011: 00 ; func body size (guess)
-0000012: 00 ; local decl count
-0000013: 0a ; OPCODE_I32_CONST
-0000014: 00 ; i32 literal
-0000015: 0a ; OPCODE_I32_CONST
-0000016: 8080 8080 78 ; i32 literal
-000001b: 0a ; OPCODE_I32_CONST
-000001c: 7f ; i32 literal
-000001d: 0a ; OPCODE_I32_CONST
-000001e: 8080 8080 78 ; i32 literal
-0000023: 0a ; OPCODE_I32_CONST
-0000024: 7f ; i32 literal
-0000025: 0b ; OPCODE_I64_CONST
-0000026: 00 ; i64 literal
-0000027: 0b ; OPCODE_I64_CONST
-0000028: 8080 8080 8080 8080 807f ; i64 literal
-0000032: 0b ; OPCODE_I64_CONST
-0000033: 7f ; i64 literal
-0000034: 0b ; OPCODE_I64_CONST
-0000035: 8080 8080 8080 8080 807f ; i64 literal
-000003f: 0b ; OPCODE_I64_CONST
-0000040: 7f ; i64 literal
-0000041: 0d ; OPCODE_F32_CONST
-0000042: 0000 0000 ; f32 literal
-0000046: 0d ; OPCODE_F32_CONST
-0000047: 1668 a965 ; f32 literal
-000004b: 0d ; OPCODE_F32_CONST
-000004c: 4020 4f37 ; f32 literal
-0000050: 0d ; OPCODE_F32_CONST
-0000051: 0000 c07f ; f32 literal
-0000055: 0d ; OPCODE_F32_CONST
-0000056: 0000 c0ff ; f32 literal
-000005a: 0d ; OPCODE_F32_CONST
-000005b: 0000 c07f ; f32 literal
-000005f: 0d ; OPCODE_F32_CONST
-0000060: bc0a 807f ; f32 literal
-0000064: 0d ; OPCODE_F32_CONST
-0000065: bc0a 80ff ; f32 literal
-0000069: 0d ; OPCODE_F32_CONST
-000006a: bc0a 807f ; f32 literal
-000006e: 0d ; OPCODE_F32_CONST
-000006f: 0000 807f ; f32 literal
-0000073: 0d ; OPCODE_F32_CONST
-0000074: 0000 80ff ; f32 literal
-0000078: 0d ; OPCODE_F32_CONST
-0000079: 0000 807f ; f32 literal
-000007d: 0d ; OPCODE_F32_CONST
-000007e: 0000 00bf ; f32 literal
-0000082: 0d ; OPCODE_F32_CONST
-0000083: db0f c940 ; f32 literal
-0000087: 0c ; OPCODE_F64_CONST
-0000088: 0000 0000 0000 0000 ; f64 literal
-0000090: 0c ; OPCODE_F64_CONST
-0000091: b856 0e3c dd9a efbf ; f64 literal
-0000099: 0c ; OPCODE_F64_CONST
-000009a: 182d 4454 fb21 1940 ; f64 literal
-00000a2: 0c ; OPCODE_F64_CONST
-00000a3: 0000 0000 0000 f87f ; f64 literal
-00000ab: 0c ; OPCODE_F64_CONST
-00000ac: 0000 0000 0000 f8ff ; f64 literal
-00000b4: 0c ; OPCODE_F64_CONST
-00000b5: 0000 0000 0000 f87f ; f64 literal
-00000bd: 0c ; OPCODE_F64_CONST
-00000be: bc0a 0000 0000 f07f ; f64 literal
-00000c6: 0c ; OPCODE_F64_CONST
-00000c7: bc0a 0000 0000 f0ff ; f64 literal
-00000cf: 0c ; OPCODE_F64_CONST
-00000d0: bc0a 0000 0000 f07f ; f64 literal
-00000d8: 0c ; OPCODE_F64_CONST
-00000d9: 0000 0000 0000 f07f ; f64 literal
-00000e1: 0c ; OPCODE_F64_CONST
-00000e2: 0000 0000 0000 f0ff ; f64 literal
-00000ea: 0c ; OPCODE_F64_CONST
-00000eb: 0000 0000 0000 f07f ; f64 literal
-00000f3: 0c ; OPCODE_F64_CONST
-00000f4: 0000 0000 0000 e0bf ; f64 literal
-00000fc: 0c ; OPCODE_F64_CONST
-00000fd: 182d 4454 fb21 1940 ; f64 literal
-; move data: [12, 105) -> [13, 106)
-0000011: f301 ; FIXUP func body size
-0000106: 06 ; WASM_BINARY_SECTION_END
+0000040: 00 ; func body size (guess)
+0000041: 00 ; local decl count
+0000042: 0a ; OPCODE_I32_CONST
+0000043: 00 ; i32 literal
+0000044: 0a ; OPCODE_I32_CONST
+0000045: 8080 8080 78 ; i32 literal
+000004a: 0a ; OPCODE_I32_CONST
+000004b: 7f ; i32 literal
+000004c: 0a ; OPCODE_I32_CONST
+000004d: 8080 8080 78 ; i32 literal
+0000052: 0a ; OPCODE_I32_CONST
+0000053: 7f ; i32 literal
+0000054: 0b ; OPCODE_I64_CONST
+0000055: 00 ; i64 literal
+0000056: 0b ; OPCODE_I64_CONST
+0000057: 8080 8080 8080 8080 807f ; i64 literal
+0000061: 0b ; OPCODE_I64_CONST
+0000062: 7f ; i64 literal
+0000063: 0b ; OPCODE_I64_CONST
+0000064: 8080 8080 8080 8080 807f ; i64 literal
+000006e: 0b ; OPCODE_I64_CONST
+000006f: 7f ; i64 literal
+0000070: 0d ; OPCODE_F32_CONST
+0000071: 0000 0000 ; f32 literal
+0000075: 0d ; OPCODE_F32_CONST
+0000076: 1668 a965 ; f32 literal
+000007a: 0d ; OPCODE_F32_CONST
+000007b: 4020 4f37 ; f32 literal
+000007f: 0d ; OPCODE_F32_CONST
+0000080: 0000 c07f ; f32 literal
+0000084: 0d ; OPCODE_F32_CONST
+0000085: 0000 c0ff ; f32 literal
+0000089: 0d ; OPCODE_F32_CONST
+000008a: 0000 c07f ; f32 literal
+000008e: 0d ; OPCODE_F32_CONST
+000008f: bc0a 807f ; f32 literal
+0000093: 0d ; OPCODE_F32_CONST
+0000094: bc0a 80ff ; f32 literal
+0000098: 0d ; OPCODE_F32_CONST
+0000099: bc0a 807f ; f32 literal
+000009d: 0d ; OPCODE_F32_CONST
+000009e: 0000 807f ; f32 literal
+00000a2: 0d ; OPCODE_F32_CONST
+00000a3: 0000 80ff ; f32 literal
+00000a7: 0d ; OPCODE_F32_CONST
+00000a8: 0000 807f ; f32 literal
+00000ac: 0d ; OPCODE_F32_CONST
+00000ad: 0000 00bf ; f32 literal
+00000b1: 0d ; OPCODE_F32_CONST
+00000b2: db0f c940 ; f32 literal
+00000b6: 0c ; OPCODE_F64_CONST
+00000b7: 0000 0000 0000 0000 ; f64 literal
+00000bf: 0c ; OPCODE_F64_CONST
+00000c0: b856 0e3c dd9a efbf ; f64 literal
+00000c8: 0c ; OPCODE_F64_CONST
+00000c9: 182d 4454 fb21 1940 ; f64 literal
+00000d1: 0c ; OPCODE_F64_CONST
+00000d2: 0000 0000 0000 f87f ; f64 literal
+00000da: 0c ; OPCODE_F64_CONST
+00000db: 0000 0000 0000 f8ff ; f64 literal
+00000e3: 0c ; OPCODE_F64_CONST
+00000e4: 0000 0000 0000 f87f ; f64 literal
+00000ec: 0c ; OPCODE_F64_CONST
+00000ed: bc0a 0000 0000 f07f ; f64 literal
+00000f5: 0c ; OPCODE_F64_CONST
+00000f6: bc0a 0000 0000 f0ff ; f64 literal
+00000fe: 0c ; OPCODE_F64_CONST
+00000ff: bc0a 0000 0000 f07f ; f64 literal
+0000107: 0c ; OPCODE_F64_CONST
+0000108: 0000 0000 0000 f07f ; f64 literal
+0000110: 0c ; OPCODE_F64_CONST
+0000111: 0000 0000 0000 f0ff ; f64 literal
+0000119: 0c ; OPCODE_F64_CONST
+000011a: 0000 0000 0000 f07f ; f64 literal
+0000122: 0c ; OPCODE_F64_CONST
+0000123: 0000 0000 0000 e0bf ; f64 literal
+000012b: 0c ; OPCODE_F64_CONST
+000012c: 182d 4454 fb21 1940 ; f64 literal
+; move data: [41, 134) -> [42, 135)
+0000040: f301 ; FIXUP func body size
+; move data: [2f, 135) -> [30, 136)
+000002e: 8602 ; FIXUP section size
+; section "end"
+0000136: 00 ; section size (guess)
+0000137: 03 ; string length
+0000138: 656e 64 ; section id: "end"
+0000136: 04 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0101 0000 0a01 000b
-0000010: 01f3 0100 0a00 0a80 8080 8078 0a7f 0a80
-0000020: 8080 8078 0a7f 0b00 0b80 8080 8080 8080
-0000030: 8080 7f0b 7f0b 8080 8080 8080 8080 807f
-0000040: 0b7f 0d00 0000 000d 1668 a965 0d40 204f
-0000050: 370d 0000 c07f 0d00 00c0 ff0d 0000 c07f
-0000060: 0dbc 0a80 7f0d bc0a 80ff 0dbc 0a80 7f0d
-0000070: 0000 807f 0d00 0080 ff0d 0000 807f 0d00
-0000080: 0000 bf0d db0f c940 0c00 0000 0000 0000
-0000090: 000c b856 0e3c dd9a efbf 0c18 2d44 54fb
-00000a0: 2119 400c 0000 0000 0000 f87f 0c00 0000
-00000b0: 0000 00f8 ff0c 0000 0000 0000 f87f 0cbc
-00000c0: 0a00 0000 00f0 7f0c bc0a 0000 0000 f0ff
-00000d0: 0cbc 0a00 0000 00f0 7f0c 0000 0000 0000
-00000e0: f07f 0c00 0000 0000 00f0 ff0c 0000 0000
-00000f0: 0000 f07f 0c00 0000 0000 00e0 bf0c 182d
-0000100: 4454 fb21 1940 06
+0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
+0000010: 7572 6573 0100 0016 1366 756e 6374 696f
+0000020: 6e5f 7369 676e 6174 7572 6573 0100 8602
+0000030: 0f66 756e 6374 696f 6e5f 626f 6469 6573
+0000040: 01f3 0100 0a00 0a80 8080 8078 0a7f 0a80
+0000050: 8080 8078 0a7f 0b00 0b80 8080 8080 8080
+0000060: 8080 7f0b 7f0b 8080 8080 8080 8080 807f
+0000070: 0b7f 0d00 0000 000d 1668 a965 0d40 204f
+0000080: 370d 0000 c07f 0d00 00c0 ff0d 0000 c07f
+0000090: 0dbc 0a80 7f0d bc0a 80ff 0dbc 0a80 7f0d
+00000a0: 0000 807f 0d00 0080 ff0d 0000 807f 0d00
+00000b0: 0000 bf0d db0f c940 0c00 0000 0000 0000
+00000c0: 000c b856 0e3c dd9a efbf 0c18 2d44 54fb
+00000d0: 2119 400c 0000 0000 0000 f87f 0c00 0000
+00000e0: 0000 00f8 ff0c 0000 0000 0000 f87f 0cbc
+00000f0: 0a00 0000 00f0 7f0c bc0a 0000 0000 f0ff
+0000100: 0cbc 0a00 0000 00f0 7f0c 0000 0000 0000
+0000110: f07f 0c00 0000 0000 00f0 ff0c 0000 0000
+0000120: 0000 f07f 0c00 0000 0000 00e0 bf0c 182d
+0000130: 4454 fb21 1940 0403 656e 64
;;; STDOUT ;;)
diff --git a/test/dump/convert.txt b/test/dump/convert.txt
index 2bdbd24d..c95e4691 100644
--- a/test/dump/convert.txt
+++ b/test/dump/convert.txt
@@ -27,51 +27,71 @@
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
0000004: 0a00 0000 ; WASM_BINARY_VERSION
-0000008: 01 ; WASM_BINARY_SECTION_SIGNATURES
-0000009: 01 ; num signatures
+; section "signatures"
+0000008: 00 ; section size (guess)
+0000009: 0a ; string length
+000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
+0000014: 01 ; num signatures
; signature 0
-000000a: 00 ; num params
-000000b: 00 ; result_type
-000000c: 0a ; WASM_BINARY_SECTION_FUNCTION_SIGNATURES
-000000d: 01 ; num functions
-000000e: 00 ; function 0 signature index
-000000f: 0b ; WASM_BINARY_SECTION_FUNCTION_BODIES
-0000010: 01 ; num functions
+0000015: 00 ; num params
+0000016: 00 ; result_type
+0000008: 0e ; FIXUP section size
+; section "function_signatures"
+0000017: 00 ; section size (guess)
+0000018: 13 ; string length
+0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
+0000029: 7265 73 ; section id: "function_signatures"
+000002c: 01 ; num functions
+000002d: 00 ; function 0 signature index
+0000017: 16 ; FIXUP section size
+; section "function_bodies"
+000002e: 00 ; section size (guess)
+000002f: 0f ; string length
+0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
+000003f: 01 ; num functions
; function body 0
-0000011: 00 ; func body size (guess)
-0000012: 00 ; local decl count
-0000013: a1 ; OPCODE_I32_CONVERT_I64
-0000014: a7 ; OPCODE_I64_UCONVERT_I32
-0000015: 9d ; OPCODE_I32_SCONVERT_F32
-0000016: a8 ; OPCODE_F32_SCONVERT_I32
-0000017: 9f ; OPCODE_I32_UCONVERT_F32
-0000018: a9 ; OPCODE_F32_UCONVERT_I32
-0000019: 9e ; OPCODE_I32_SCONVERT_F64
-000001a: ae ; OPCODE_F64_SCONVERT_I32
-000001b: a0 ; OPCODE_I32_UCONVERT_F64
-000001c: af ; OPCODE_F64_UCONVERT_I32
-000001d: 0a ; OPCODE_I32_CONST
-000001e: 00 ; i32 literal
-000001f: a2 ; OPCODE_I64_SCONVERT_F32
-0000020: aa ; OPCODE_F32_SCONVERT_I64
-0000021: a4 ; OPCODE_I64_UCONVERT_F32
-0000022: ab ; OPCODE_F32_UCONVERT_I64
-0000023: a3 ; OPCODE_I64_SCONVERT_F64
-0000024: b0 ; OPCODE_F64_SCONVERT_I64
-0000025: a5 ; OPCODE_I64_UCONVERT_F64
-0000026: b1 ; OPCODE_F64_UCONVERT_I64
-0000027: a6 ; OPCODE_I64_SCONVERT_I32
-0000028: 0a ; OPCODE_I32_CONST
-0000029: 00 ; i32 literal
-000002a: ac ; OPCODE_F32_CONVERT_F64
-000002b: b2 ; OPCODE_F64_CONVERT_F32
-000002c: 0d ; OPCODE_F32_CONST
-000002d: 0000 0000 ; f32 literal
-0000011: 1f ; FIXUP func body size
-0000031: 06 ; WASM_BINARY_SECTION_END
+0000040: 00 ; func body size (guess)
+0000041: 00 ; local decl count
+0000042: a1 ; OPCODE_I32_CONVERT_I64
+0000043: a7 ; OPCODE_I64_UCONVERT_I32
+0000044: 9d ; OPCODE_I32_SCONVERT_F32
+0000045: a8 ; OPCODE_F32_SCONVERT_I32
+0000046: 9f ; OPCODE_I32_UCONVERT_F32
+0000047: a9 ; OPCODE_F32_UCONVERT_I32
+0000048: 9e ; OPCODE_I32_SCONVERT_F64
+0000049: ae ; OPCODE_F64_SCONVERT_I32
+000004a: a0 ; OPCODE_I32_UCONVERT_F64
+000004b: af ; OPCODE_F64_UCONVERT_I32
+000004c: 0a ; OPCODE_I32_CONST
+000004d: 00 ; i32 literal
+000004e: a2 ; OPCODE_I64_SCONVERT_F32
+000004f: aa ; OPCODE_F32_SCONVERT_I64
+0000050: a4 ; OPCODE_I64_UCONVERT_F32
+0000051: ab ; OPCODE_F32_UCONVERT_I64
+0000052: a3 ; OPCODE_I64_SCONVERT_F64
+0000053: b0 ; OPCODE_F64_SCONVERT_I64
+0000054: a5 ; OPCODE_I64_UCONVERT_F64
+0000055: b1 ; OPCODE_F64_UCONVERT_I64
+0000056: a6 ; OPCODE_I64_SCONVERT_I32
+0000057: 0a ; OPCODE_I32_CONST
+0000058: 00 ; i32 literal
+0000059: ac ; OPCODE_F32_CONVERT_F64
+000005a: b2 ; OPCODE_F64_CONVERT_F32
+000005b: 0d ; OPCODE_F32_CONST
+000005c: 0000 0000 ; f32 literal
+0000040: 1f ; FIXUP func body size
+000002e: 31 ; FIXUP section size
+; section "end"
+0000060: 00 ; section size (guess)
+0000061: 03 ; string length
+0000062: 656e 64 ; section id: "end"
+0000060: 04 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0101 0000 0a01 000b
-0000010: 011f 00a1 a79d a89f a99e aea0 af0a 00a2
-0000020: aaa4 aba3 b0a5 b1a6 0a00 acb2 0d00 0000
-0000030: 0006
+0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
+0000010: 7572 6573 0100 0016 1366 756e 6374 696f
+0000020: 6e5f 7369 676e 6174 7572 6573 0100 310f
+0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 7301
+0000040: 1f00 a1a7 9da8 9fa9 9eae a0af 0a00 a2aa
+0000050: a4ab a3b0 a5b1 a60a 00ac b20d 0000 0000
+0000060: 0403 656e 64
;;; STDOUT ;;)
diff --git a/test/dump/dedupe-sig.txt b/test/dump/dedupe-sig.txt
index e86cd132..988221d8 100644
--- a/test/dump/dedupe-sig.txt
+++ b/test/dump/dedupe-sig.txt
@@ -6,34 +6,59 @@
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
0000004: 0a00 0000 ; WASM_BINARY_VERSION
-0000008: 01 ; WASM_BINARY_SECTION_SIGNATURES
-0000009: 01 ; num signatures
+; section "signatures"
+0000008: 00 ; section size (guess)
+0000009: 0a ; string length
+000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
+0000014: 01 ; num signatures
; signature 0
-000000a: 01 ; num params
-000000b: 02 ; result_type
-000000c: 01 ; param type
-000000d: 08 ; WASM_BINARY_SECTION_IMPORTS
-000000e: 01 ; num imports
+0000015: 01 ; num params
+0000016: 02 ; result_type
+0000017: 01 ; param type
+0000008: 0f ; FIXUP section size
+; section "import_table"
+0000018: 00 ; section size (guess)
+0000019: 0c ; string length
+000001a: 696d 706f 7274 5f74 6162 6c65 ; section id: "import_table"
+0000026: 01 ; num imports
; import header 0
-000000f: 00 ; import signature index
-0000010: 03 ; string length
-0000011: 666f 6f ; import module name
-0000014: 03 ; string length
-0000015: 6261 72 ; import function name
-0000018: 0a ; WASM_BINARY_SECTION_FUNCTION_SIGNATURES
-0000019: 01 ; num functions
-000001a: 00 ; function 0 signature index
-000001b: 0b ; WASM_BINARY_SECTION_FUNCTION_BODIES
-000001c: 01 ; num functions
+0000027: 00 ; import signature index
+0000028: 03 ; string length
+0000029: 666f 6f ; import module name
+000002c: 03 ; string length
+000002d: 6261 72 ; import function name
+0000018: 17 ; FIXUP section size
+; section "function_signatures"
+0000030: 00 ; section size (guess)
+0000031: 13 ; string length
+0000032: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
+0000042: 7265 73 ; section id: "function_signatures"
+0000045: 01 ; num functions
+0000046: 00 ; function 0 signature index
+0000030: 16 ; FIXUP section size
+; section "function_bodies"
+0000047: 00 ; section size (guess)
+0000048: 0f ; string length
+0000049: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
+0000058: 01 ; num functions
; function body 0
-000001d: 00 ; func body size (guess)
-000001e: 00 ; local decl count
-000001f: 0b ; OPCODE_I64_CONST
-0000020: 00 ; i64 literal
-000001d: 03 ; FIXUP func body size
-0000021: 06 ; WASM_BINARY_SECTION_END
+0000059: 00 ; func body size (guess)
+000005a: 00 ; local decl count
+000005b: 0b ; OPCODE_I64_CONST
+000005c: 00 ; i64 literal
+0000059: 03 ; FIXUP func body size
+0000047: 15 ; FIXUP section size
+; section "end"
+000005d: 00 ; section size (guess)
+000005e: 03 ; string length
+000005f: 656e 64 ; section id: "end"
+000005d: 04 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0101 0102 0108 0100
-0000010: 0366 6f6f 0362 6172 0a01 000b 0103 000b
-0000020: 0006
+0000000: 0061 736d 0a00 0000 0f0a 7369 676e 6174
+0000010: 7572 6573 0101 0201 170c 696d 706f 7274
+0000020: 5f74 6162 6c65 0100 0366 6f6f 0362 6172
+0000030: 1613 6675 6e63 7469 6f6e 5f73 6967 6e61
+0000040: 7475 7265 7301 0015 0f66 756e 6374 696f
+0000050: 6e5f 626f 6469 6573 0103 000b 0004 0365
+0000060: 6e64
;;; STDOUT ;;)
diff --git a/test/dump/export-multi.txt b/test/dump/export-multi.txt
index 925eddee..1ca8bd3d 100644
--- a/test/dump/export-multi.txt
+++ b/test/dump/export-multi.txt
@@ -6,31 +6,56 @@
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
0000004: 0a00 0000 ; WASM_BINARY_VERSION
-0000008: 01 ; WASM_BINARY_SECTION_SIGNATURES
-0000009: 01 ; num signatures
+; section "signatures"
+0000008: 00 ; section size (guess)
+0000009: 0a ; string length
+000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
+0000014: 01 ; num signatures
; signature 0
-000000a: 00 ; num params
-000000b: 00 ; result_type
-000000c: 0a ; WASM_BINARY_SECTION_FUNCTION_SIGNATURES
-000000d: 01 ; num functions
-000000e: 00 ; function 0 signature index
-000000f: 0b ; WASM_BINARY_SECTION_FUNCTION_BODIES
-0000010: 01 ; num functions
+0000015: 00 ; num params
+0000016: 00 ; result_type
+0000008: 0e ; FIXUP section size
+; section "function_signatures"
+0000017: 00 ; section size (guess)
+0000018: 13 ; string length
+0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
+0000029: 7265 73 ; section id: "function_signatures"
+000002c: 01 ; num functions
+000002d: 00 ; function 0 signature index
+0000017: 16 ; FIXUP section size
+; section "function_bodies"
+000002e: 00 ; section size (guess)
+000002f: 0f ; string length
+0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
+000003f: 01 ; num functions
; function body 0
-0000011: 00 ; func body size (guess)
-0000012: 00 ; local decl count
-0000013: 00 ; OPCODE_NOP
-0000011: 02 ; FIXUP func body size
-0000014: 09 ; WASM_BINARY_SECTION_EXPORTS
-0000015: 02 ; num exports
-0000016: 00 ; export func index
-0000017: 01 ; string length
-0000018: 61 ; export name
-0000019: 00 ; export func index
-000001a: 01 ; string length
-000001b: 62 ; export name
-000001c: 06 ; WASM_BINARY_SECTION_END
+0000040: 00 ; func body size (guess)
+0000041: 00 ; local decl count
+0000042: 00 ; OPCODE_NOP
+0000040: 02 ; FIXUP func body size
+000002e: 14 ; FIXUP section size
+; section "export_table"
+0000043: 00 ; section size (guess)
+0000044: 0c ; string length
+0000045: 6578 706f 7274 5f74 6162 6c65 ; section id: "export_table"
+0000051: 02 ; num exports
+0000052: 00 ; export func index
+0000053: 01 ; string length
+0000054: 61 ; export name
+0000055: 00 ; export func index
+0000056: 01 ; string length
+0000057: 62 ; export name
+0000043: 14 ; FIXUP section size
+; section "end"
+0000058: 00 ; section size (guess)
+0000059: 03 ; string length
+000005a: 656e 64 ; section id: "end"
+0000058: 04 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0101 0000 0a01 000b
-0000010: 0102 0000 0902 0001 6100 0162 06
+0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
+0000010: 7572 6573 0100 0016 1366 756e 6374 696f
+0000020: 6e5f 7369 676e 6174 7572 6573 0100 140f
+0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 7301
+0000040: 0200 0014 0c65 7870 6f72 745f 7461 626c
+0000050: 6502 0001 6100 0162 0403 656e 64
;;; STDOUT ;;)
diff --git a/test/dump/expr-br.txt b/test/dump/expr-br.txt
index 3c0bb99b..8bf88d1d 100644
--- a/test/dump/expr-br.txt
+++ b/test/dump/expr-br.txt
@@ -6,28 +6,48 @@
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
0000004: 0a00 0000 ; WASM_BINARY_VERSION
-0000008: 01 ; WASM_BINARY_SECTION_SIGNATURES
-0000009: 01 ; num signatures
+; section "signatures"
+0000008: 00 ; section size (guess)
+0000009: 0a ; string length
+000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
+0000014: 01 ; num signatures
; signature 0
-000000a: 00 ; num params
-000000b: 01 ; result_type
-000000c: 0a ; WASM_BINARY_SECTION_FUNCTION_SIGNATURES
-000000d: 01 ; num functions
-000000e: 00 ; function 0 signature index
-000000f: 0b ; WASM_BINARY_SECTION_FUNCTION_BODIES
-0000010: 01 ; num functions
+0000015: 00 ; num params
+0000016: 01 ; result_type
+0000008: 0e ; FIXUP section size
+; section "function_signatures"
+0000017: 00 ; section size (guess)
+0000018: 13 ; string length
+0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
+0000029: 7265 73 ; section id: "function_signatures"
+000002c: 01 ; num functions
+000002d: 00 ; function 0 signature index
+0000017: 16 ; FIXUP section size
+; section "function_bodies"
+000002e: 00 ; section size (guess)
+000002f: 0f ; string length
+0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
+000003f: 01 ; num functions
; function body 0
-0000011: 00 ; func body size (guess)
-0000012: 00 ; local decl count
-0000013: 01 ; OPCODE_BLOCK
-0000014: 01 ; num expressions
-0000015: 06 ; OPCODE_BR
-0000016: 00 ; break depth
-0000017: 0a ; OPCODE_I32_CONST
-0000018: 01 ; i32 literal
-0000011: 07 ; FIXUP func body size
-0000019: 06 ; WASM_BINARY_SECTION_END
+0000040: 00 ; func body size (guess)
+0000041: 00 ; local decl count
+0000042: 01 ; OPCODE_BLOCK
+0000043: 01 ; num expressions
+0000044: 06 ; OPCODE_BR
+0000045: 00 ; break depth
+0000046: 0a ; OPCODE_I32_CONST
+0000047: 01 ; i32 literal
+0000040: 07 ; FIXUP func body size
+000002e: 19 ; FIXUP section size
+; section "end"
+0000048: 00 ; section size (guess)
+0000049: 03 ; string length
+000004a: 656e 64 ; section id: "end"
+0000048: 04 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0101 0001 0a01 000b
-0000010: 0107 0001 0106 000a 0106
+0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
+0000010: 7572 6573 0100 0116 1366 756e 6374 696f
+0000020: 6e5f 7369 676e 6174 7572 6573 0100 190f
+0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 7301
+0000040: 0700 0101 0600 0a01 0403 656e 64
;;; STDOUT ;;)
diff --git a/test/dump/expr-brif.txt b/test/dump/expr-brif.txt
index 07996b59..28736202 100644
--- a/test/dump/expr-brif.txt
+++ b/test/dump/expr-brif.txt
@@ -7,32 +7,53 @@
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
0000004: 0a00 0000 ; WASM_BINARY_VERSION
-0000008: 01 ; WASM_BINARY_SECTION_SIGNATURES
-0000009: 01 ; num signatures
+; section "signatures"
+0000008: 00 ; section size (guess)
+0000009: 0a ; string length
+000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
+0000014: 01 ; num signatures
; signature 0
-000000a: 00 ; num params
-000000b: 01 ; result_type
-000000c: 0a ; WASM_BINARY_SECTION_FUNCTION_SIGNATURES
-000000d: 01 ; num functions
-000000e: 00 ; function 0 signature index
-000000f: 0b ; WASM_BINARY_SECTION_FUNCTION_BODIES
-0000010: 01 ; num functions
+0000015: 00 ; num params
+0000016: 01 ; result_type
+0000008: 0e ; FIXUP section size
+; section "function_signatures"
+0000017: 00 ; section size (guess)
+0000018: 13 ; string length
+0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
+0000029: 7265 73 ; section id: "function_signatures"
+000002c: 01 ; num functions
+000002d: 00 ; function 0 signature index
+0000017: 16 ; FIXUP section size
+; section "function_bodies"
+000002e: 00 ; section size (guess)
+000002f: 0f ; string length
+0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
+000003f: 01 ; num functions
; function body 0
-0000011: 00 ; func body size (guess)
-0000012: 00 ; local decl count
-0000013: 01 ; OPCODE_BLOCK
-0000014: 02 ; num expressions
-0000015: 07 ; OPCODE_BR_IF
-0000016: 00 ; break depth
-0000017: 0a ; OPCODE_I32_CONST
-0000018: 2a ; i32 literal
-0000019: 0a ; OPCODE_I32_CONST
-000001a: 00 ; i32 literal
-000001b: 0a ; OPCODE_I32_CONST
-000001c: 1d ; i32 literal
-0000011: 0b ; FIXUP func body size
-000001d: 06 ; WASM_BINARY_SECTION_END
+0000040: 00 ; func body size (guess)
+0000041: 00 ; local decl count
+0000042: 01 ; OPCODE_BLOCK
+0000043: 02 ; num expressions
+0000044: 07 ; OPCODE_BR_IF
+0000045: 00 ; break depth
+0000046: 0a ; OPCODE_I32_CONST
+0000047: 2a ; i32 literal
+0000048: 0a ; OPCODE_I32_CONST
+0000049: 00 ; i32 literal
+000004a: 0a ; OPCODE_I32_CONST
+000004b: 1d ; i32 literal
+0000040: 0b ; FIXUP func body size
+000002e: 1d ; FIXUP section size
+; section "end"
+000004c: 00 ; section size (guess)
+000004d: 03 ; string length
+000004e: 656e 64 ; section id: "end"
+000004c: 04 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0101 0001 0a01 000b
-0000010: 010b 0001 0207 000a 2a0a 000a 1d06
+0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
+0000010: 7572 6573 0100 0116 1366 756e 6374 696f
+0000020: 6e5f 7369 676e 6174 7572 6573 0100 1d0f
+0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 7301
+0000040: 0b00 0102 0700 0a2a 0a00 0a1d 0403 656e
+0000050: 64
;;; STDOUT ;;)
diff --git a/test/dump/func-exported.txt b/test/dump/func-exported.txt
index 16e16bbe..b8b5d4bd 100644
--- a/test/dump/func-exported.txt
+++ b/test/dump/func-exported.txt
@@ -5,27 +5,52 @@
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
0000004: 0a00 0000 ; WASM_BINARY_VERSION
-0000008: 01 ; WASM_BINARY_SECTION_SIGNATURES
-0000009: 01 ; num signatures
+; section "signatures"
+0000008: 00 ; section size (guess)
+0000009: 0a ; string length
+000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
+0000014: 01 ; num signatures
; signature 0
-000000a: 00 ; num params
-000000b: 00 ; result_type
-000000c: 0a ; WASM_BINARY_SECTION_FUNCTION_SIGNATURES
-000000d: 01 ; num functions
-000000e: 00 ; function 0 signature index
-000000f: 0b ; WASM_BINARY_SECTION_FUNCTION_BODIES
-0000010: 01 ; num functions
+0000015: 00 ; num params
+0000016: 00 ; result_type
+0000008: 0e ; FIXUP section size
+; section "function_signatures"
+0000017: 00 ; section size (guess)
+0000018: 13 ; string length
+0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
+0000029: 7265 73 ; section id: "function_signatures"
+000002c: 01 ; num functions
+000002d: 00 ; function 0 signature index
+0000017: 16 ; FIXUP section size
+; section "function_bodies"
+000002e: 00 ; section size (guess)
+000002f: 0f ; string length
+0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
+000003f: 01 ; num functions
; function body 0
-0000011: 00 ; func body size (guess)
-0000012: 00 ; local decl count
-0000011: 01 ; FIXUP func body size
-0000013: 09 ; WASM_BINARY_SECTION_EXPORTS
-0000014: 01 ; num exports
-0000015: 00 ; export func index
-0000016: 03 ; string length
-0000017: 666f 6f ; export name
-000001a: 06 ; WASM_BINARY_SECTION_END
+0000040: 00 ; func body size (guess)
+0000041: 00 ; local decl count
+0000040: 01 ; FIXUP func body size
+000002e: 13 ; FIXUP section size
+; section "export_table"
+0000042: 00 ; section size (guess)
+0000043: 0c ; string length
+0000044: 6578 706f 7274 5f74 6162 6c65 ; section id: "export_table"
+0000050: 01 ; num exports
+0000051: 00 ; export func index
+0000052: 03 ; string length
+0000053: 666f 6f ; export name
+0000042: 13 ; FIXUP section size
+; section "end"
+0000056: 00 ; section size (guess)
+0000057: 03 ; string length
+0000058: 656e 64 ; section id: "end"
+0000056: 04 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0101 0000 0a01 000b
-0000010: 0101 0009 0100 0366 6f6f 06
+0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
+0000010: 7572 6573 0100 0016 1366 756e 6374 696f
+0000020: 6e5f 7369 676e 6174 7572 6573 0100 130f
+0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 7301
+0000040: 0100 130c 6578 706f 7274 5f74 6162 6c65
+0000050: 0100 0366 6f6f 0403 656e 64
;;; STDOUT ;;)
diff --git a/test/dump/func-multi.txt b/test/dump/func-multi.txt
index 3be3bac0..32650611 100644
--- a/test/dump/func-multi.txt
+++ b/test/dump/func-multi.txt
@@ -6,32 +6,52 @@
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
0000004: 0a00 0000 ; WASM_BINARY_VERSION
-0000008: 01 ; WASM_BINARY_SECTION_SIGNATURES
-0000009: 01 ; num signatures
+; section "signatures"
+0000008: 00 ; section size (guess)
+0000009: 0a ; string length
+000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
+0000014: 01 ; num signatures
; signature 0
-000000a: 00 ; num params
-000000b: 00 ; result_type
-000000c: 0a ; WASM_BINARY_SECTION_FUNCTION_SIGNATURES
-000000d: 03 ; num functions
-000000e: 00 ; function 0 signature index
-000000f: 00 ; function 1 signature index
-0000010: 00 ; function 2 signature index
-0000011: 0b ; WASM_BINARY_SECTION_FUNCTION_BODIES
-0000012: 03 ; num functions
+0000015: 00 ; num params
+0000016: 00 ; result_type
+0000008: 0e ; FIXUP section size
+; section "function_signatures"
+0000017: 00 ; section size (guess)
+0000018: 13 ; string length
+0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
+0000029: 7265 73 ; section id: "function_signatures"
+000002c: 03 ; num functions
+000002d: 00 ; function 0 signature index
+000002e: 00 ; function 1 signature index
+000002f: 00 ; function 2 signature index
+0000017: 18 ; FIXUP section size
+; section "function_bodies"
+0000030: 00 ; section size (guess)
+0000031: 0f ; string length
+0000032: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
+0000041: 03 ; num functions
; function body 0
-0000013: 00 ; func body size (guess)
-0000014: 00 ; local decl count
-0000013: 01 ; FIXUP func body size
+0000042: 00 ; func body size (guess)
+0000043: 00 ; local decl count
+0000042: 01 ; FIXUP func body size
; function body 1
-0000015: 00 ; func body size (guess)
-0000016: 00 ; local decl count
-0000015: 01 ; FIXUP func body size
+0000044: 00 ; func body size (guess)
+0000045: 00 ; local decl count
+0000044: 01 ; FIXUP func body size
; function body 2
-0000017: 00 ; func body size (guess)
-0000018: 00 ; local decl count
-0000017: 01 ; FIXUP func body size
-0000019: 06 ; WASM_BINARY_SECTION_END
+0000046: 00 ; func body size (guess)
+0000047: 00 ; local decl count
+0000046: 01 ; FIXUP func body size
+0000030: 17 ; FIXUP section size
+; section "end"
+0000048: 00 ; section size (guess)
+0000049: 03 ; string length
+000004a: 656e 64 ; section id: "end"
+0000048: 04 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0101 0000 0a03 0000
-0000010: 000b 0301 0001 0001 0006
+0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
+0000010: 7572 6573 0100 0018 1366 756e 6374 696f
+0000020: 6e5f 7369 676e 6174 7572 6573 0300 0000
+0000030: 170f 6675 6e63 7469 6f6e 5f62 6f64 6965
+0000040: 7303 0100 0100 0100 0403 656e 64
;;; STDOUT ;;)
diff --git a/test/dump/func-named.txt b/test/dump/func-named.txt
index fbaf73d3..d6a3f18f 100644
--- a/test/dump/func-named.txt
+++ b/test/dump/func-named.txt
@@ -4,22 +4,42 @@
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
0000004: 0a00 0000 ; WASM_BINARY_VERSION
-0000008: 01 ; WASM_BINARY_SECTION_SIGNATURES
-0000009: 01 ; num signatures
+; section "signatures"
+0000008: 00 ; section size (guess)
+0000009: 0a ; string length
+000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
+0000014: 01 ; num signatures
; signature 0
-000000a: 00 ; num params
-000000b: 00 ; result_type
-000000c: 0a ; WASM_BINARY_SECTION_FUNCTION_SIGNATURES
-000000d: 01 ; num functions
-000000e: 00 ; function 0 signature index
-000000f: 0b ; WASM_BINARY_SECTION_FUNCTION_BODIES
-0000010: 01 ; num functions
+0000015: 00 ; num params
+0000016: 00 ; result_type
+0000008: 0e ; FIXUP section size
+; section "function_signatures"
+0000017: 00 ; section size (guess)
+0000018: 13 ; string length
+0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
+0000029: 7265 73 ; section id: "function_signatures"
+000002c: 01 ; num functions
+000002d: 00 ; function 0 signature index
+0000017: 16 ; FIXUP section size
+; section "function_bodies"
+000002e: 00 ; section size (guess)
+000002f: 0f ; string length
+0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
+000003f: 01 ; num functions
; function body 0
-0000011: 00 ; func body size (guess)
-0000012: 00 ; local decl count
-0000011: 01 ; FIXUP func body size
-0000013: 06 ; WASM_BINARY_SECTION_END
+0000040: 00 ; func body size (guess)
+0000041: 00 ; local decl count
+0000040: 01 ; FIXUP func body size
+000002e: 13 ; FIXUP section size
+; section "end"
+0000042: 00 ; section size (guess)
+0000043: 03 ; string length
+0000044: 656e 64 ; section id: "end"
+0000042: 04 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0101 0000 0a01 000b
-0000010: 0101 0006
+0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
+0000010: 7572 6573 0100 0016 1366 756e 6374 696f
+0000020: 6e5f 7369 676e 6174 7572 6573 0100 130f
+0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 7301
+0000040: 0100 0403 656e 64
;;; STDOUT ;;)
diff --git a/test/dump/getlocal-param.txt b/test/dump/getlocal-param.txt
index 0d73288d..166ef93f 100644
--- a/test/dump/getlocal-param.txt
+++ b/test/dump/getlocal-param.txt
@@ -15,43 +15,63 @@
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
0000004: 0a00 0000 ; WASM_BINARY_VERSION
-0000008: 01 ; WASM_BINARY_SECTION_SIGNATURES
-0000009: 01 ; num signatures
+; section "signatures"
+0000008: 00 ; section size (guess)
+0000009: 0a ; string length
+000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
+0000014: 01 ; num signatures
; signature 0
-000000a: 02 ; num params
-000000b: 00 ; result_type
-000000c: 01 ; param type
-000000d: 03 ; param type
-000000e: 0a ; WASM_BINARY_SECTION_FUNCTION_SIGNATURES
-000000f: 01 ; num functions
-0000010: 00 ; function 0 signature index
-0000011: 0b ; WASM_BINARY_SECTION_FUNCTION_BODIES
-0000012: 01 ; num functions
+0000015: 02 ; num params
+0000016: 00 ; result_type
+0000017: 01 ; param type
+0000018: 03 ; param type
+0000008: 10 ; FIXUP section size
+; section "function_signatures"
+0000019: 00 ; section size (guess)
+000001a: 13 ; string length
+000001b: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
+000002b: 7265 73 ; section id: "function_signatures"
+000002e: 01 ; num functions
+000002f: 00 ; function 0 signature index
+0000019: 16 ; FIXUP section size
+; section "function_bodies"
+0000030: 00 ; section size (guess)
+0000031: 0f ; string length
+0000032: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
+0000041: 01 ; num functions
; function body 0
-0000013: 00 ; func body size (guess)
-0000014: 03 ; local decl count
-0000015: 01 ; local i32 count
-0000016: 01 ; WASM_TYPE_I32
-0000017: 01 ; local i64 count
-0000018: 02 ; WASM_TYPE_I64
-0000019: 02 ; local f32 count
-000001a: 03 ; WASM_TYPE_F32
-000001b: 0e ; OPCODE_GET_LOCAL
-000001c: 00 ; remapped local index
-000001d: 0e ; OPCODE_GET_LOCAL
-000001e: 01 ; remapped local index
-000001f: 0e ; OPCODE_GET_LOCAL
-0000020: 03 ; remapped local index
-0000021: 0e ; OPCODE_GET_LOCAL
-0000022: 04 ; remapped local index
-0000023: 0e ; OPCODE_GET_LOCAL
-0000024: 02 ; remapped local index
-0000025: 0e ; OPCODE_GET_LOCAL
-0000026: 05 ; remapped local index
-0000013: 13 ; FIXUP func body size
-0000027: 06 ; WASM_BINARY_SECTION_END
+0000042: 00 ; func body size (guess)
+0000043: 03 ; local decl count
+0000044: 01 ; local i32 count
+0000045: 01 ; WASM_TYPE_I32
+0000046: 01 ; local i64 count
+0000047: 02 ; WASM_TYPE_I64
+0000048: 02 ; local f32 count
+0000049: 03 ; WASM_TYPE_F32
+000004a: 0e ; OPCODE_GET_LOCAL
+000004b: 00 ; remapped local index
+000004c: 0e ; OPCODE_GET_LOCAL
+000004d: 01 ; remapped local index
+000004e: 0e ; OPCODE_GET_LOCAL
+000004f: 03 ; remapped local index
+0000050: 0e ; OPCODE_GET_LOCAL
+0000051: 04 ; remapped local index
+0000052: 0e ; OPCODE_GET_LOCAL
+0000053: 02 ; remapped local index
+0000054: 0e ; OPCODE_GET_LOCAL
+0000055: 05 ; remapped local index
+0000042: 13 ; FIXUP func body size
+0000030: 25 ; FIXUP section size
+; section "end"
+0000056: 00 ; section size (guess)
+0000057: 03 ; string length
+0000058: 656e 64 ; section id: "end"
+0000056: 04 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0101 0200 0103 0a01
-0000010: 000b 0113 0301 0101 0202 030e 000e 010e
-0000020: 030e 040e 020e 0506
+0000000: 0061 736d 0a00 0000 100a 7369 676e 6174
+0000010: 7572 6573 0102 0001 0316 1366 756e 6374
+0000020: 696f 6e5f 7369 676e 6174 7572 6573 0100
+0000030: 250f 6675 6e63 7469 6f6e 5f62 6f64 6965
+0000040: 7301 1303 0101 0102 0203 0e00 0e01 0e03
+0000050: 0e04 0e02 0e05 0403 656e 64
;;; STDOUT ;;)
diff --git a/test/dump/getlocal.txt b/test/dump/getlocal.txt
index 59c9f7c8..c3b482f4 100644
--- a/test/dump/getlocal.txt
+++ b/test/dump/getlocal.txt
@@ -17,47 +17,67 @@
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
0000004: 0a00 0000 ; WASM_BINARY_VERSION
-0000008: 01 ; WASM_BINARY_SECTION_SIGNATURES
-0000009: 01 ; num signatures
+; section "signatures"
+0000008: 00 ; section size (guess)
+0000009: 0a ; string length
+000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
+0000014: 01 ; num signatures
; signature 0
-000000a: 00 ; num params
-000000b: 00 ; result_type
-000000c: 0a ; WASM_BINARY_SECTION_FUNCTION_SIGNATURES
-000000d: 01 ; num functions
-000000e: 00 ; function 0 signature index
-000000f: 0b ; WASM_BINARY_SECTION_FUNCTION_BODIES
-0000010: 01 ; num functions
+0000015: 00 ; num params
+0000016: 00 ; result_type
+0000008: 0e ; FIXUP section size
+; section "function_signatures"
+0000017: 00 ; section size (guess)
+0000018: 13 ; string length
+0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
+0000029: 7265 73 ; section id: "function_signatures"
+000002c: 01 ; num functions
+000002d: 00 ; function 0 signature index
+0000017: 16 ; FIXUP section size
+; section "function_bodies"
+000002e: 00 ; section size (guess)
+000002f: 0f ; string length
+0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
+000003f: 01 ; num functions
; function body 0
-0000011: 00 ; func body size (guess)
-0000012: 04 ; local decl count
-0000013: 02 ; local i32 count
-0000014: 01 ; WASM_TYPE_I32
-0000015: 02 ; local i64 count
-0000016: 02 ; WASM_TYPE_I64
-0000017: 02 ; local f32 count
-0000018: 03 ; WASM_TYPE_F32
-0000019: 02 ; local f64 count
-000001a: 04 ; WASM_TYPE_F64
-000001b: 0e ; OPCODE_GET_LOCAL
-000001c: 06 ; remapped local index
-000001d: 0e ; OPCODE_GET_LOCAL
-000001e: 04 ; remapped local index
-000001f: 0e ; OPCODE_GET_LOCAL
-0000020: 02 ; remapped local index
-0000021: 0e ; OPCODE_GET_LOCAL
-0000022: 00 ; remapped local index
-0000023: 0e ; OPCODE_GET_LOCAL
-0000024: 01 ; remapped local index
-0000025: 0e ; OPCODE_GET_LOCAL
-0000026: 05 ; remapped local index
-0000027: 0e ; OPCODE_GET_LOCAL
-0000028: 07 ; remapped local index
-0000029: 0e ; OPCODE_GET_LOCAL
-000002a: 03 ; remapped local index
-0000011: 19 ; FIXUP func body size
-000002b: 06 ; WASM_BINARY_SECTION_END
+0000040: 00 ; func body size (guess)
+0000041: 04 ; local decl count
+0000042: 02 ; local i32 count
+0000043: 01 ; WASM_TYPE_I32
+0000044: 02 ; local i64 count
+0000045: 02 ; WASM_TYPE_I64
+0000046: 02 ; local f32 count
+0000047: 03 ; WASM_TYPE_F32
+0000048: 02 ; local f64 count
+0000049: 04 ; WASM_TYPE_F64
+000004a: 0e ; OPCODE_GET_LOCAL
+000004b: 06 ; remapped local index
+000004c: 0e ; OPCODE_GET_LOCAL
+000004d: 04 ; remapped local index
+000004e: 0e ; OPCODE_GET_LOCAL
+000004f: 02 ; remapped local index
+0000050: 0e ; OPCODE_GET_LOCAL
+0000051: 00 ; remapped local index
+0000052: 0e ; OPCODE_GET_LOCAL
+0000053: 01 ; remapped local index
+0000054: 0e ; OPCODE_GET_LOCAL
+0000055: 05 ; remapped local index
+0000056: 0e ; OPCODE_GET_LOCAL
+0000057: 07 ; remapped local index
+0000058: 0e ; OPCODE_GET_LOCAL
+0000059: 03 ; remapped local index
+0000040: 19 ; FIXUP func body size
+000002e: 2b ; FIXUP section size
+; section "end"
+000005a: 00 ; section size (guess)
+000005b: 03 ; string length
+000005c: 656e 64 ; section id: "end"
+000005a: 04 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0101 0000 0a01 000b
-0000010: 0119 0402 0102 0202 0302 040e 060e 040e
-0000020: 020e 000e 010e 050e 070e 0306
+0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
+0000010: 7572 6573 0100 0016 1366 756e 6374 696f
+0000020: 6e5f 7369 676e 6174 7572 6573 0100 2b0f
+0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 7301
+0000040: 1904 0201 0202 0203 0204 0e06 0e04 0e02
+0000050: 0e00 0e01 0e05 0e07 0e03 0403 656e 64
;;; STDOUT ;;)
diff --git a/test/dump/grow-memory.txt b/test/dump/grow-memory.txt
index 74b5ab80..083fd9e6 100644
--- a/test/dump/grow-memory.txt
+++ b/test/dump/grow-memory.txt
@@ -6,30 +6,55 @@
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
0000004: 0a00 0000 ; WASM_BINARY_VERSION
-0000008: 00 ; WASM_BINARY_SECTION_MEMORY
-0000009: 01 ; min mem pages
-000000a: 02 ; max mem pages
-000000b: 00 ; export mem
-000000c: 01 ; WASM_BINARY_SECTION_SIGNATURES
-000000d: 01 ; num signatures
+; section "memory"
+0000008: 00 ; section size (guess)
+0000009: 06 ; string length
+000000a: 6d65 6d6f 7279 ; section id: "memory"
+0000010: 01 ; min mem pages
+0000011: 02 ; max mem pages
+0000012: 00 ; export mem
+0000008: 0a ; FIXUP section size
+; section "signatures"
+0000013: 00 ; section size (guess)
+0000014: 0a ; string length
+0000015: 7369 676e 6174 7572 6573 ; section id: "signatures"
+000001f: 01 ; num signatures
; signature 0
-000000e: 01 ; num params
-000000f: 00 ; result_type
-0000010: 01 ; param type
-0000011: 0a ; WASM_BINARY_SECTION_FUNCTION_SIGNATURES
-0000012: 01 ; num functions
-0000013: 00 ; function 0 signature index
-0000014: 0b ; WASM_BINARY_SECTION_FUNCTION_BODIES
-0000015: 01 ; num functions
+0000020: 01 ; num params
+0000021: 00 ; result_type
+0000022: 01 ; param type
+0000013: 0f ; FIXUP section size
+; section "function_signatures"
+0000023: 00 ; section size (guess)
+0000024: 13 ; string length
+0000025: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
+0000035: 7265 73 ; section id: "function_signatures"
+0000038: 01 ; num functions
+0000039: 00 ; function 0 signature index
+0000023: 16 ; FIXUP section size
+; section "function_bodies"
+000003a: 00 ; section size (guess)
+000003b: 0f ; string length
+000003c: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
+000004b: 01 ; num functions
; function body 0
-0000016: 00 ; func body size (guess)
-0000017: 00 ; local decl count
-0000018: 39 ; OPCODE_GROW_MEMORY
-0000019: 0e ; OPCODE_GET_LOCAL
-000001a: 00 ; remapped local index
-0000016: 04 ; FIXUP func body size
-000001b: 06 ; WASM_BINARY_SECTION_END
+000004c: 00 ; func body size (guess)
+000004d: 00 ; local decl count
+000004e: 39 ; OPCODE_GROW_MEMORY
+000004f: 0e ; OPCODE_GET_LOCAL
+0000050: 00 ; remapped local index
+000004c: 04 ; FIXUP func body size
+000003a: 16 ; FIXUP section size
+; section "end"
+0000051: 00 ; section size (guess)
+0000052: 03 ; string length
+0000053: 656e 64 ; section id: "end"
+0000051: 04 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0001 0200 0101 0100
-0000010: 010a 0100 0b01 0400 390e 0006
+0000000: 0061 736d 0a00 0000 0a06 6d65 6d6f 7279
+0000010: 0102 000f 0a73 6967 6e61 7475 7265 7301
+0000020: 0100 0116 1366 756e 6374 696f 6e5f 7369
+0000030: 676e 6174 7572 6573 0100 160f 6675 6e63
+0000040: 7469 6f6e 5f62 6f64 6965 7301 0400 390e
+0000050: 0004 0365 6e64
;;; STDOUT ;;)
diff --git a/test/dump/if-then-else-list.txt b/test/dump/if-then-else-list.txt
index e5b1b74d..f0f2f5c0 100644
--- a/test/dump/if-then-else-list.txt
+++ b/test/dump/if-then-else-list.txt
@@ -7,38 +7,58 @@
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
0000004: 0a00 0000 ; WASM_BINARY_VERSION
-0000008: 01 ; WASM_BINARY_SECTION_SIGNATURES
-0000009: 01 ; num signatures
+; section "signatures"
+0000008: 00 ; section size (guess)
+0000009: 0a ; string length
+000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
+0000014: 01 ; num signatures
; signature 0
-000000a: 00 ; num params
-000000b: 00 ; result_type
-000000c: 0a ; WASM_BINARY_SECTION_FUNCTION_SIGNATURES
-000000d: 01 ; num functions
-000000e: 00 ; function 0 signature index
-000000f: 0b ; WASM_BINARY_SECTION_FUNCTION_BODIES
-0000010: 01 ; num functions
+0000015: 00 ; num params
+0000016: 00 ; result_type
+0000008: 0e ; FIXUP section size
+; section "function_signatures"
+0000017: 00 ; section size (guess)
+0000018: 13 ; string length
+0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
+0000029: 7265 73 ; section id: "function_signatures"
+000002c: 01 ; num functions
+000002d: 00 ; function 0 signature index
+0000017: 16 ; FIXUP section size
+; section "function_bodies"
+000002e: 00 ; section size (guess)
+000002f: 0f ; string length
+0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
+000003f: 01 ; num functions
; function body 0
-0000011: 00 ; func body size (guess)
-0000012: 00 ; local decl count
-0000013: 04 ; OPCODE_IF_THEN
-0000014: 0a ; OPCODE_I32_CONST
-0000015: 01 ; i32 literal
-0000016: 01 ; OPCODE_BLOCK
-0000017: 02 ; num expressions
-0000018: 0a ; OPCODE_I32_CONST
-0000019: 02 ; i32 literal
-000001a: 0a ; OPCODE_I32_CONST
-000001b: 03 ; i32 literal
-000001c: 01 ; OPCODE_BLOCK
-000001d: 02 ; num expressions
-000001e: 0a ; OPCODE_I32_CONST
-000001f: 04 ; i32 literal
-0000020: 0a ; OPCODE_I32_CONST
-0000021: 05 ; i32 literal
-0000011: 10 ; FIXUP func body size
-0000022: 06 ; WASM_BINARY_SECTION_END
+0000040: 00 ; func body size (guess)
+0000041: 00 ; local decl count
+0000042: 04 ; OPCODE_IF_THEN
+0000043: 0a ; OPCODE_I32_CONST
+0000044: 01 ; i32 literal
+0000045: 01 ; OPCODE_BLOCK
+0000046: 02 ; num expressions
+0000047: 0a ; OPCODE_I32_CONST
+0000048: 02 ; i32 literal
+0000049: 0a ; OPCODE_I32_CONST
+000004a: 03 ; i32 literal
+000004b: 01 ; OPCODE_BLOCK
+000004c: 02 ; num expressions
+000004d: 0a ; OPCODE_I32_CONST
+000004e: 04 ; i32 literal
+000004f: 0a ; OPCODE_I32_CONST
+0000050: 05 ; i32 literal
+0000040: 10 ; FIXUP func body size
+000002e: 22 ; FIXUP section size
+; section "end"
+0000051: 00 ; section size (guess)
+0000052: 03 ; string length
+0000053: 656e 64 ; section id: "end"
+0000051: 04 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0101 0000 0a01 000b
-0000010: 0110 0004 0a01 0102 0a02 0a03 0102 0a04
-0000020: 0a05 06
+0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
+0000010: 7572 6573 0100 0016 1366 756e 6374 696f
+0000020: 6e5f 7369 676e 6174 7572 6573 0100 220f
+0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 7301
+0000040: 1000 040a 0101 020a 020a 0301 020a 040a
+0000050: 0504 0365 6e64
;;; STDOUT ;;)
diff --git a/test/dump/if-then-list.txt b/test/dump/if-then-list.txt
index db523038..235ced28 100644
--- a/test/dump/if-then-list.txt
+++ b/test/dump/if-then-list.txt
@@ -6,29 +6,49 @@
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
0000004: 0a00 0000 ; WASM_BINARY_VERSION
-0000008: 01 ; WASM_BINARY_SECTION_SIGNATURES
-0000009: 01 ; num signatures
+; section "signatures"
+0000008: 00 ; section size (guess)
+0000009: 0a ; string length
+000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
+0000014: 01 ; num signatures
; signature 0
-000000a: 00 ; num params
-000000b: 00 ; result_type
-000000c: 0a ; WASM_BINARY_SECTION_FUNCTION_SIGNATURES
-000000d: 01 ; num functions
-000000e: 00 ; function 0 signature index
-000000f: 0b ; WASM_BINARY_SECTION_FUNCTION_BODIES
-0000010: 01 ; num functions
+0000015: 00 ; num params
+0000016: 00 ; result_type
+0000008: 0e ; FIXUP section size
+; section "function_signatures"
+0000017: 00 ; section size (guess)
+0000018: 13 ; string length
+0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
+0000029: 7265 73 ; section id: "function_signatures"
+000002c: 01 ; num functions
+000002d: 00 ; function 0 signature index
+0000017: 16 ; FIXUP section size
+; section "function_bodies"
+000002e: 00 ; section size (guess)
+000002f: 0f ; string length
+0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
+000003f: 01 ; num functions
; function body 0
-0000011: 00 ; func body size (guess)
-0000012: 00 ; local decl count
-0000013: 03 ; OPCODE_IF
-0000014: 0a ; OPCODE_I32_CONST
-0000015: 01 ; i32 literal
-0000016: 01 ; OPCODE_BLOCK
-0000017: 02 ; num expressions
-0000018: 00 ; OPCODE_NOP
-0000019: 00 ; OPCODE_NOP
-0000011: 08 ; FIXUP func body size
-000001a: 06 ; WASM_BINARY_SECTION_END
+0000040: 00 ; func body size (guess)
+0000041: 00 ; local decl count
+0000042: 03 ; OPCODE_IF
+0000043: 0a ; OPCODE_I32_CONST
+0000044: 01 ; i32 literal
+0000045: 01 ; OPCODE_BLOCK
+0000046: 02 ; num expressions
+0000047: 00 ; OPCODE_NOP
+0000048: 00 ; OPCODE_NOP
+0000040: 08 ; FIXUP func body size
+000002e: 1a ; FIXUP section size
+; section "end"
+0000049: 00 ; section size (guess)
+000004a: 03 ; string length
+000004b: 656e 64 ; section id: "end"
+0000049: 04 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0101 0000 0a01 000b
-0000010: 0108 0003 0a01 0102 0000 06
+0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
+0000010: 7572 6573 0100 0016 1366 756e 6374 696f
+0000020: 6e5f 7369 676e 6174 7572 6573 0100 1a0f
+0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 7301
+0000040: 0800 030a 0101 0200 0004 0365 6e64
;;; STDOUT ;;)
diff --git a/test/dump/if.txt b/test/dump/if.txt
index 9c247a9b..182f2ee0 100644
--- a/test/dump/if.txt
+++ b/test/dump/if.txt
@@ -8,55 +8,75 @@
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
0000004: 0a00 0000 ; WASM_BINARY_VERSION
-0000008: 01 ; WASM_BINARY_SECTION_SIGNATURES
-0000009: 01 ; num signatures
+; section "signatures"
+0000008: 00 ; section size (guess)
+0000009: 0a ; string length
+000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
+0000014: 01 ; num signatures
; signature 0
-000000a: 00 ; num params
-000000b: 00 ; result_type
-000000c: 0a ; WASM_BINARY_SECTION_FUNCTION_SIGNATURES
-000000d: 02 ; num functions
-000000e: 00 ; function 0 signature index
-000000f: 00 ; function 1 signature index
-0000010: 0b ; WASM_BINARY_SECTION_FUNCTION_BODIES
-0000011: 02 ; num functions
+0000015: 00 ; num params
+0000016: 00 ; result_type
+0000008: 0e ; FIXUP section size
+; section "function_signatures"
+0000017: 00 ; section size (guess)
+0000018: 13 ; string length
+0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
+0000029: 7265 73 ; section id: "function_signatures"
+000002c: 02 ; num functions
+000002d: 00 ; function 0 signature index
+000002e: 00 ; function 1 signature index
+0000017: 17 ; FIXUP section size
+; section "function_bodies"
+000002f: 00 ; section size (guess)
+0000030: 0f ; string length
+0000031: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
+0000040: 02 ; num functions
; function body 0
-0000012: 00 ; func body size (guess)
-0000013: 00 ; local decl count
-0000014: 03 ; OPCODE_IF
-0000015: 0a ; OPCODE_I32_CONST
-0000016: 01 ; i32 literal
-0000017: 01 ; OPCODE_BLOCK
-0000018: 01 ; num expressions
-0000019: 00 ; OPCODE_NOP
-000001a: 04 ; OPCODE_IF_THEN
-000001b: 0a ; OPCODE_I32_CONST
-000001c: 00 ; i32 literal
-000001d: 01 ; OPCODE_BLOCK
-000001e: 01 ; num expressions
-000001f: 0d ; OPCODE_F32_CONST
-0000020: 0000 803f ; f32 literal
-0000024: 01 ; OPCODE_BLOCK
-0000025: 01 ; num expressions
-0000026: 0d ; OPCODE_F32_CONST
-0000027: 0000 0040 ; f32 literal
-0000012: 18 ; FIXUP func body size
+0000041: 00 ; func body size (guess)
+0000042: 00 ; local decl count
+0000043: 03 ; OPCODE_IF
+0000044: 0a ; OPCODE_I32_CONST
+0000045: 01 ; i32 literal
+0000046: 01 ; OPCODE_BLOCK
+0000047: 01 ; num expressions
+0000048: 00 ; OPCODE_NOP
+0000049: 04 ; OPCODE_IF_THEN
+000004a: 0a ; OPCODE_I32_CONST
+000004b: 00 ; i32 literal
+000004c: 01 ; OPCODE_BLOCK
+000004d: 01 ; num expressions
+000004e: 0d ; OPCODE_F32_CONST
+000004f: 0000 803f ; f32 literal
+0000053: 01 ; OPCODE_BLOCK
+0000054: 01 ; num expressions
+0000055: 0d ; OPCODE_F32_CONST
+0000056: 0000 0040 ; f32 literal
+0000041: 18 ; FIXUP func body size
; function body 1
-000002b: 00 ; func body size (guess)
-000002c: 00 ; local decl count
-000002d: 04 ; OPCODE_IF_THEN
-000002e: 0a ; OPCODE_I32_CONST
-000002f: 01 ; i32 literal
-0000030: 01 ; OPCODE_BLOCK
-0000031: 01 ; num expressions
-0000032: 14 ; OPCODE_RETURN
-0000033: 01 ; OPCODE_BLOCK
-0000034: 01 ; num expressions
-0000035: 14 ; OPCODE_RETURN
-000002b: 0a ; FIXUP func body size
-0000036: 06 ; WASM_BINARY_SECTION_END
+000005a: 00 ; func body size (guess)
+000005b: 00 ; local decl count
+000005c: 04 ; OPCODE_IF_THEN
+000005d: 0a ; OPCODE_I32_CONST
+000005e: 01 ; i32 literal
+000005f: 01 ; OPCODE_BLOCK
+0000060: 01 ; num expressions
+0000061: 14 ; OPCODE_RETURN
+0000062: 01 ; OPCODE_BLOCK
+0000063: 01 ; num expressions
+0000064: 14 ; OPCODE_RETURN
+000005a: 0a ; FIXUP func body size
+000002f: 35 ; FIXUP section size
+; section "end"
+0000065: 00 ; section size (guess)
+0000066: 03 ; string length
+0000067: 656e 64 ; section id: "end"
+0000065: 04 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0101 0000 0a02 0000
-0000010: 0b02 1800 030a 0101 0100 040a 0001 010d
-0000020: 0000 803f 0101 0d00 0000 400a 0004 0a01
-0000030: 0101 1401 0114 06
+0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
+0000010: 7572 6573 0100 0017 1366 756e 6374 696f
+0000020: 6e5f 7369 676e 6174 7572 6573 0200 0035
+0000030: 0f66 756e 6374 696f 6e5f 626f 6469 6573
+0000040: 0218 0003 0a01 0101 0004 0a00 0101 0d00
+0000050: 0080 3f01 010d 0000 0040 0a00 040a 0101
+0000060: 0114 0101 1404 0365 6e64
;;; STDOUT ;;)
diff --git a/test/dump/import.txt b/test/dump/import.txt
index 6e793252..f25881cf 100644
--- a/test/dump/import.txt
+++ b/test/dump/import.txt
@@ -7,37 +7,50 @@
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
0000004: 0a00 0000 ; WASM_BINARY_VERSION
-0000008: 01 ; WASM_BINARY_SECTION_SIGNATURES
-0000009: 02 ; num signatures
+; section "signatures"
+0000008: 00 ; section size (guess)
+0000009: 0a ; string length
+000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
+0000014: 02 ; num signatures
; signature 0
-000000a: 04 ; num params
-000000b: 00 ; result_type
-000000c: 01 ; param type
-000000d: 02 ; param type
-000000e: 03 ; param type
-000000f: 04 ; param type
+0000015: 04 ; num params
+0000016: 00 ; result_type
+0000017: 01 ; param type
+0000018: 02 ; param type
+0000019: 03 ; param type
+000001a: 04 ; param type
; signature 1
-0000010: 01 ; num params
-0000011: 01 ; result_type
-0000012: 01 ; param type
-0000013: 08 ; WASM_BINARY_SECTION_IMPORTS
-0000014: 02 ; num imports
+000001b: 01 ; num params
+000001c: 01 ; result_type
+000001d: 01 ; param type
+0000008: 15 ; FIXUP section size
+; section "import_table"
+000001e: 00 ; section size (guess)
+000001f: 0c ; string length
+0000020: 696d 706f 7274 5f74 6162 6c65 ; section id: "import_table"
+000002c: 02 ; num imports
; import header 0
-0000015: 00 ; import signature index
-0000016: 07 ; string length
-0000017: 6967 6e6f 7265 64 ; import module name
-000001e: 04 ; string length
-000001f: 7465 7374 ; import function name
+000002d: 00 ; import signature index
+000002e: 07 ; string length
+000002f: 6967 6e6f 7265 64 ; import module name
+0000036: 04 ; string length
+0000037: 7465 7374 ; import function name
; import header 1
-0000023: 01 ; import signature index
-0000024: 07 ; string length
-0000025: 6967 6e6f 7265 64 ; import module name
-000002c: 05 ; string length
-000002d: 7465 7374 32 ; import function name
-0000032: 06 ; WASM_BINARY_SECTION_END
+000003b: 01 ; import signature index
+000003c: 07 ; string length
+000003d: 6967 6e6f 7265 64 ; import module name
+0000044: 05 ; string length
+0000045: 7465 7374 32 ; import function name
+000001e: 2b ; FIXUP section size
+; section "end"
+000004a: 00 ; section size (guess)
+000004b: 03 ; string length
+000004c: 656e 64 ; section id: "end"
+000004a: 04 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0102 0400 0102 0304
-0000010: 0101 0108 0200 0769 676e 6f72 6564 0474
-0000020: 6573 7401 0769 676e 6f72 6564 0574 6573
-0000030: 7432 06
+0000000: 0061 736d 0a00 0000 150a 7369 676e 6174
+0000010: 7572 6573 0204 0001 0203 0401 0101 2b0c
+0000020: 696d 706f 7274 5f74 6162 6c65 0200 0769
+0000030: 676e 6f72 6564 0474 6573 7401 0769 676e
+0000040: 6f72 6564 0574 6573 7432 0403 656e 64
;;; STDOUT ;;)
diff --git a/test/dump/load-aligned.txt b/test/dump/load-aligned.txt
index 17cab634..982cae16 100644
--- a/test/dump/load-aligned.txt
+++ b/test/dump/load-aligned.txt
@@ -38,172 +38,193 @@
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
0000004: 0a00 0000 ; WASM_BINARY_VERSION
-0000008: 01 ; WASM_BINARY_SECTION_SIGNATURES
-0000009: 01 ; num signatures
+; section "signatures"
+0000008: 00 ; section size (guess)
+0000009: 0a ; string length
+000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
+0000014: 01 ; num signatures
; signature 0
-000000a: 00 ; num params
-000000b: 00 ; result_type
-000000c: 0a ; WASM_BINARY_SECTION_FUNCTION_SIGNATURES
-000000d: 01 ; num functions
-000000e: 00 ; function 0 signature index
-000000f: 0b ; WASM_BINARY_SECTION_FUNCTION_BODIES
-0000010: 01 ; num functions
+0000015: 00 ; num params
+0000016: 00 ; result_type
+0000008: 0e ; FIXUP section size
+; section "function_signatures"
+0000017: 00 ; section size (guess)
+0000018: 13 ; string length
+0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
+0000029: 7265 73 ; section id: "function_signatures"
+000002c: 01 ; num functions
+000002d: 00 ; function 0 signature index
+0000017: 16 ; FIXUP section size
+; section "function_bodies"
+000002e: 00 ; section size (guess)
+000002f: 0f ; string length
+0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
+000003f: 01 ; num functions
; function body 0
-0000011: 00 ; func body size (guess)
-0000012: 00 ; local decl count
-0000013: 20 ; OPCODE_I32_LOAD_MEM8_S
-0000014: 00 ; alignment
-0000015: 00 ; load offset
-0000016: 0a ; OPCODE_I32_CONST
-0000017: 00 ; i32 literal
-0000018: 20 ; OPCODE_I32_LOAD_MEM8_S
-0000019: 01 ; alignment
-000001a: 00 ; load offset
-000001b: 0a ; OPCODE_I32_CONST
-000001c: 00 ; i32 literal
-000001d: 20 ; OPCODE_I32_LOAD_MEM8_S
-000001e: 02 ; alignment
-000001f: 00 ; load offset
-0000020: 0a ; OPCODE_I32_CONST
-0000021: 00 ; i32 literal
-0000022: 20 ; OPCODE_I32_LOAD_MEM8_S
-0000023: 03 ; alignment
-0000024: 00 ; load offset
-0000025: 0a ; OPCODE_I32_CONST
-0000026: 00 ; i32 literal
-0000027: 22 ; OPCODE_I32_LOAD_MEM16_S
-0000028: 00 ; alignment
-0000029: 00 ; load offset
-000002a: 0a ; OPCODE_I32_CONST
-000002b: 00 ; i32 literal
-000002c: 22 ; OPCODE_I32_LOAD_MEM16_S
-000002d: 01 ; alignment
-000002e: 00 ; load offset
-000002f: 0a ; OPCODE_I32_CONST
-0000030: 00 ; i32 literal
-0000031: 22 ; OPCODE_I32_LOAD_MEM16_S
-0000032: 02 ; alignment
-0000033: 00 ; load offset
-0000034: 0a ; OPCODE_I32_CONST
-0000035: 00 ; i32 literal
-0000036: 22 ; OPCODE_I32_LOAD_MEM16_S
-0000037: 03 ; alignment
-0000038: 00 ; load offset
-0000039: 0a ; OPCODE_I32_CONST
-000003a: 00 ; i32 literal
-000003b: 2a ; OPCODE_I32_LOAD_MEM
-000003c: 00 ; alignment
-000003d: 00 ; load offset
-000003e: 0a ; OPCODE_I32_CONST
-000003f: 00 ; i32 literal
-0000040: 2a ; OPCODE_I32_LOAD_MEM
-0000041: 01 ; alignment
-0000042: 00 ; load offset
-0000043: 0a ; OPCODE_I32_CONST
-0000044: 00 ; i32 literal
-0000045: 2a ; OPCODE_I32_LOAD_MEM
-0000046: 02 ; alignment
-0000047: 00 ; load offset
-0000048: 0a ; OPCODE_I32_CONST
-0000049: 00 ; i32 literal
-000004a: 2a ; OPCODE_I32_LOAD_MEM
-000004b: 03 ; alignment
-000004c: 00 ; load offset
-000004d: 0a ; OPCODE_I32_CONST
-000004e: 00 ; i32 literal
-000004f: 2b ; OPCODE_I64_LOAD_MEM
-0000050: 00 ; alignment
-0000051: 00 ; load offset
-0000052: 0a ; OPCODE_I32_CONST
-0000053: 00 ; i32 literal
-0000054: 2b ; OPCODE_I64_LOAD_MEM
-0000055: 01 ; alignment
-0000056: 00 ; load offset
-0000057: 0a ; OPCODE_I32_CONST
-0000058: 00 ; i32 literal
-0000059: 2b ; OPCODE_I64_LOAD_MEM
-000005a: 02 ; alignment
-000005b: 00 ; load offset
-000005c: 0a ; OPCODE_I32_CONST
-000005d: 00 ; i32 literal
-000005e: 2b ; OPCODE_I64_LOAD_MEM
-000005f: 03 ; alignment
-0000060: 00 ; load offset
-0000061: 0a ; OPCODE_I32_CONST
-0000062: 00 ; i32 literal
-0000063: 24 ; OPCODE_I64_LOAD_MEM8_S
-0000064: 00 ; alignment
-0000065: 00 ; load offset
-0000066: 0a ; OPCODE_I32_CONST
-0000067: 00 ; i32 literal
-0000068: 24 ; OPCODE_I64_LOAD_MEM8_S
-0000069: 01 ; alignment
-000006a: 00 ; load offset
-000006b: 0a ; OPCODE_I32_CONST
-000006c: 00 ; i32 literal
-000006d: 24 ; OPCODE_I64_LOAD_MEM8_S
-000006e: 02 ; alignment
-000006f: 00 ; load offset
-0000070: 0a ; OPCODE_I32_CONST
-0000071: 00 ; i32 literal
-0000072: 24 ; OPCODE_I64_LOAD_MEM8_S
-0000073: 03 ; alignment
-0000074: 00 ; load offset
-0000075: 0a ; OPCODE_I32_CONST
-0000076: 00 ; i32 literal
-0000077: 26 ; OPCODE_I64_LOAD_MEM16_S
-0000078: 00 ; alignment
-0000079: 00 ; load offset
-000007a: 0a ; OPCODE_I32_CONST
-000007b: 00 ; i32 literal
-000007c: 26 ; OPCODE_I64_LOAD_MEM16_S
-000007d: 01 ; alignment
-000007e: 00 ; load offset
-000007f: 0a ; OPCODE_I32_CONST
-0000080: 00 ; i32 literal
-0000081: 26 ; OPCODE_I64_LOAD_MEM16_S
-0000082: 02 ; alignment
-0000083: 00 ; load offset
-0000084: 0a ; OPCODE_I32_CONST
-0000085: 00 ; i32 literal
-0000086: 26 ; OPCODE_I64_LOAD_MEM16_S
-0000087: 03 ; alignment
-0000088: 00 ; load offset
-0000089: 0a ; OPCODE_I32_CONST
-000008a: 00 ; i32 literal
-000008b: 28 ; OPCODE_I64_LOAD_MEM32_S
-000008c: 00 ; alignment
-000008d: 00 ; load offset
-000008e: 0a ; OPCODE_I32_CONST
-000008f: 00 ; i32 literal
-0000090: 28 ; OPCODE_I64_LOAD_MEM32_S
-0000091: 01 ; alignment
-0000092: 00 ; load offset
-0000093: 0a ; OPCODE_I32_CONST
-0000094: 00 ; i32 literal
-0000095: 28 ; OPCODE_I64_LOAD_MEM32_S
-0000096: 02 ; alignment
-0000097: 00 ; load offset
-0000098: 0a ; OPCODE_I32_CONST
-0000099: 00 ; i32 literal
-000009a: 28 ; OPCODE_I64_LOAD_MEM32_S
-000009b: 03 ; alignment
-000009c: 00 ; load offset
-000009d: 0a ; OPCODE_I32_CONST
-000009e: 00 ; i32 literal
-; move data: [12, 9f) -> [13, a0)
-0000011: 8d01 ; FIXUP func body size
-00000a0: 06 ; WASM_BINARY_SECTION_END
+0000040: 00 ; func body size (guess)
+0000041: 00 ; local decl count
+0000042: 20 ; OPCODE_I32_LOAD_MEM8_S
+0000043: 00 ; alignment
+0000044: 00 ; load offset
+0000045: 0a ; OPCODE_I32_CONST
+0000046: 00 ; i32 literal
+0000047: 20 ; OPCODE_I32_LOAD_MEM8_S
+0000048: 01 ; alignment
+0000049: 00 ; load offset
+000004a: 0a ; OPCODE_I32_CONST
+000004b: 00 ; i32 literal
+000004c: 20 ; OPCODE_I32_LOAD_MEM8_S
+000004d: 02 ; alignment
+000004e: 00 ; load offset
+000004f: 0a ; OPCODE_I32_CONST
+0000050: 00 ; i32 literal
+0000051: 20 ; OPCODE_I32_LOAD_MEM8_S
+0000052: 03 ; alignment
+0000053: 00 ; load offset
+0000054: 0a ; OPCODE_I32_CONST
+0000055: 00 ; i32 literal
+0000056: 22 ; OPCODE_I32_LOAD_MEM16_S
+0000057: 00 ; alignment
+0000058: 00 ; load offset
+0000059: 0a ; OPCODE_I32_CONST
+000005a: 00 ; i32 literal
+000005b: 22 ; OPCODE_I32_LOAD_MEM16_S
+000005c: 01 ; alignment
+000005d: 00 ; load offset
+000005e: 0a ; OPCODE_I32_CONST
+000005f: 00 ; i32 literal
+0000060: 22 ; OPCODE_I32_LOAD_MEM16_S
+0000061: 02 ; alignment
+0000062: 00 ; load offset
+0000063: 0a ; OPCODE_I32_CONST
+0000064: 00 ; i32 literal
+0000065: 22 ; OPCODE_I32_LOAD_MEM16_S
+0000066: 03 ; alignment
+0000067: 00 ; load offset
+0000068: 0a ; OPCODE_I32_CONST
+0000069: 00 ; i32 literal
+000006a: 2a ; OPCODE_I32_LOAD_MEM
+000006b: 00 ; alignment
+000006c: 00 ; load offset
+000006d: 0a ; OPCODE_I32_CONST
+000006e: 00 ; i32 literal
+000006f: 2a ; OPCODE_I32_LOAD_MEM
+0000070: 01 ; alignment
+0000071: 00 ; load offset
+0000072: 0a ; OPCODE_I32_CONST
+0000073: 00 ; i32 literal
+0000074: 2a ; OPCODE_I32_LOAD_MEM
+0000075: 02 ; alignment
+0000076: 00 ; load offset
+0000077: 0a ; OPCODE_I32_CONST
+0000078: 00 ; i32 literal
+0000079: 2a ; OPCODE_I32_LOAD_MEM
+000007a: 03 ; alignment
+000007b: 00 ; load offset
+000007c: 0a ; OPCODE_I32_CONST
+000007d: 00 ; i32 literal
+000007e: 2b ; OPCODE_I64_LOAD_MEM
+000007f: 00 ; alignment
+0000080: 00 ; load offset
+0000081: 0a ; OPCODE_I32_CONST
+0000082: 00 ; i32 literal
+0000083: 2b ; OPCODE_I64_LOAD_MEM
+0000084: 01 ; alignment
+0000085: 00 ; load offset
+0000086: 0a ; OPCODE_I32_CONST
+0000087: 00 ; i32 literal
+0000088: 2b ; OPCODE_I64_LOAD_MEM
+0000089: 02 ; alignment
+000008a: 00 ; load offset
+000008b: 0a ; OPCODE_I32_CONST
+000008c: 00 ; i32 literal
+000008d: 2b ; OPCODE_I64_LOAD_MEM
+000008e: 03 ; alignment
+000008f: 00 ; load offset
+0000090: 0a ; OPCODE_I32_CONST
+0000091: 00 ; i32 literal
+0000092: 24 ; OPCODE_I64_LOAD_MEM8_S
+0000093: 00 ; alignment
+0000094: 00 ; load offset
+0000095: 0a ; OPCODE_I32_CONST
+0000096: 00 ; i32 literal
+0000097: 24 ; OPCODE_I64_LOAD_MEM8_S
+0000098: 01 ; alignment
+0000099: 00 ; load offset
+000009a: 0a ; OPCODE_I32_CONST
+000009b: 00 ; i32 literal
+000009c: 24 ; OPCODE_I64_LOAD_MEM8_S
+000009d: 02 ; alignment
+000009e: 00 ; load offset
+000009f: 0a ; OPCODE_I32_CONST
+00000a0: 00 ; i32 literal
+00000a1: 24 ; OPCODE_I64_LOAD_MEM8_S
+00000a2: 03 ; alignment
+00000a3: 00 ; load offset
+00000a4: 0a ; OPCODE_I32_CONST
+00000a5: 00 ; i32 literal
+00000a6: 26 ; OPCODE_I64_LOAD_MEM16_S
+00000a7: 00 ; alignment
+00000a8: 00 ; load offset
+00000a9: 0a ; OPCODE_I32_CONST
+00000aa: 00 ; i32 literal
+00000ab: 26 ; OPCODE_I64_LOAD_MEM16_S
+00000ac: 01 ; alignment
+00000ad: 00 ; load offset
+00000ae: 0a ; OPCODE_I32_CONST
+00000af: 00 ; i32 literal
+00000b0: 26 ; OPCODE_I64_LOAD_MEM16_S
+00000b1: 02 ; alignment
+00000b2: 00 ; load offset
+00000b3: 0a ; OPCODE_I32_CONST
+00000b4: 00 ; i32 literal
+00000b5: 26 ; OPCODE_I64_LOAD_MEM16_S
+00000b6: 03 ; alignment
+00000b7: 00 ; load offset
+00000b8: 0a ; OPCODE_I32_CONST
+00000b9: 00 ; i32 literal
+00000ba: 28 ; OPCODE_I64_LOAD_MEM32_S
+00000bb: 00 ; alignment
+00000bc: 00 ; load offset
+00000bd: 0a ; OPCODE_I32_CONST
+00000be: 00 ; i32 literal
+00000bf: 28 ; OPCODE_I64_LOAD_MEM32_S
+00000c0: 01 ; alignment
+00000c1: 00 ; load offset
+00000c2: 0a ; OPCODE_I32_CONST
+00000c3: 00 ; i32 literal
+00000c4: 28 ; OPCODE_I64_LOAD_MEM32_S
+00000c5: 02 ; alignment
+00000c6: 00 ; load offset
+00000c7: 0a ; OPCODE_I32_CONST
+00000c8: 00 ; i32 literal
+00000c9: 28 ; OPCODE_I64_LOAD_MEM32_S
+00000ca: 03 ; alignment
+00000cb: 00 ; load offset
+00000cc: 0a ; OPCODE_I32_CONST
+00000cd: 00 ; i32 literal
+; move data: [41, ce) -> [42, cf)
+0000040: 8d01 ; FIXUP func body size
+; move data: [2f, cf) -> [30, d0)
+000002e: a001 ; FIXUP section size
+; section "end"
+00000d0: 00 ; section size (guess)
+00000d1: 03 ; string length
+00000d2: 656e 64 ; section id: "end"
+00000d0: 04 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0101 0000 0a01 000b
-0000010: 018d 0100 2000 000a 0020 0100 0a00 2002
-0000020: 000a 0020 0300 0a00 2200 000a 0022 0100
-0000030: 0a00 2202 000a 0022 0300 0a00 2a00 000a
-0000040: 002a 0100 0a00 2a02 000a 002a 0300 0a00
-0000050: 2b00 000a 002b 0100 0a00 2b02 000a 002b
-0000060: 0300 0a00 2400 000a 0024 0100 0a00 2402
-0000070: 000a 0024 0300 0a00 2600 000a 0026 0100
-0000080: 0a00 2602 000a 0026 0300 0a00 2800 000a
-0000090: 0028 0100 0a00 2802 000a 0028 0300 0a00
-00000a0: 06
+0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
+0000010: 7572 6573 0100 0016 1366 756e 6374 696f
+0000020: 6e5f 7369 676e 6174 7572 6573 0100 a001
+0000030: 0f66 756e 6374 696f 6e5f 626f 6469 6573
+0000040: 018d 0100 2000 000a 0020 0100 0a00 2002
+0000050: 000a 0020 0300 0a00 2200 000a 0022 0100
+0000060: 0a00 2202 000a 0022 0300 0a00 2a00 000a
+0000070: 002a 0100 0a00 2a02 000a 002a 0300 0a00
+0000080: 2b00 000a 002b 0100 0a00 2b02 000a 002b
+0000090: 0300 0a00 2400 000a 0024 0100 0a00 2402
+00000a0: 000a 0024 0300 0a00 2600 000a 0026 0100
+00000b0: 0a00 2602 000a 0026 0300 0a00 2800 000a
+00000c0: 0028 0100 0a00 2802 000a 0028 0300 0a00
+00000d0: 0403 656e 64
;;; STDOUT ;;)
diff --git a/test/dump/load.txt b/test/dump/load.txt
index 831045f6..4de63649 100644
--- a/test/dump/load.txt
+++ b/test/dump/load.txt
@@ -18,96 +18,116 @@
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
0000004: 0a00 0000 ; WASM_BINARY_VERSION
-0000008: 01 ; WASM_BINARY_SECTION_SIGNATURES
-0000009: 01 ; num signatures
+; section "signatures"
+0000008: 00 ; section size (guess)
+0000009: 0a ; string length
+000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
+0000014: 01 ; num signatures
; signature 0
-000000a: 00 ; num params
-000000b: 00 ; result_type
-000000c: 0a ; WASM_BINARY_SECTION_FUNCTION_SIGNATURES
-000000d: 01 ; num functions
-000000e: 00 ; function 0 signature index
-000000f: 0b ; WASM_BINARY_SECTION_FUNCTION_BODIES
-0000010: 01 ; num functions
+0000015: 00 ; num params
+0000016: 00 ; result_type
+0000008: 0e ; FIXUP section size
+; section "function_signatures"
+0000017: 00 ; section size (guess)
+0000018: 13 ; string length
+0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
+0000029: 7265 73 ; section id: "function_signatures"
+000002c: 01 ; num functions
+000002d: 00 ; function 0 signature index
+0000017: 16 ; FIXUP section size
+; section "function_bodies"
+000002e: 00 ; section size (guess)
+000002f: 0f ; string length
+0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
+000003f: 01 ; num functions
; function body 0
-0000011: 00 ; func body size (guess)
-0000012: 00 ; local decl count
-0000013: 2a ; OPCODE_I32_LOAD_MEM
-0000014: 02 ; alignment
-0000015: 00 ; load offset
-0000016: 0a ; OPCODE_I32_CONST
-0000017: 00 ; i32 literal
-0000018: 20 ; OPCODE_I32_LOAD_MEM8_S
-0000019: 00 ; alignment
-000001a: 00 ; load offset
-000001b: 0a ; OPCODE_I32_CONST
-000001c: 00 ; i32 literal
-000001d: 22 ; OPCODE_I32_LOAD_MEM16_S
-000001e: 01 ; alignment
-000001f: 00 ; load offset
-0000020: 0a ; OPCODE_I32_CONST
-0000021: 00 ; i32 literal
-0000022: 21 ; OPCODE_I32_LOAD_MEM8_U
-0000023: 00 ; alignment
-0000024: 00 ; load offset
-0000025: 0a ; OPCODE_I32_CONST
-0000026: 00 ; i32 literal
-0000027: 23 ; OPCODE_I32_LOAD_MEM16_U
-0000028: 01 ; alignment
-0000029: 00 ; load offset
-000002a: 0a ; OPCODE_I32_CONST
-000002b: 00 ; i32 literal
-000002c: 2b ; OPCODE_I64_LOAD_MEM
-000002d: 03 ; alignment
-000002e: 00 ; load offset
-000002f: 0a ; OPCODE_I32_CONST
-0000030: 00 ; i32 literal
-0000031: 24 ; OPCODE_I64_LOAD_MEM8_S
-0000032: 00 ; alignment
-0000033: 00 ; load offset
-0000034: 0a ; OPCODE_I32_CONST
-0000035: 00 ; i32 literal
-0000036: 26 ; OPCODE_I64_LOAD_MEM16_S
-0000037: 01 ; alignment
-0000038: 00 ; load offset
-0000039: 0a ; OPCODE_I32_CONST
-000003a: 00 ; i32 literal
-000003b: 28 ; OPCODE_I64_LOAD_MEM32_S
-000003c: 02 ; alignment
-000003d: 00 ; load offset
-000003e: 0a ; OPCODE_I32_CONST
-000003f: 00 ; i32 literal
-0000040: 25 ; OPCODE_I64_LOAD_MEM8_U
-0000041: 00 ; alignment
-0000042: 00 ; load offset
-0000043: 0a ; OPCODE_I32_CONST
-0000044: 00 ; i32 literal
-0000045: 27 ; OPCODE_I64_LOAD_MEM16_U
-0000046: 01 ; alignment
-0000047: 00 ; load offset
-0000048: 0a ; OPCODE_I32_CONST
-0000049: 00 ; i32 literal
-000004a: 29 ; OPCODE_I64_LOAD_MEM32_U
-000004b: 02 ; alignment
-000004c: 00 ; load offset
-000004d: 0a ; OPCODE_I32_CONST
-000004e: 00 ; i32 literal
-000004f: 2c ; OPCODE_F32_LOAD_MEM
-0000050: 02 ; alignment
-0000051: 00 ; load offset
-0000052: 0a ; OPCODE_I32_CONST
-0000053: 00 ; i32 literal
-0000054: 2d ; OPCODE_F64_LOAD_MEM
-0000055: 03 ; alignment
-0000056: 00 ; load offset
-0000057: 0a ; OPCODE_I32_CONST
-0000058: 00 ; i32 literal
-0000011: 47 ; FIXUP func body size
-0000059: 06 ; WASM_BINARY_SECTION_END
+0000040: 00 ; func body size (guess)
+0000041: 00 ; local decl count
+0000042: 2a ; OPCODE_I32_LOAD_MEM
+0000043: 02 ; alignment
+0000044: 00 ; load offset
+0000045: 0a ; OPCODE_I32_CONST
+0000046: 00 ; i32 literal
+0000047: 20 ; OPCODE_I32_LOAD_MEM8_S
+0000048: 00 ; alignment
+0000049: 00 ; load offset
+000004a: 0a ; OPCODE_I32_CONST
+000004b: 00 ; i32 literal
+000004c: 22 ; OPCODE_I32_LOAD_MEM16_S
+000004d: 01 ; alignment
+000004e: 00 ; load offset
+000004f: 0a ; OPCODE_I32_CONST
+0000050: 00 ; i32 literal
+0000051: 21 ; OPCODE_I32_LOAD_MEM8_U
+0000052: 00 ; alignment
+0000053: 00 ; load offset
+0000054: 0a ; OPCODE_I32_CONST
+0000055: 00 ; i32 literal
+0000056: 23 ; OPCODE_I32_LOAD_MEM16_U
+0000057: 01 ; alignment
+0000058: 00 ; load offset
+0000059: 0a ; OPCODE_I32_CONST
+000005a: 00 ; i32 literal
+000005b: 2b ; OPCODE_I64_LOAD_MEM
+000005c: 03 ; alignment
+000005d: 00 ; load offset
+000005e: 0a ; OPCODE_I32_CONST
+000005f: 00 ; i32 literal
+0000060: 24 ; OPCODE_I64_LOAD_MEM8_S
+0000061: 00 ; alignment
+0000062: 00 ; load offset
+0000063: 0a ; OPCODE_I32_CONST
+0000064: 00 ; i32 literal
+0000065: 26 ; OPCODE_I64_LOAD_MEM16_S
+0000066: 01 ; alignment
+0000067: 00 ; load offset
+0000068: 0a ; OPCODE_I32_CONST
+0000069: 00 ; i32 literal
+000006a: 28 ; OPCODE_I64_LOAD_MEM32_S
+000006b: 02 ; alignment
+000006c: 00 ; load offset
+000006d: 0a ; OPCODE_I32_CONST
+000006e: 00 ; i32 literal
+000006f: 25 ; OPCODE_I64_LOAD_MEM8_U
+0000070: 00 ; alignment
+0000071: 00 ; load offset
+0000072: 0a ; OPCODE_I32_CONST
+0000073: 00 ; i32 literal
+0000074: 27 ; OPCODE_I64_LOAD_MEM16_U
+0000075: 01 ; alignment
+0000076: 00 ; load offset
+0000077: 0a ; OPCODE_I32_CONST
+0000078: 00 ; i32 literal
+0000079: 29 ; OPCODE_I64_LOAD_MEM32_U
+000007a: 02 ; alignment
+000007b: 00 ; load offset
+000007c: 0a ; OPCODE_I32_CONST
+000007d: 00 ; i32 literal
+000007e: 2c ; OPCODE_F32_LOAD_MEM
+000007f: 02 ; alignment
+0000080: 00 ; load offset
+0000081: 0a ; OPCODE_I32_CONST
+0000082: 00 ; i32 literal
+0000083: 2d ; OPCODE_F64_LOAD_MEM
+0000084: 03 ; alignment
+0000085: 00 ; load offset
+0000086: 0a ; OPCODE_I32_CONST
+0000087: 00 ; i32 literal
+0000040: 47 ; FIXUP func body size
+000002e: 59 ; FIXUP section size
+; section "end"
+0000088: 00 ; section size (guess)
+0000089: 03 ; string length
+000008a: 656e 64 ; section id: "end"
+0000088: 04 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0101 0000 0a01 000b
-0000010: 0147 002a 0200 0a00 2000 000a 0022 0100
-0000020: 0a00 2100 000a 0023 0100 0a00 2b03 000a
-0000030: 0024 0000 0a00 2601 000a 0028 0200 0a00
-0000040: 2500 000a 0027 0100 0a00 2902 000a 002c
-0000050: 0200 0a00 2d03 000a 0006
+0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
+0000010: 7572 6573 0100 0016 1366 756e 6374 696f
+0000020: 6e5f 7369 676e 6174 7572 6573 0100 590f
+0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 7301
+0000040: 4700 2a02 000a 0020 0000 0a00 2201 000a
+0000050: 0021 0000 0a00 2301 000a 002b 0300 0a00
+0000060: 2400 000a 0026 0100 0a00 2802 000a 0025
+0000070: 0000 0a00 2701 000a 0029 0200 0a00 2c02
+0000080: 000a 002d 0300 0a00 0403 656e 64
;;; STDOUT ;;)
diff --git a/test/dump/locals.txt b/test/dump/locals.txt
index aa2b1431..39804c87 100644
--- a/test/dump/locals.txt
+++ b/test/dump/locals.txt
@@ -4,30 +4,50 @@
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
0000004: 0a00 0000 ; WASM_BINARY_VERSION
-0000008: 01 ; WASM_BINARY_SECTION_SIGNATURES
-0000009: 01 ; num signatures
+; section "signatures"
+0000008: 00 ; section size (guess)
+0000009: 0a ; string length
+000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
+0000014: 01 ; num signatures
; signature 0
-000000a: 00 ; num params
-000000b: 00 ; result_type
-000000c: 0a ; WASM_BINARY_SECTION_FUNCTION_SIGNATURES
-000000d: 01 ; num functions
-000000e: 00 ; function 0 signature index
-000000f: 0b ; WASM_BINARY_SECTION_FUNCTION_BODIES
-0000010: 01 ; num functions
+0000015: 00 ; num params
+0000016: 00 ; result_type
+0000008: 0e ; FIXUP section size
+; section "function_signatures"
+0000017: 00 ; section size (guess)
+0000018: 13 ; string length
+0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
+0000029: 7265 73 ; section id: "function_signatures"
+000002c: 01 ; num functions
+000002d: 00 ; function 0 signature index
+0000017: 16 ; FIXUP section size
+; section "function_bodies"
+000002e: 00 ; section size (guess)
+000002f: 0f ; string length
+0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
+000003f: 01 ; num functions
; function body 0
-0000011: 00 ; func body size (guess)
-0000012: 04 ; local decl count
-0000013: 01 ; local i32 count
-0000014: 01 ; WASM_TYPE_I32
-0000015: 02 ; local i64 count
-0000016: 02 ; WASM_TYPE_I64
-0000017: 03 ; local f32 count
-0000018: 03 ; WASM_TYPE_F32
-0000019: 04 ; local f64 count
-000001a: 04 ; WASM_TYPE_F64
-0000011: 09 ; FIXUP func body size
-000001b: 06 ; WASM_BINARY_SECTION_END
+0000040: 00 ; func body size (guess)
+0000041: 04 ; local decl count
+0000042: 01 ; local i32 count
+0000043: 01 ; WASM_TYPE_I32
+0000044: 02 ; local i64 count
+0000045: 02 ; WASM_TYPE_I64
+0000046: 03 ; local f32 count
+0000047: 03 ; WASM_TYPE_F32
+0000048: 04 ; local f64 count
+0000049: 04 ; WASM_TYPE_F64
+0000040: 09 ; FIXUP func body size
+000002e: 1b ; FIXUP section size
+; section "end"
+000004a: 00 ; section size (guess)
+000004b: 03 ; string length
+000004c: 656e 64 ; section id: "end"
+000004a: 04 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0101 0000 0a01 000b
-0000010: 0109 0401 0102 0203 0304 0406
+0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
+0000010: 7572 6573 0100 0016 1366 756e 6374 696f
+0000020: 6e5f 7369 676e 6174 7572 6573 0100 1b0f
+0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 7301
+0000040: 0904 0101 0202 0303 0404 0403 656e 64
;;; STDOUT ;;)
diff --git a/test/dump/loop-257-exprs-br.txt b/test/dump/loop-257-exprs-br.txt
index 2185f518..b0a1b2f9 100644
--- a/test/dump/loop-257-exprs-br.txt
+++ b/test/dump/loop-257-exprs-br.txt
@@ -51,68 +51,33 @@
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
0000004: 0a00 0000 ; WASM_BINARY_VERSION
-0000008: 01 ; WASM_BINARY_SECTION_SIGNATURES
-0000009: 01 ; num signatures
+; section "signatures"
+0000008: 00 ; section size (guess)
+0000009: 0a ; string length
+000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
+0000014: 01 ; num signatures
; signature 0
-000000a: 00 ; num params
-000000b: 00 ; result_type
-000000c: 0a ; WASM_BINARY_SECTION_FUNCTION_SIGNATURES
-000000d: 01 ; num functions
-000000e: 00 ; function 0 signature index
-000000f: 0b ; WASM_BINARY_SECTION_FUNCTION_BODIES
-0000010: 01 ; num functions
+0000015: 00 ; num params
+0000016: 00 ; result_type
+0000008: 0e ; FIXUP section size
+; section "function_signatures"
+0000017: 00 ; section size (guess)
+0000018: 13 ; string length
+0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
+0000029: 7265 73 ; section id: "function_signatures"
+000002c: 01 ; num functions
+000002d: 00 ; function 0 signature index
+0000017: 16 ; FIXUP section size
+; section "function_bodies"
+000002e: 00 ; section size (guess)
+000002f: 0f ; string length
+0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
+000003f: 01 ; num functions
; function body 0
-0000011: 00 ; func body size (guess)
-0000012: 00 ; local decl count
-0000013: 02 ; OPCODE_LOOP
-0000014: 8402 ; num expressions
-0000016: 00 ; OPCODE_NOP
-0000017: 00 ; OPCODE_NOP
-0000018: 00 ; OPCODE_NOP
-0000019: 00 ; OPCODE_NOP
-000001a: 00 ; OPCODE_NOP
-000001b: 00 ; OPCODE_NOP
-000001c: 00 ; OPCODE_NOP
-000001d: 00 ; OPCODE_NOP
-000001e: 00 ; OPCODE_NOP
-000001f: 00 ; OPCODE_NOP
-0000020: 00 ; OPCODE_NOP
-0000021: 00 ; OPCODE_NOP
-0000022: 00 ; OPCODE_NOP
-0000023: 00 ; OPCODE_NOP
-0000024: 00 ; OPCODE_NOP
-0000025: 00 ; OPCODE_NOP
-0000026: 00 ; OPCODE_NOP
-0000027: 00 ; OPCODE_NOP
-0000028: 00 ; OPCODE_NOP
-0000029: 00 ; OPCODE_NOP
-000002a: 00 ; OPCODE_NOP
-000002b: 00 ; OPCODE_NOP
-000002c: 00 ; OPCODE_NOP
-000002d: 00 ; OPCODE_NOP
-000002e: 00 ; OPCODE_NOP
-000002f: 00 ; OPCODE_NOP
-0000030: 00 ; OPCODE_NOP
-0000031: 00 ; OPCODE_NOP
-0000032: 00 ; OPCODE_NOP
-0000033: 00 ; OPCODE_NOP
-0000034: 00 ; OPCODE_NOP
-0000035: 00 ; OPCODE_NOP
-0000036: 00 ; OPCODE_NOP
-0000037: 00 ; OPCODE_NOP
-0000038: 00 ; OPCODE_NOP
-0000039: 00 ; OPCODE_NOP
-000003a: 00 ; OPCODE_NOP
-000003b: 00 ; OPCODE_NOP
-000003c: 00 ; OPCODE_NOP
-000003d: 00 ; OPCODE_NOP
-000003e: 00 ; OPCODE_NOP
-000003f: 00 ; OPCODE_NOP
-0000040: 00 ; OPCODE_NOP
-0000041: 00 ; OPCODE_NOP
-0000042: 00 ; OPCODE_NOP
-0000043: 00 ; OPCODE_NOP
-0000044: 00 ; OPCODE_NOP
+0000040: 00 ; func body size (guess)
+0000041: 00 ; local decl count
+0000042: 02 ; OPCODE_LOOP
+0000043: 8402 ; num expressions
0000045: 00 ; OPCODE_NOP
0000046: 00 ; OPCODE_NOP
0000047: 00 ; OPCODE_NOP
@@ -322,27 +287,80 @@
0000113: 00 ; OPCODE_NOP
0000114: 00 ; OPCODE_NOP
0000115: 00 ; OPCODE_NOP
-0000116: 06 ; OPCODE_BR
-0000117: 01 ; break depth
+0000116: 00 ; OPCODE_NOP
+0000117: 00 ; OPCODE_NOP
0000118: 00 ; OPCODE_NOP
-0000119: 06 ; OPCODE_BR
-000011a: 00 ; break depth
+0000119: 00 ; OPCODE_NOP
+000011a: 00 ; OPCODE_NOP
000011b: 00 ; OPCODE_NOP
-000011c: 06 ; OPCODE_BR
-000011d: 01 ; break depth
+000011c: 00 ; OPCODE_NOP
+000011d: 00 ; OPCODE_NOP
000011e: 00 ; OPCODE_NOP
-000011f: 06 ; OPCODE_BR
-0000120: 00 ; break depth
+000011f: 00 ; OPCODE_NOP
+0000120: 00 ; OPCODE_NOP
0000121: 00 ; OPCODE_NOP
-; move data: [12, 122) -> [13, 123)
-0000011: 9002 ; FIXUP func body size
-0000123: 06 ; WASM_BINARY_SECTION_END
+0000122: 00 ; OPCODE_NOP
+0000123: 00 ; OPCODE_NOP
+0000124: 00 ; OPCODE_NOP
+0000125: 00 ; OPCODE_NOP
+0000126: 00 ; OPCODE_NOP
+0000127: 00 ; OPCODE_NOP
+0000128: 00 ; OPCODE_NOP
+0000129: 00 ; OPCODE_NOP
+000012a: 00 ; OPCODE_NOP
+000012b: 00 ; OPCODE_NOP
+000012c: 00 ; OPCODE_NOP
+000012d: 00 ; OPCODE_NOP
+000012e: 00 ; OPCODE_NOP
+000012f: 00 ; OPCODE_NOP
+0000130: 00 ; OPCODE_NOP
+0000131: 00 ; OPCODE_NOP
+0000132: 00 ; OPCODE_NOP
+0000133: 00 ; OPCODE_NOP
+0000134: 00 ; OPCODE_NOP
+0000135: 00 ; OPCODE_NOP
+0000136: 00 ; OPCODE_NOP
+0000137: 00 ; OPCODE_NOP
+0000138: 00 ; OPCODE_NOP
+0000139: 00 ; OPCODE_NOP
+000013a: 00 ; OPCODE_NOP
+000013b: 00 ; OPCODE_NOP
+000013c: 00 ; OPCODE_NOP
+000013d: 00 ; OPCODE_NOP
+000013e: 00 ; OPCODE_NOP
+000013f: 00 ; OPCODE_NOP
+0000140: 00 ; OPCODE_NOP
+0000141: 00 ; OPCODE_NOP
+0000142: 00 ; OPCODE_NOP
+0000143: 00 ; OPCODE_NOP
+0000144: 00 ; OPCODE_NOP
+0000145: 06 ; OPCODE_BR
+0000146: 01 ; break depth
+0000147: 00 ; OPCODE_NOP
+0000148: 06 ; OPCODE_BR
+0000149: 00 ; break depth
+000014a: 00 ; OPCODE_NOP
+000014b: 06 ; OPCODE_BR
+000014c: 01 ; break depth
+000014d: 00 ; OPCODE_NOP
+000014e: 06 ; OPCODE_BR
+000014f: 00 ; break depth
+0000150: 00 ; OPCODE_NOP
+; move data: [41, 151) -> [42, 152)
+0000040: 9002 ; FIXUP func body size
+; move data: [2f, 152) -> [30, 153)
+000002e: a302 ; FIXUP section size
+; section "end"
+0000153: 00 ; section size (guess)
+0000154: 03 ; string length
+0000155: 656e 64 ; section id: "end"
+0000153: 04 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0101 0000 0a01 000b
-0000010: 0190 0200 0284 0200 0000 0000 0000 0000
-0000020: 0000 0000 0000 0000 0000 0000 0000 0000
-0000030: 0000 0000 0000 0000 0000 0000 0000 0000
-0000040: 0000 0000 0000 0000 0000 0000 0000 0000
+0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
+0000010: 7572 6573 0100 0016 1366 756e 6374 696f
+0000020: 6e5f 7369 676e 6174 7572 6573 0100 a302
+0000030: 0f66 756e 6374 696f 6e5f 626f 6469 6573
+0000040: 0190 0200 0284 0200 0000 0000 0000 0000
0000050: 0000 0000 0000 0000 0000 0000 0000 0000
0000060: 0000 0000 0000 0000 0000 0000 0000 0000
0000070: 0000 0000 0000 0000 0000 0000 0000 0000
@@ -355,6 +373,9 @@
00000e0: 0000 0000 0000 0000 0000 0000 0000 0000
00000f0: 0000 0000 0000 0000 0000 0000 0000 0000
0000100: 0000 0000 0000 0000 0000 0000 0000 0000
-0000110: 0000 0000 0000 0006 0100 0600 0006 0100
-0000120: 0600 0006
+0000110: 0000 0000 0000 0000 0000 0000 0000 0000
+0000120: 0000 0000 0000 0000 0000 0000 0000 0000
+0000130: 0000 0000 0000 0000 0000 0000 0000 0000
+0000140: 0000 0000 0000 0006 0100 0600 0006 0100
+0000150: 0600 0004 0365 6e64
;;; STDOUT ;;)
diff --git a/test/dump/loop-257-exprs.txt b/test/dump/loop-257-exprs.txt
index 08405ca1..87dbdb3f 100644
--- a/test/dump/loop-257-exprs.txt
+++ b/test/dump/loop-257-exprs.txt
@@ -47,68 +47,33 @@
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
0000004: 0a00 0000 ; WASM_BINARY_VERSION
-0000008: 01 ; WASM_BINARY_SECTION_SIGNATURES
-0000009: 01 ; num signatures
+; section "signatures"
+0000008: 00 ; section size (guess)
+0000009: 0a ; string length
+000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
+0000014: 01 ; num signatures
; signature 0
-000000a: 00 ; num params
-000000b: 00 ; result_type
-000000c: 0a ; WASM_BINARY_SECTION_FUNCTION_SIGNATURES
-000000d: 01 ; num functions
-000000e: 00 ; function 0 signature index
-000000f: 0b ; WASM_BINARY_SECTION_FUNCTION_BODIES
-0000010: 01 ; num functions
+0000015: 00 ; num params
+0000016: 00 ; result_type
+0000008: 0e ; FIXUP section size
+; section "function_signatures"
+0000017: 00 ; section size (guess)
+0000018: 13 ; string length
+0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
+0000029: 7265 73 ; section id: "function_signatures"
+000002c: 01 ; num functions
+000002d: 00 ; function 0 signature index
+0000017: 16 ; FIXUP section size
+; section "function_bodies"
+000002e: 00 ; section size (guess)
+000002f: 0f ; string length
+0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
+000003f: 01 ; num functions
; function body 0
-0000011: 00 ; func body size (guess)
-0000012: 00 ; local decl count
-0000013: 02 ; OPCODE_LOOP
-0000014: 8102 ; num expressions
-0000016: 00 ; OPCODE_NOP
-0000017: 00 ; OPCODE_NOP
-0000018: 00 ; OPCODE_NOP
-0000019: 00 ; OPCODE_NOP
-000001a: 00 ; OPCODE_NOP
-000001b: 00 ; OPCODE_NOP
-000001c: 00 ; OPCODE_NOP
-000001d: 00 ; OPCODE_NOP
-000001e: 00 ; OPCODE_NOP
-000001f: 00 ; OPCODE_NOP
-0000020: 00 ; OPCODE_NOP
-0000021: 00 ; OPCODE_NOP
-0000022: 00 ; OPCODE_NOP
-0000023: 00 ; OPCODE_NOP
-0000024: 00 ; OPCODE_NOP
-0000025: 00 ; OPCODE_NOP
-0000026: 00 ; OPCODE_NOP
-0000027: 00 ; OPCODE_NOP
-0000028: 00 ; OPCODE_NOP
-0000029: 00 ; OPCODE_NOP
-000002a: 00 ; OPCODE_NOP
-000002b: 00 ; OPCODE_NOP
-000002c: 00 ; OPCODE_NOP
-000002d: 00 ; OPCODE_NOP
-000002e: 00 ; OPCODE_NOP
-000002f: 00 ; OPCODE_NOP
-0000030: 00 ; OPCODE_NOP
-0000031: 00 ; OPCODE_NOP
-0000032: 00 ; OPCODE_NOP
-0000033: 00 ; OPCODE_NOP
-0000034: 00 ; OPCODE_NOP
-0000035: 00 ; OPCODE_NOP
-0000036: 00 ; OPCODE_NOP
-0000037: 00 ; OPCODE_NOP
-0000038: 00 ; OPCODE_NOP
-0000039: 00 ; OPCODE_NOP
-000003a: 00 ; OPCODE_NOP
-000003b: 00 ; OPCODE_NOP
-000003c: 00 ; OPCODE_NOP
-000003d: 00 ; OPCODE_NOP
-000003e: 00 ; OPCODE_NOP
-000003f: 00 ; OPCODE_NOP
-0000040: 00 ; OPCODE_NOP
-0000041: 00 ; OPCODE_NOP
-0000042: 00 ; OPCODE_NOP
-0000043: 00 ; OPCODE_NOP
-0000044: 00 ; OPCODE_NOP
+0000040: 00 ; func body size (guess)
+0000041: 00 ; local decl count
+0000042: 02 ; OPCODE_LOOP
+0000043: 8102 ; num expressions
0000045: 00 ; OPCODE_NOP
0000046: 00 ; OPCODE_NOP
0000047: 00 ; OPCODE_NOP
@@ -319,15 +284,68 @@
0000114: 00 ; OPCODE_NOP
0000115: 00 ; OPCODE_NOP
0000116: 00 ; OPCODE_NOP
-; move data: [12, 117) -> [13, 118)
-0000011: 8502 ; FIXUP func body size
-0000118: 06 ; WASM_BINARY_SECTION_END
+0000117: 00 ; OPCODE_NOP
+0000118: 00 ; OPCODE_NOP
+0000119: 00 ; OPCODE_NOP
+000011a: 00 ; OPCODE_NOP
+000011b: 00 ; OPCODE_NOP
+000011c: 00 ; OPCODE_NOP
+000011d: 00 ; OPCODE_NOP
+000011e: 00 ; OPCODE_NOP
+000011f: 00 ; OPCODE_NOP
+0000120: 00 ; OPCODE_NOP
+0000121: 00 ; OPCODE_NOP
+0000122: 00 ; OPCODE_NOP
+0000123: 00 ; OPCODE_NOP
+0000124: 00 ; OPCODE_NOP
+0000125: 00 ; OPCODE_NOP
+0000126: 00 ; OPCODE_NOP
+0000127: 00 ; OPCODE_NOP
+0000128: 00 ; OPCODE_NOP
+0000129: 00 ; OPCODE_NOP
+000012a: 00 ; OPCODE_NOP
+000012b: 00 ; OPCODE_NOP
+000012c: 00 ; OPCODE_NOP
+000012d: 00 ; OPCODE_NOP
+000012e: 00 ; OPCODE_NOP
+000012f: 00 ; OPCODE_NOP
+0000130: 00 ; OPCODE_NOP
+0000131: 00 ; OPCODE_NOP
+0000132: 00 ; OPCODE_NOP
+0000133: 00 ; OPCODE_NOP
+0000134: 00 ; OPCODE_NOP
+0000135: 00 ; OPCODE_NOP
+0000136: 00 ; OPCODE_NOP
+0000137: 00 ; OPCODE_NOP
+0000138: 00 ; OPCODE_NOP
+0000139: 00 ; OPCODE_NOP
+000013a: 00 ; OPCODE_NOP
+000013b: 00 ; OPCODE_NOP
+000013c: 00 ; OPCODE_NOP
+000013d: 00 ; OPCODE_NOP
+000013e: 00 ; OPCODE_NOP
+000013f: 00 ; OPCODE_NOP
+0000140: 00 ; OPCODE_NOP
+0000141: 00 ; OPCODE_NOP
+0000142: 00 ; OPCODE_NOP
+0000143: 00 ; OPCODE_NOP
+0000144: 00 ; OPCODE_NOP
+0000145: 00 ; OPCODE_NOP
+; move data: [41, 146) -> [42, 147)
+0000040: 8502 ; FIXUP func body size
+; move data: [2f, 147) -> [30, 148)
+000002e: 9802 ; FIXUP section size
+; section "end"
+0000148: 00 ; section size (guess)
+0000149: 03 ; string length
+000014a: 656e 64 ; section id: "end"
+0000148: 04 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0101 0000 0a01 000b
-0000010: 0185 0200 0281 0200 0000 0000 0000 0000
-0000020: 0000 0000 0000 0000 0000 0000 0000 0000
-0000030: 0000 0000 0000 0000 0000 0000 0000 0000
-0000040: 0000 0000 0000 0000 0000 0000 0000 0000
+0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
+0000010: 7572 6573 0100 0016 1366 756e 6374 696f
+0000020: 6e5f 7369 676e 6174 7572 6573 0100 9802
+0000030: 0f66 756e 6374 696f 6e5f 626f 6469 6573
+0000040: 0185 0200 0281 0200 0000 0000 0000 0000
0000050: 0000 0000 0000 0000 0000 0000 0000 0000
0000060: 0000 0000 0000 0000 0000 0000 0000 0000
0000070: 0000 0000 0000 0000 0000 0000 0000 0000
@@ -340,5 +358,8 @@
00000e0: 0000 0000 0000 0000 0000 0000 0000 0000
00000f0: 0000 0000 0000 0000 0000 0000 0000 0000
0000100: 0000 0000 0000 0000 0000 0000 0000 0000
-0000110: 0000 0000 0000 0000 06
+0000110: 0000 0000 0000 0000 0000 0000 0000 0000
+0000120: 0000 0000 0000 0000 0000 0000 0000 0000
+0000130: 0000 0000 0000 0000 0000 0000 0000 0000
+0000140: 0000 0000 0000 0000 0403 656e 64
;;; STDOUT ;;)
diff --git a/test/dump/loop.txt b/test/dump/loop.txt
index 7401f9c3..e3c7533a 100644
--- a/test/dump/loop.txt
+++ b/test/dump/loop.txt
@@ -7,26 +7,46 @@
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
0000004: 0a00 0000 ; WASM_BINARY_VERSION
-0000008: 01 ; WASM_BINARY_SECTION_SIGNATURES
-0000009: 01 ; num signatures
+; section "signatures"
+0000008: 00 ; section size (guess)
+0000009: 0a ; string length
+000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
+0000014: 01 ; num signatures
; signature 0
-000000a: 00 ; num params
-000000b: 00 ; result_type
-000000c: 0a ; WASM_BINARY_SECTION_FUNCTION_SIGNATURES
-000000d: 01 ; num functions
-000000e: 00 ; function 0 signature index
-000000f: 0b ; WASM_BINARY_SECTION_FUNCTION_BODIES
-0000010: 01 ; num functions
+0000015: 00 ; num params
+0000016: 00 ; result_type
+0000008: 0e ; FIXUP section size
+; section "function_signatures"
+0000017: 00 ; section size (guess)
+0000018: 13 ; string length
+0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
+0000029: 7265 73 ; section id: "function_signatures"
+000002c: 01 ; num functions
+000002d: 00 ; function 0 signature index
+0000017: 16 ; FIXUP section size
+; section "function_bodies"
+000002e: 00 ; section size (guess)
+000002f: 0f ; string length
+0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
+000003f: 01 ; num functions
; function body 0
-0000011: 00 ; func body size (guess)
-0000012: 00 ; local decl count
-0000013: 02 ; OPCODE_LOOP
-0000014: 02 ; num expressions
-0000015: 00 ; OPCODE_NOP
-0000016: 00 ; OPCODE_NOP
-0000011: 05 ; FIXUP func body size
-0000017: 06 ; WASM_BINARY_SECTION_END
+0000040: 00 ; func body size (guess)
+0000041: 00 ; local decl count
+0000042: 02 ; OPCODE_LOOP
+0000043: 02 ; num expressions
+0000044: 00 ; OPCODE_NOP
+0000045: 00 ; OPCODE_NOP
+0000040: 05 ; FIXUP func body size
+000002e: 17 ; FIXUP section size
+; section "end"
+0000046: 00 ; section size (guess)
+0000047: 03 ; string length
+0000048: 656e 64 ; section id: "end"
+0000046: 04 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0101 0000 0a01 000b
-0000010: 0105 0002 0200 0006
+0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
+0000010: 7572 6573 0100 0016 1366 756e 6374 696f
+0000020: 6e5f 7369 676e 6174 7572 6573 0100 170f
+0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 7301
+0000040: 0500 0202 0000 0403 656e 64
;;; STDOUT ;;)
diff --git a/test/dump/memory-1-byte.txt b/test/dump/memory-1-byte.txt
index 8c1c6ddb..e0ea1a49 100644
--- a/test/dump/memory-1-byte.txt
+++ b/test/dump/memory-1-byte.txt
@@ -3,11 +3,20 @@
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
0000004: 0a00 0000 ; WASM_BINARY_VERSION
-0000008: 00 ; WASM_BINARY_SECTION_MEMORY
-0000009: 01 ; min mem pages
-000000a: 01 ; max mem pages
-000000b: 00 ; export mem
-000000c: 06 ; WASM_BINARY_SECTION_END
+; section "memory"
+0000008: 00 ; section size (guess)
+0000009: 06 ; string length
+000000a: 6d65 6d6f 7279 ; section id: "memory"
+0000010: 01 ; min mem pages
+0000011: 01 ; max mem pages
+0000012: 00 ; export mem
+0000008: 0a ; FIXUP section size
+; section "end"
+0000013: 00 ; section size (guess)
+0000014: 03 ; string length
+0000015: 656e 64 ; section id: "end"
+0000013: 04 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0001 0100 06
+0000000: 0061 736d 0a00 0000 0a06 6d65 6d6f 7279
+0000010: 0101 0004 0365 6e64
;;; STDOUT ;;)
diff --git a/test/dump/memory-data-size.txt b/test/dump/memory-data-size.txt
index 97b3d20a..e9bd19e7 100644
--- a/test/dump/memory-data-size.txt
+++ b/test/dump/memory-data-size.txt
@@ -6,30 +6,62 @@
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
0000004: 0a00 0000 ; WASM_BINARY_VERSION
-0000008: 00 ; WASM_BINARY_SECTION_MEMORY
-0000009: 01 ; min mem pages
-000000a: 01 ; max mem pages
-000000b: 00 ; export mem
-000000c: 06 ; WASM_BINARY_SECTION_END
+; section "memory"
+0000008: 00 ; section size (guess)
+0000009: 06 ; string length
+000000a: 6d65 6d6f 7279 ; section id: "memory"
+0000010: 01 ; min mem pages
+0000011: 01 ; max mem pages
+0000012: 00 ; export mem
+0000008: 0a ; FIXUP section size
+; section "end"
+0000013: 00 ; section size (guess)
+0000014: 03 ; string length
+0000015: 656e 64 ; section id: "end"
+0000013: 04 ; FIXUP section size
0000000: 0061 736d ; WASM_BINARY_MAGIC
0000004: 0a00 0000 ; WASM_BINARY_VERSION
-0000008: 00 ; WASM_BINARY_SECTION_MEMORY
-0000009: 02 ; min mem pages
-000000a: 02 ; max mem pages
-000000b: 00 ; export mem
-000000c: 06 ; WASM_BINARY_SECTION_END
+; section "memory"
+0000008: 00 ; section size (guess)
+0000009: 06 ; string length
+000000a: 6d65 6d6f 7279 ; section id: "memory"
+0000010: 02 ; min mem pages
+0000011: 02 ; max mem pages
+0000012: 00 ; export mem
+0000008: 0a ; FIXUP section size
+; section "end"
+0000013: 00 ; section size (guess)
+0000014: 03 ; string length
+0000015: 656e 64 ; section id: "end"
+0000013: 04 ; FIXUP section size
0000000: 0061 736d ; WASM_BINARY_MAGIC
0000004: 0a00 0000 ; WASM_BINARY_VERSION
-0000008: 00 ; WASM_BINARY_SECTION_MEMORY
-0000009: 04 ; min mem pages
-000000a: 04 ; max mem pages
-000000b: 00 ; export mem
-000000c: 06 ; WASM_BINARY_SECTION_END
+; section "memory"
+0000008: 00 ; section size (guess)
+0000009: 06 ; string length
+000000a: 6d65 6d6f 7279 ; section id: "memory"
+0000010: 04 ; min mem pages
+0000011: 04 ; max mem pages
+0000012: 00 ; export mem
+0000008: 0a ; FIXUP section size
+; section "end"
+0000013: 00 ; section size (guess)
+0000014: 03 ; string length
+0000015: 656e 64 ; section id: "end"
+0000013: 04 ; FIXUP section size
0000000: 0061 736d ; WASM_BINARY_MAGIC
0000004: 0a00 0000 ; WASM_BINARY_VERSION
-0000008: 00 ; WASM_BINARY_SECTION_MEMORY
-0000009: 05 ; min mem pages
-000000a: 05 ; max mem pages
-000000b: 00 ; export mem
-000000c: 06 ; WASM_BINARY_SECTION_END
+; section "memory"
+0000008: 00 ; section size (guess)
+0000009: 06 ; string length
+000000a: 6d65 6d6f 7279 ; section id: "memory"
+0000010: 05 ; min mem pages
+0000011: 05 ; max mem pages
+0000012: 00 ; export mem
+0000008: 0a ; FIXUP section size
+; section "end"
+0000013: 00 ; section size (guess)
+0000014: 03 ; string length
+0000015: 656e 64 ; section id: "end"
+0000013: 04 ; FIXUP section size
;;; STDOUT ;;)
diff --git a/test/dump/memory-hex.txt b/test/dump/memory-hex.txt
index 26b014b6..0ce67cc3 100644
--- a/test/dump/memory-hex.txt
+++ b/test/dump/memory-hex.txt
@@ -5,19 +5,33 @@
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
0000004: 0a00 0000 ; WASM_BINARY_VERSION
-0000008: 00 ; WASM_BINARY_SECTION_MEMORY
-0000009: 01 ; min mem pages
-000000a: 01 ; max mem pages
-000000b: 00 ; export mem
-000000c: 04 ; WASM_BINARY_SECTION_DATA_SEGMENTS
-000000d: 01 ; num data segments
+; section "memory"
+0000008: 00 ; section size (guess)
+0000009: 06 ; string length
+000000a: 6d65 6d6f 7279 ; section id: "memory"
+0000010: 01 ; min mem pages
+0000011: 01 ; max mem pages
+0000012: 00 ; export mem
+0000008: 0a ; FIXUP section size
+; section "data_segments"
+0000013: 00 ; section size (guess)
+0000014: 0d ; string length
+0000015: 6461 7461 5f73 6567 6d65 6e74 73 ; section id: "data_segments"
+0000022: 01 ; num data segments
; segment header 0
-000000e: 00 ; segment address
-000000f: 0b ; segment size
+0000023: 00 ; segment address
+0000024: 0b ; segment size
; segment data 0
-0000010: 0001 0203 0405 0607 0809 0a ; segment data
-000001b: 06 ; WASM_BINARY_SECTION_END
+0000025: 0001 0203 0405 0607 0809 0a ; segment data
+0000013: 1c ; FIXUP section size
+; section "end"
+0000030: 00 ; section size (guess)
+0000031: 03 ; string length
+0000032: 656e 64 ; section id: "end"
+0000030: 04 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0001 0100 0401 000b
-0000010: 0001 0203 0405 0607 0809 0a06
+0000000: 0061 736d 0a00 0000 0a06 6d65 6d6f 7279
+0000010: 0101 001c 0d64 6174 615f 7365 676d 656e
+0000020: 7473 0100 0b00 0102 0304 0506 0708 090a
+0000030: 0403 656e 64
;;; STDOUT ;;)
diff --git a/test/dump/memory-size.txt b/test/dump/memory-size.txt
index 75952b51..21228a9f 100644
--- a/test/dump/memory-size.txt
+++ b/test/dump/memory-size.txt
@@ -6,27 +6,52 @@
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
0000004: 0a00 0000 ; WASM_BINARY_VERSION
-0000008: 00 ; WASM_BINARY_SECTION_MEMORY
-0000009: 01 ; min mem pages
-000000a: 01 ; max mem pages
-000000b: 00 ; export mem
-000000c: 01 ; WASM_BINARY_SECTION_SIGNATURES
-000000d: 01 ; num signatures
+; section "memory"
+0000008: 00 ; section size (guess)
+0000009: 06 ; string length
+000000a: 6d65 6d6f 7279 ; section id: "memory"
+0000010: 01 ; min mem pages
+0000011: 01 ; max mem pages
+0000012: 00 ; export mem
+0000008: 0a ; FIXUP section size
+; section "signatures"
+0000013: 00 ; section size (guess)
+0000014: 0a ; string length
+0000015: 7369 676e 6174 7572 6573 ; section id: "signatures"
+000001f: 01 ; num signatures
; signature 0
-000000e: 00 ; num params
-000000f: 01 ; result_type
-0000010: 0a ; WASM_BINARY_SECTION_FUNCTION_SIGNATURES
-0000011: 01 ; num functions
-0000012: 00 ; function 0 signature index
-0000013: 0b ; WASM_BINARY_SECTION_FUNCTION_BODIES
-0000014: 01 ; num functions
+0000020: 00 ; num params
+0000021: 01 ; result_type
+0000013: 0e ; FIXUP section size
+; section "function_signatures"
+0000022: 00 ; section size (guess)
+0000023: 13 ; string length
+0000024: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
+0000034: 7265 73 ; section id: "function_signatures"
+0000037: 01 ; num functions
+0000038: 00 ; function 0 signature index
+0000022: 16 ; FIXUP section size
+; section "function_bodies"
+0000039: 00 ; section size (guess)
+000003a: 0f ; string length
+000003b: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
+000004a: 01 ; num functions
; function body 0
-0000015: 00 ; func body size (guess)
-0000016: 00 ; local decl count
-0000017: 3b ; OPCODE_MEMORY_SIZE
-0000015: 02 ; FIXUP func body size
-0000018: 06 ; WASM_BINARY_SECTION_END
+000004b: 00 ; func body size (guess)
+000004c: 00 ; local decl count
+000004d: 3b ; OPCODE_MEMORY_SIZE
+000004b: 02 ; FIXUP func body size
+0000039: 14 ; FIXUP section size
+; section "end"
+000004e: 00 ; section size (guess)
+000004f: 03 ; string length
+0000050: 656e 64 ; section id: "end"
+000004e: 04 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0001 0100 0101 0001
-0000010: 0a01 000b 0102 003b 06
+0000000: 0061 736d 0a00 0000 0a06 6d65 6d6f 7279
+0000010: 0101 000e 0a73 6967 6e61 7475 7265 7301
+0000020: 0001 1613 6675 6e63 7469 6f6e 5f73 6967
+0000030: 6e61 7475 7265 7301 0014 0f66 756e 6374
+0000040: 696f 6e5f 626f 6469 6573 0102 003b 0403
+0000050: 656e 64
;;; STDOUT ;;)
diff --git a/test/dump/memory.txt b/test/dump/memory.txt
index 81a4091a..a8c2f77c 100644
--- a/test/dump/memory.txt
+++ b/test/dump/memory.txt
@@ -4,24 +4,38 @@
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
0000004: 0a00 0000 ; WASM_BINARY_VERSION
-0000008: 00 ; WASM_BINARY_SECTION_MEMORY
-0000009: 01 ; min mem pages
-000000a: 01 ; max mem pages
-000000b: 00 ; export mem
-000000c: 04 ; WASM_BINARY_SECTION_DATA_SEGMENTS
-000000d: 02 ; num data segments
+; section "memory"
+0000008: 00 ; section size (guess)
+0000009: 06 ; string length
+000000a: 6d65 6d6f 7279 ; section id: "memory"
+0000010: 01 ; min mem pages
+0000011: 01 ; max mem pages
+0000012: 00 ; export mem
+0000008: 0a ; FIXUP section size
+; section "data_segments"
+0000013: 00 ; section size (guess)
+0000014: 0d ; string length
+0000015: 6461 7461 5f73 6567 6d65 6e74 73 ; section id: "data_segments"
+0000022: 02 ; num data segments
; segment header 0
-000000e: 0a ; segment address
-000000f: 05 ; segment size
+0000023: 0a ; segment address
+0000024: 05 ; segment size
; segment data 0
-0000010: 6865 6c6c 6f ; segment data
+0000025: 6865 6c6c 6f ; segment data
; segment header 1
-0000015: 14 ; segment address
-0000016: 07 ; segment size
+000002a: 14 ; segment address
+000002b: 07 ; segment size
; segment data 1
-0000017: 676f 6f64 6279 65 ; segment data
-000001e: 06 ; WASM_BINARY_SECTION_END
+000002c: 676f 6f64 6279 65 ; segment data
+0000013: 1f ; FIXUP section size
+; section "end"
+0000033: 00 ; section size (guess)
+0000034: 03 ; string length
+0000035: 656e 64 ; section id: "end"
+0000033: 04 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0001 0100 0402 0a05
-0000010: 6865 6c6c 6f14 0767 6f6f 6462 7965 06
+0000000: 0061 736d 0a00 0000 0a06 6d65 6d6f 7279
+0000010: 0101 001f 0d64 6174 615f 7365 676d 656e
+0000020: 7473 020a 0568 656c 6c6f 1407 676f 6f64
+0000030: 6279 6504 0365 6e64
;;; STDOUT ;;)
diff --git a/test/dump/nop.txt b/test/dump/nop.txt
index 9b03d8ef..d4723a30 100644
--- a/test/dump/nop.txt
+++ b/test/dump/nop.txt
@@ -4,23 +4,43 @@
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
0000004: 0a00 0000 ; WASM_BINARY_VERSION
-0000008: 01 ; WASM_BINARY_SECTION_SIGNATURES
-0000009: 01 ; num signatures
+; section "signatures"
+0000008: 00 ; section size (guess)
+0000009: 0a ; string length
+000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
+0000014: 01 ; num signatures
; signature 0
-000000a: 00 ; num params
-000000b: 00 ; result_type
-000000c: 0a ; WASM_BINARY_SECTION_FUNCTION_SIGNATURES
-000000d: 01 ; num functions
-000000e: 00 ; function 0 signature index
-000000f: 0b ; WASM_BINARY_SECTION_FUNCTION_BODIES
-0000010: 01 ; num functions
+0000015: 00 ; num params
+0000016: 00 ; result_type
+0000008: 0e ; FIXUP section size
+; section "function_signatures"
+0000017: 00 ; section size (guess)
+0000018: 13 ; string length
+0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
+0000029: 7265 73 ; section id: "function_signatures"
+000002c: 01 ; num functions
+000002d: 00 ; function 0 signature index
+0000017: 16 ; FIXUP section size
+; section "function_bodies"
+000002e: 00 ; section size (guess)
+000002f: 0f ; string length
+0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
+000003f: 01 ; num functions
; function body 0
-0000011: 00 ; func body size (guess)
-0000012: 00 ; local decl count
-0000013: 00 ; OPCODE_NOP
-0000011: 02 ; FIXUP func body size
-0000014: 06 ; WASM_BINARY_SECTION_END
+0000040: 00 ; func body size (guess)
+0000041: 00 ; local decl count
+0000042: 00 ; OPCODE_NOP
+0000040: 02 ; FIXUP func body size
+000002e: 14 ; FIXUP section size
+; section "end"
+0000043: 00 ; section size (guess)
+0000044: 03 ; string length
+0000045: 656e 64 ; section id: "end"
+0000043: 04 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0101 0000 0a01 000b
-0000010: 0102 0000 06
+0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
+0000010: 7572 6573 0100 0016 1366 756e 6374 696f
+0000020: 6e5f 7369 676e 6174 7572 6573 0100 140f
+0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 7301
+0000040: 0200 0004 0365 6e64
;;; STDOUT ;;)
diff --git a/test/dump/param-multi.txt b/test/dump/param-multi.txt
index 92b9a7bd..65fc50f9 100644
--- a/test/dump/param-multi.txt
+++ b/test/dump/param-multi.txt
@@ -4,26 +4,46 @@
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
0000004: 0a00 0000 ; WASM_BINARY_VERSION
-0000008: 01 ; WASM_BINARY_SECTION_SIGNATURES
-0000009: 01 ; num signatures
+; section "signatures"
+0000008: 00 ; section size (guess)
+0000009: 0a ; string length
+000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
+0000014: 01 ; num signatures
; signature 0
-000000a: 04 ; num params
-000000b: 00 ; result_type
-000000c: 01 ; param type
-000000d: 02 ; param type
-000000e: 03 ; param type
-000000f: 04 ; param type
-0000010: 0a ; WASM_BINARY_SECTION_FUNCTION_SIGNATURES
-0000011: 01 ; num functions
-0000012: 00 ; function 0 signature index
-0000013: 0b ; WASM_BINARY_SECTION_FUNCTION_BODIES
-0000014: 01 ; num functions
+0000015: 04 ; num params
+0000016: 00 ; result_type
+0000017: 01 ; param type
+0000018: 02 ; param type
+0000019: 03 ; param type
+000001a: 04 ; param type
+0000008: 12 ; FIXUP section size
+; section "function_signatures"
+000001b: 00 ; section size (guess)
+000001c: 13 ; string length
+000001d: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
+000002d: 7265 73 ; section id: "function_signatures"
+0000030: 01 ; num functions
+0000031: 00 ; function 0 signature index
+000001b: 16 ; FIXUP section size
+; section "function_bodies"
+0000032: 00 ; section size (guess)
+0000033: 0f ; string length
+0000034: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
+0000043: 01 ; num functions
; function body 0
-0000015: 00 ; func body size (guess)
-0000016: 00 ; local decl count
-0000015: 01 ; FIXUP func body size
-0000017: 06 ; WASM_BINARY_SECTION_END
+0000044: 00 ; func body size (guess)
+0000045: 00 ; local decl count
+0000044: 01 ; FIXUP func body size
+0000032: 13 ; FIXUP section size
+; section "end"
+0000046: 00 ; section size (guess)
+0000047: 03 ; string length
+0000048: 656e 64 ; section id: "end"
+0000046: 04 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0101 0400 0102 0304
-0000010: 0a01 000b 0101 0006
+0000000: 0061 736d 0a00 0000 120a 7369 676e 6174
+0000010: 7572 6573 0104 0001 0203 0416 1366 756e
+0000020: 6374 696f 6e5f 7369 676e 6174 7572 6573
+0000030: 0100 130f 6675 6e63 7469 6f6e 5f62 6f64
+0000040: 6965 7301 0100 0403 656e 64
;;; STDOUT ;;)
diff --git a/test/dump/result.txt b/test/dump/result.txt
index bb231f9e..7bd39445 100644
--- a/test/dump/result.txt
+++ b/test/dump/result.txt
@@ -7,56 +7,76 @@
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
0000004: 0a00 0000 ; WASM_BINARY_VERSION
-0000008: 01 ; WASM_BINARY_SECTION_SIGNATURES
-0000009: 04 ; num signatures
+; section "signatures"
+0000008: 00 ; section size (guess)
+0000009: 0a ; string length
+000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
+0000014: 04 ; num signatures
; signature 0
-000000a: 00 ; num params
-000000b: 01 ; result_type
+0000015: 00 ; num params
+0000016: 01 ; result_type
; signature 1
-000000c: 00 ; num params
-000000d: 02 ; result_type
+0000017: 00 ; num params
+0000018: 02 ; result_type
; signature 2
-000000e: 00 ; num params
-000000f: 03 ; result_type
+0000019: 00 ; num params
+000001a: 03 ; result_type
; signature 3
-0000010: 00 ; num params
-0000011: 04 ; result_type
-0000012: 0a ; WASM_BINARY_SECTION_FUNCTION_SIGNATURES
-0000013: 04 ; num functions
-0000014: 00 ; function 0 signature index
-0000015: 01 ; function 1 signature index
-0000016: 02 ; function 2 signature index
-0000017: 03 ; function 3 signature index
-0000018: 0b ; WASM_BINARY_SECTION_FUNCTION_BODIES
-0000019: 04 ; num functions
+000001b: 00 ; num params
+000001c: 04 ; result_type
+0000008: 14 ; FIXUP section size
+; section "function_signatures"
+000001d: 00 ; section size (guess)
+000001e: 13 ; string length
+000001f: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
+000002f: 7265 73 ; section id: "function_signatures"
+0000032: 04 ; num functions
+0000033: 00 ; function 0 signature index
+0000034: 01 ; function 1 signature index
+0000035: 02 ; function 2 signature index
+0000036: 03 ; function 3 signature index
+000001d: 19 ; FIXUP section size
+; section "function_bodies"
+0000037: 00 ; section size (guess)
+0000038: 0f ; string length
+0000039: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
+0000048: 04 ; num functions
; function body 0
-000001a: 00 ; func body size (guess)
-000001b: 00 ; local decl count
-000001c: 0a ; OPCODE_I32_CONST
-000001d: 00 ; i32 literal
-000001a: 03 ; FIXUP func body size
+0000049: 00 ; func body size (guess)
+000004a: 00 ; local decl count
+000004b: 0a ; OPCODE_I32_CONST
+000004c: 00 ; i32 literal
+0000049: 03 ; FIXUP func body size
; function body 1
-000001e: 00 ; func body size (guess)
-000001f: 00 ; local decl count
-0000020: 0b ; OPCODE_I64_CONST
-0000021: 00 ; i64 literal
-000001e: 03 ; FIXUP func body size
+000004d: 00 ; func body size (guess)
+000004e: 00 ; local decl count
+000004f: 0b ; OPCODE_I64_CONST
+0000050: 00 ; i64 literal
+000004d: 03 ; FIXUP func body size
; function body 2
-0000022: 00 ; func body size (guess)
-0000023: 00 ; local decl count
-0000024: 0d ; OPCODE_F32_CONST
-0000025: 0000 0000 ; f32 literal
-0000022: 06 ; FIXUP func body size
+0000051: 00 ; func body size (guess)
+0000052: 00 ; local decl count
+0000053: 0d ; OPCODE_F32_CONST
+0000054: 0000 0000 ; f32 literal
+0000051: 06 ; FIXUP func body size
; function body 3
-0000029: 00 ; func body size (guess)
-000002a: 00 ; local decl count
-000002b: 0c ; OPCODE_F64_CONST
-000002c: 0000 0000 0000 0000 ; f64 literal
-0000029: 0a ; FIXUP func body size
-0000034: 06 ; WASM_BINARY_SECTION_END
+0000058: 00 ; func body size (guess)
+0000059: 00 ; local decl count
+000005a: 0c ; OPCODE_F64_CONST
+000005b: 0000 0000 0000 0000 ; f64 literal
+0000058: 0a ; FIXUP func body size
+0000037: 2b ; FIXUP section size
+; section "end"
+0000063: 00 ; section size (guess)
+0000064: 03 ; string length
+0000065: 656e 64 ; section id: "end"
+0000063: 04 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0104 0001 0002 0003
-0000010: 0004 0a04 0001 0203 0b04 0300 0a00 0300
-0000020: 0b00 0600 0d00 0000 000a 000c 0000 0000
-0000030: 0000 0000 06
+0000000: 0061 736d 0a00 0000 140a 7369 676e 6174
+0000010: 7572 6573 0400 0100 0200 0300 0419 1366
+0000020: 756e 6374 696f 6e5f 7369 676e 6174 7572
+0000030: 6573 0400 0102 032b 0f66 756e 6374 696f
+0000040: 6e5f 626f 6469 6573 0403 000a 0003 000b
+0000050: 0006 000d 0000 0000 0a00 0c00 0000 0000
+0000060: 0000 0004 0365 6e64
;;; STDOUT ;;)
diff --git a/test/dump/return.txt b/test/dump/return.txt
index 8b70a411..7df10ce0 100644
--- a/test/dump/return.txt
+++ b/test/dump/return.txt
@@ -6,34 +6,54 @@
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
0000004: 0a00 0000 ; WASM_BINARY_VERSION
-0000008: 01 ; WASM_BINARY_SECTION_SIGNATURES
-0000009: 02 ; num signatures
+; section "signatures"
+0000008: 00 ; section size (guess)
+0000009: 0a ; string length
+000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
+0000014: 02 ; num signatures
; signature 0
-000000a: 00 ; num params
-000000b: 01 ; result_type
+0000015: 00 ; num params
+0000016: 01 ; result_type
; signature 1
-000000c: 00 ; num params
-000000d: 00 ; result_type
-000000e: 0a ; WASM_BINARY_SECTION_FUNCTION_SIGNATURES
-000000f: 02 ; num functions
-0000010: 00 ; function 0 signature index
-0000011: 01 ; function 1 signature index
-0000012: 0b ; WASM_BINARY_SECTION_FUNCTION_BODIES
-0000013: 02 ; num functions
+0000017: 00 ; num params
+0000018: 00 ; result_type
+0000008: 10 ; FIXUP section size
+; section "function_signatures"
+0000019: 00 ; section size (guess)
+000001a: 13 ; string length
+000001b: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
+000002b: 7265 73 ; section id: "function_signatures"
+000002e: 02 ; num functions
+000002f: 00 ; function 0 signature index
+0000030: 01 ; function 1 signature index
+0000019: 17 ; FIXUP section size
+; section "function_bodies"
+0000031: 00 ; section size (guess)
+0000032: 0f ; string length
+0000033: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
+0000042: 02 ; num functions
; function body 0
-0000014: 00 ; func body size (guess)
-0000015: 00 ; local decl count
-0000016: 14 ; OPCODE_RETURN
-0000017: 0a ; OPCODE_I32_CONST
-0000018: 2a ; i32 literal
-0000014: 04 ; FIXUP func body size
+0000043: 00 ; func body size (guess)
+0000044: 00 ; local decl count
+0000045: 14 ; OPCODE_RETURN
+0000046: 0a ; OPCODE_I32_CONST
+0000047: 2a ; i32 literal
+0000043: 04 ; FIXUP func body size
; function body 1
-0000019: 00 ; func body size (guess)
-000001a: 00 ; local decl count
-000001b: 14 ; OPCODE_RETURN
-0000019: 02 ; FIXUP func body size
-000001c: 06 ; WASM_BINARY_SECTION_END
+0000048: 00 ; func body size (guess)
+0000049: 00 ; local decl count
+000004a: 14 ; OPCODE_RETURN
+0000048: 02 ; FIXUP func body size
+0000031: 19 ; FIXUP section size
+; section "end"
+000004b: 00 ; section size (guess)
+000004c: 03 ; string length
+000004d: 656e 64 ; section id: "end"
+000004b: 04 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0102 0001 0000 0a02
-0000010: 0001 0b02 0400 140a 2a02 0014 06
+0000000: 0061 736d 0a00 0000 100a 7369 676e 6174
+0000010: 7572 6573 0200 0100 0017 1366 756e 6374
+0000020: 696f 6e5f 7369 676e 6174 7572 6573 0200
+0000030: 0119 0f66 756e 6374 696f 6e5f 626f 6469
+0000040: 6573 0204 0014 0a2a 0200 1404 0365 6e64
;;; STDOUT ;;)
diff --git a/test/dump/select.txt b/test/dump/select.txt
index 006f2da6..33c5365d 100644
--- a/test/dump/select.txt
+++ b/test/dump/select.txt
@@ -8,53 +8,73 @@
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
0000004: 0a00 0000 ; WASM_BINARY_VERSION
-0000008: 01 ; WASM_BINARY_SECTION_SIGNATURES
-0000009: 01 ; num signatures
+; section "signatures"
+0000008: 00 ; section size (guess)
+0000009: 0a ; string length
+000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
+0000014: 01 ; num signatures
; signature 0
-000000a: 00 ; num params
-000000b: 00 ; result_type
-000000c: 0a ; WASM_BINARY_SECTION_FUNCTION_SIGNATURES
-000000d: 01 ; num functions
-000000e: 00 ; function 0 signature index
-000000f: 0b ; WASM_BINARY_SECTION_FUNCTION_BODIES
-0000010: 01 ; num functions
+0000015: 00 ; num params
+0000016: 00 ; result_type
+0000008: 0e ; FIXUP section size
+; section "function_signatures"
+0000017: 00 ; section size (guess)
+0000018: 13 ; string length
+0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
+0000029: 7265 73 ; section id: "function_signatures"
+000002c: 01 ; num functions
+000002d: 00 ; function 0 signature index
+0000017: 16 ; FIXUP section size
+; section "function_bodies"
+000002e: 00 ; section size (guess)
+000002f: 0f ; string length
+0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
+000003f: 01 ; num functions
; function body 0
-0000011: 00 ; func body size (guess)
-0000012: 00 ; local decl count
-0000013: 05 ; OPCODE_SELECT
-0000014: 0a ; OPCODE_I32_CONST
-0000015: 02 ; i32 literal
-0000016: 0a ; OPCODE_I32_CONST
-0000017: 03 ; i32 literal
-0000018: 0a ; OPCODE_I32_CONST
-0000019: 01 ; i32 literal
-000001a: 05 ; OPCODE_SELECT
-000001b: 0b ; OPCODE_I64_CONST
-000001c: 02 ; i64 literal
-000001d: 0b ; OPCODE_I64_CONST
-000001e: 03 ; i64 literal
-000001f: 0a ; OPCODE_I32_CONST
-0000020: 01 ; i32 literal
-0000021: 05 ; OPCODE_SELECT
-0000022: 0d ; OPCODE_F32_CONST
-0000023: 0000 0040 ; f32 literal
-0000027: 0d ; OPCODE_F32_CONST
-0000028: 0000 4040 ; f32 literal
-000002c: 0a ; OPCODE_I32_CONST
-000002d: 01 ; i32 literal
-000002e: 05 ; OPCODE_SELECT
-000002f: 0c ; OPCODE_F64_CONST
-0000030: 0000 0000 0000 0040 ; f64 literal
-0000038: 0c ; OPCODE_F64_CONST
-0000039: 0000 0000 0000 0840 ; f64 literal
-0000041: 0a ; OPCODE_I32_CONST
-0000042: 01 ; i32 literal
-0000011: 31 ; FIXUP func body size
-0000043: 06 ; WASM_BINARY_SECTION_END
+0000040: 00 ; func body size (guess)
+0000041: 00 ; local decl count
+0000042: 05 ; OPCODE_SELECT
+0000043: 0a ; OPCODE_I32_CONST
+0000044: 02 ; i32 literal
+0000045: 0a ; OPCODE_I32_CONST
+0000046: 03 ; i32 literal
+0000047: 0a ; OPCODE_I32_CONST
+0000048: 01 ; i32 literal
+0000049: 05 ; OPCODE_SELECT
+000004a: 0b ; OPCODE_I64_CONST
+000004b: 02 ; i64 literal
+000004c: 0b ; OPCODE_I64_CONST
+000004d: 03 ; i64 literal
+000004e: 0a ; OPCODE_I32_CONST
+000004f: 01 ; i32 literal
+0000050: 05 ; OPCODE_SELECT
+0000051: 0d ; OPCODE_F32_CONST
+0000052: 0000 0040 ; f32 literal
+0000056: 0d ; OPCODE_F32_CONST
+0000057: 0000 4040 ; f32 literal
+000005b: 0a ; OPCODE_I32_CONST
+000005c: 01 ; i32 literal
+000005d: 05 ; OPCODE_SELECT
+000005e: 0c ; OPCODE_F64_CONST
+000005f: 0000 0000 0000 0040 ; f64 literal
+0000067: 0c ; OPCODE_F64_CONST
+0000068: 0000 0000 0000 0840 ; f64 literal
+0000070: 0a ; OPCODE_I32_CONST
+0000071: 01 ; i32 literal
+0000040: 31 ; FIXUP func body size
+000002e: 43 ; FIXUP section size
+; section "end"
+0000072: 00 ; section size (guess)
+0000073: 03 ; string length
+0000074: 656e 64 ; section id: "end"
+0000072: 04 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0101 0000 0a01 000b
-0000010: 0131 0005 0a02 0a03 0a01 050b 020b 030a
-0000020: 0105 0d00 0000 400d 0000 4040 0a01 050c
-0000030: 0000 0000 0000 0040 0c00 0000 0000 0008
-0000040: 400a 0106
+0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
+0000010: 7572 6573 0100 0016 1366 756e 6374 696f
+0000020: 6e5f 7369 676e 6174 7572 6573 0100 430f
+0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 7301
+0000040: 3100 050a 020a 030a 0105 0b02 0b03 0a01
+0000050: 050d 0000 0040 0d00 0040 400a 0105 0c00
+0000060: 0000 0000 0000 400c 0000 0000 0000 0840
+0000070: 0a01 0403 656e 64
;;; STDOUT ;;)
diff --git a/test/dump/setlocal-param.txt b/test/dump/setlocal-param.txt
index 02e0bb34..2a4efb50 100644
--- a/test/dump/setlocal-param.txt
+++ b/test/dump/setlocal-param.txt
@@ -15,56 +15,76 @@
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
0000004: 0a00 0000 ; WASM_BINARY_VERSION
-0000008: 01 ; WASM_BINARY_SECTION_SIGNATURES
-0000009: 01 ; num signatures
+; section "signatures"
+0000008: 00 ; section size (guess)
+0000009: 0a ; string length
+000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
+0000014: 01 ; num signatures
; signature 0
-000000a: 02 ; num params
-000000b: 00 ; result_type
-000000c: 01 ; param type
-000000d: 03 ; param type
-000000e: 0a ; WASM_BINARY_SECTION_FUNCTION_SIGNATURES
-000000f: 01 ; num functions
-0000010: 00 ; function 0 signature index
-0000011: 0b ; WASM_BINARY_SECTION_FUNCTION_BODIES
-0000012: 01 ; num functions
+0000015: 02 ; num params
+0000016: 00 ; result_type
+0000017: 01 ; param type
+0000018: 03 ; param type
+0000008: 10 ; FIXUP section size
+; section "function_signatures"
+0000019: 00 ; section size (guess)
+000001a: 13 ; string length
+000001b: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
+000002b: 7265 73 ; section id: "function_signatures"
+000002e: 01 ; num functions
+000002f: 00 ; function 0 signature index
+0000019: 16 ; FIXUP section size
+; section "function_bodies"
+0000030: 00 ; section size (guess)
+0000031: 0f ; string length
+0000032: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
+0000041: 01 ; num functions
; function body 0
-0000013: 00 ; func body size (guess)
-0000014: 03 ; local decl count
-0000015: 01 ; local i32 count
-0000016: 01 ; WASM_TYPE_I32
-0000017: 01 ; local i64 count
-0000018: 02 ; WASM_TYPE_I64
-0000019: 02 ; local f32 count
-000001a: 03 ; WASM_TYPE_F32
-000001b: 0f ; OPCODE_SET_LOCAL
-000001c: 00 ; remapped local index
-000001d: 0a ; OPCODE_I32_CONST
-000001e: 00 ; i32 literal
-000001f: 0f ; OPCODE_SET_LOCAL
-0000020: 01 ; remapped local index
-0000021: 0d ; OPCODE_F32_CONST
-0000022: 0000 0000 ; f32 literal
-0000026: 0f ; OPCODE_SET_LOCAL
-0000027: 03 ; remapped local index
-0000028: 0b ; OPCODE_I64_CONST
-0000029: 00 ; i64 literal
-000002a: 0f ; OPCODE_SET_LOCAL
-000002b: 04 ; remapped local index
-000002c: 0d ; OPCODE_F32_CONST
-000002d: 0000 0000 ; f32 literal
-0000031: 0f ; OPCODE_SET_LOCAL
-0000032: 02 ; remapped local index
-0000033: 0a ; OPCODE_I32_CONST
-0000034: 00 ; i32 literal
-0000035: 0f ; OPCODE_SET_LOCAL
-0000036: 05 ; remapped local index
-0000037: 0d ; OPCODE_F32_CONST
-0000038: 0000 0000 ; f32 literal
-0000013: 28 ; FIXUP func body size
-000003c: 06 ; WASM_BINARY_SECTION_END
+0000042: 00 ; func body size (guess)
+0000043: 03 ; local decl count
+0000044: 01 ; local i32 count
+0000045: 01 ; WASM_TYPE_I32
+0000046: 01 ; local i64 count
+0000047: 02 ; WASM_TYPE_I64
+0000048: 02 ; local f32 count
+0000049: 03 ; WASM_TYPE_F32
+000004a: 0f ; OPCODE_SET_LOCAL
+000004b: 00 ; remapped local index
+000004c: 0a ; OPCODE_I32_CONST
+000004d: 00 ; i32 literal
+000004e: 0f ; OPCODE_SET_LOCAL
+000004f: 01 ; remapped local index
+0000050: 0d ; OPCODE_F32_CONST
+0000051: 0000 0000 ; f32 literal
+0000055: 0f ; OPCODE_SET_LOCAL
+0000056: 03 ; remapped local index
+0000057: 0b ; OPCODE_I64_CONST
+0000058: 00 ; i64 literal
+0000059: 0f ; OPCODE_SET_LOCAL
+000005a: 04 ; remapped local index
+000005b: 0d ; OPCODE_F32_CONST
+000005c: 0000 0000 ; f32 literal
+0000060: 0f ; OPCODE_SET_LOCAL
+0000061: 02 ; remapped local index
+0000062: 0a ; OPCODE_I32_CONST
+0000063: 00 ; i32 literal
+0000064: 0f ; OPCODE_SET_LOCAL
+0000065: 05 ; remapped local index
+0000066: 0d ; OPCODE_F32_CONST
+0000067: 0000 0000 ; f32 literal
+0000042: 28 ; FIXUP func body size
+0000030: 3a ; FIXUP section size
+; section "end"
+000006b: 00 ; section size (guess)
+000006c: 03 ; string length
+000006d: 656e 64 ; section id: "end"
+000006b: 04 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0101 0200 0103 0a01
-0000010: 000b 0128 0301 0101 0202 030f 000a 000f
-0000020: 010d 0000 0000 0f03 0b00 0f04 0d00 0000
-0000030: 000f 020a 000f 050d 0000 0000 06
+0000000: 0061 736d 0a00 0000 100a 7369 676e 6174
+0000010: 7572 6573 0102 0001 0316 1366 756e 6374
+0000020: 696f 6e5f 7369 676e 6174 7572 6573 0100
+0000030: 3a0f 6675 6e63 7469 6f6e 5f62 6f64 6965
+0000040: 7301 2803 0101 0102 0203 0f00 0a00 0f01
+0000050: 0d00 0000 000f 030b 000f 040d 0000 0000
+0000060: 0f02 0a00 0f05 0d00 0000 0004 0365 6e64
;;; STDOUT ;;)
diff --git a/test/dump/setlocal.txt b/test/dump/setlocal.txt
index dbe155e5..4ab96afc 100644
--- a/test/dump/setlocal.txt
+++ b/test/dump/setlocal.txt
@@ -17,65 +17,86 @@
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
0000004: 0a00 0000 ; WASM_BINARY_VERSION
-0000008: 01 ; WASM_BINARY_SECTION_SIGNATURES
-0000009: 01 ; num signatures
+; section "signatures"
+0000008: 00 ; section size (guess)
+0000009: 0a ; string length
+000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
+0000014: 01 ; num signatures
; signature 0
-000000a: 00 ; num params
-000000b: 00 ; result_type
-000000c: 0a ; WASM_BINARY_SECTION_FUNCTION_SIGNATURES
-000000d: 01 ; num functions
-000000e: 00 ; function 0 signature index
-000000f: 0b ; WASM_BINARY_SECTION_FUNCTION_BODIES
-0000010: 01 ; num functions
+0000015: 00 ; num params
+0000016: 00 ; result_type
+0000008: 0e ; FIXUP section size
+; section "function_signatures"
+0000017: 00 ; section size (guess)
+0000018: 13 ; string length
+0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
+0000029: 7265 73 ; section id: "function_signatures"
+000002c: 01 ; num functions
+000002d: 00 ; function 0 signature index
+0000017: 16 ; FIXUP section size
+; section "function_bodies"
+000002e: 00 ; section size (guess)
+000002f: 0f ; string length
+0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
+000003f: 01 ; num functions
; function body 0
-0000011: 00 ; func body size (guess)
-0000012: 04 ; local decl count
-0000013: 02 ; local i32 count
-0000014: 01 ; WASM_TYPE_I32
-0000015: 02 ; local i64 count
-0000016: 02 ; WASM_TYPE_I64
-0000017: 02 ; local f32 count
-0000018: 03 ; WASM_TYPE_F32
-0000019: 02 ; local f64 count
-000001a: 04 ; WASM_TYPE_F64
-000001b: 0f ; OPCODE_SET_LOCAL
-000001c: 06 ; remapped local index
-000001d: 0c ; OPCODE_F64_CONST
-000001e: 0000 0000 0000 0000 ; f64 literal
-0000026: 0f ; OPCODE_SET_LOCAL
-0000027: 04 ; remapped local index
-0000028: 0d ; OPCODE_F32_CONST
-0000029: 0000 0000 ; f32 literal
-000002d: 0f ; OPCODE_SET_LOCAL
-000002e: 02 ; remapped local index
-000002f: 0b ; OPCODE_I64_CONST
-0000030: 00 ; i64 literal
-0000031: 0f ; OPCODE_SET_LOCAL
-0000032: 00 ; remapped local index
-0000033: 0a ; OPCODE_I32_CONST
-0000034: 00 ; i32 literal
-0000035: 0f ; OPCODE_SET_LOCAL
-0000036: 01 ; remapped local index
-0000037: 0a ; OPCODE_I32_CONST
-0000038: 00 ; i32 literal
-0000039: 0f ; OPCODE_SET_LOCAL
-000003a: 05 ; remapped local index
-000003b: 0d ; OPCODE_F32_CONST
-000003c: 0000 0000 ; f32 literal
-0000040: 0f ; OPCODE_SET_LOCAL
-0000041: 07 ; remapped local index
-0000042: 0c ; OPCODE_F64_CONST
-0000043: 0000 0000 0000 0000 ; f64 literal
-000004b: 0f ; OPCODE_SET_LOCAL
-000004c: 03 ; remapped local index
-000004d: 0b ; OPCODE_I64_CONST
-000004e: 00 ; i64 literal
-0000011: 3d ; FIXUP func body size
-000004f: 06 ; WASM_BINARY_SECTION_END
+0000040: 00 ; func body size (guess)
+0000041: 04 ; local decl count
+0000042: 02 ; local i32 count
+0000043: 01 ; WASM_TYPE_I32
+0000044: 02 ; local i64 count
+0000045: 02 ; WASM_TYPE_I64
+0000046: 02 ; local f32 count
+0000047: 03 ; WASM_TYPE_F32
+0000048: 02 ; local f64 count
+0000049: 04 ; WASM_TYPE_F64
+000004a: 0f ; OPCODE_SET_LOCAL
+000004b: 06 ; remapped local index
+000004c: 0c ; OPCODE_F64_CONST
+000004d: 0000 0000 0000 0000 ; f64 literal
+0000055: 0f ; OPCODE_SET_LOCAL
+0000056: 04 ; remapped local index
+0000057: 0d ; OPCODE_F32_CONST
+0000058: 0000 0000 ; f32 literal
+000005c: 0f ; OPCODE_SET_LOCAL
+000005d: 02 ; remapped local index
+000005e: 0b ; OPCODE_I64_CONST
+000005f: 00 ; i64 literal
+0000060: 0f ; OPCODE_SET_LOCAL
+0000061: 00 ; remapped local index
+0000062: 0a ; OPCODE_I32_CONST
+0000063: 00 ; i32 literal
+0000064: 0f ; OPCODE_SET_LOCAL
+0000065: 01 ; remapped local index
+0000066: 0a ; OPCODE_I32_CONST
+0000067: 00 ; i32 literal
+0000068: 0f ; OPCODE_SET_LOCAL
+0000069: 05 ; remapped local index
+000006a: 0d ; OPCODE_F32_CONST
+000006b: 0000 0000 ; f32 literal
+000006f: 0f ; OPCODE_SET_LOCAL
+0000070: 07 ; remapped local index
+0000071: 0c ; OPCODE_F64_CONST
+0000072: 0000 0000 0000 0000 ; f64 literal
+000007a: 0f ; OPCODE_SET_LOCAL
+000007b: 03 ; remapped local index
+000007c: 0b ; OPCODE_I64_CONST
+000007d: 00 ; i64 literal
+0000040: 3d ; FIXUP func body size
+000002e: 4f ; FIXUP section size
+; section "end"
+000007e: 00 ; section size (guess)
+000007f: 03 ; string length
+0000080: 656e 64 ; section id: "end"
+000007e: 04 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0101 0000 0a01 000b
-0000010: 013d 0402 0102 0202 0302 040f 060c 0000
-0000020: 0000 0000 0000 0f04 0d00 0000 000f 020b
-0000030: 000f 000a 000f 010a 000f 050d 0000 0000
-0000040: 0f07 0c00 0000 0000 0000 000f 030b 0006
+0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
+0000010: 7572 6573 0100 0016 1366 756e 6374 696f
+0000020: 6e5f 7369 676e 6174 7572 6573 0100 4f0f
+0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 7301
+0000040: 3d04 0201 0202 0203 0204 0f06 0c00 0000
+0000050: 0000 0000 000f 040d 0000 0000 0f02 0b00
+0000060: 0f00 0a00 0f01 0a00 0f05 0d00 0000 000f
+0000070: 070c 0000 0000 0000 0000 0f03 0b00 0403
+0000080: 656e 64
;;; STDOUT ;;)
diff --git a/test/dump/signatures.txt b/test/dump/signatures.txt
index 8e584a51..4494cd35 100644
--- a/test/dump/signatures.txt
+++ b/test/dump/signatures.txt
@@ -14,43 +14,52 @@
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
0000004: 0a00 0000 ; WASM_BINARY_VERSION
-0000008: 01 ; WASM_BINARY_SECTION_SIGNATURES
-0000009: 09 ; num signatures
+; section "signatures"
+0000008: 00 ; section size (guess)
+0000009: 0a ; string length
+000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
+0000014: 09 ; num signatures
; signature 0
-000000a: 01 ; num params
-000000b: 00 ; result_type
-000000c: 01 ; param type
+0000015: 01 ; num params
+0000016: 00 ; result_type
+0000017: 01 ; param type
; signature 1
-000000d: 01 ; num params
-000000e: 00 ; result_type
-000000f: 02 ; param type
+0000018: 01 ; num params
+0000019: 00 ; result_type
+000001a: 02 ; param type
; signature 2
-0000010: 01 ; num params
-0000011: 00 ; result_type
-0000012: 03 ; param type
+000001b: 01 ; num params
+000001c: 00 ; result_type
+000001d: 03 ; param type
; signature 3
-0000013: 01 ; num params
-0000014: 00 ; result_type
-0000015: 04 ; param type
+000001e: 01 ; num params
+000001f: 00 ; result_type
+0000020: 04 ; param type
; signature 4
-0000016: 00 ; num params
-0000017: 01 ; result_type
+0000021: 00 ; num params
+0000022: 01 ; result_type
; signature 5
-0000018: 00 ; num params
-0000019: 02 ; result_type
+0000023: 00 ; num params
+0000024: 02 ; result_type
; signature 6
-000001a: 00 ; num params
-000001b: 03 ; result_type
+0000025: 00 ; num params
+0000026: 03 ; result_type
; signature 7
-000001c: 00 ; num params
-000001d: 04 ; result_type
+0000027: 00 ; num params
+0000028: 04 ; result_type
; signature 8
-000001e: 01 ; num params
-000001f: 04 ; result_type
-0000020: 01 ; param type
-0000021: 06 ; WASM_BINARY_SECTION_END
+0000029: 01 ; num params
+000002a: 04 ; result_type
+000002b: 01 ; param type
+0000008: 23 ; FIXUP section size
+; section "end"
+000002c: 00 ; section size (guess)
+000002d: 03 ; string length
+000002e: 656e 64 ; section id: "end"
+000002c: 04 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0109 0100 0101 0002
-0000010: 0100 0301 0004 0001 0002 0003 0004 0104
-0000020: 0106
+0000000: 0061 736d 0a00 0000 230a 7369 676e 6174
+0000010: 7572 6573 0901 0001 0100 0201 0003 0100
+0000020: 0400 0100 0200 0300 0401 0401 0403 656e
+0000030: 64
;;; STDOUT ;;)
diff --git a/test/dump/store-aligned.txt b/test/dump/store-aligned.txt
index 48172811..0fe4bc53 100644
--- a/test/dump/store-aligned.txt
+++ b/test/dump/store-aligned.txt
@@ -38,231 +38,252 @@
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
0000004: 0a00 0000 ; WASM_BINARY_VERSION
-0000008: 01 ; WASM_BINARY_SECTION_SIGNATURES
-0000009: 01 ; num signatures
+; section "signatures"
+0000008: 00 ; section size (guess)
+0000009: 0a ; string length
+000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
+0000014: 01 ; num signatures
; signature 0
-000000a: 00 ; num params
-000000b: 00 ; result_type
-000000c: 0a ; WASM_BINARY_SECTION_FUNCTION_SIGNATURES
-000000d: 01 ; num functions
-000000e: 00 ; function 0 signature index
-000000f: 0b ; WASM_BINARY_SECTION_FUNCTION_BODIES
-0000010: 01 ; num functions
+0000015: 00 ; num params
+0000016: 00 ; result_type
+0000008: 0e ; FIXUP section size
+; section "function_signatures"
+0000017: 00 ; section size (guess)
+0000018: 13 ; string length
+0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
+0000029: 7265 73 ; section id: "function_signatures"
+000002c: 01 ; num functions
+000002d: 00 ; function 0 signature index
+0000017: 16 ; FIXUP section size
+; section "function_bodies"
+000002e: 00 ; section size (guess)
+000002f: 0f ; string length
+0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
+000003f: 01 ; num functions
; function body 0
-0000011: 00 ; func body size (guess)
-0000012: 00 ; local decl count
-0000013: 2e ; OPCODE_I32_STORE_MEM8
-0000014: 00 ; alignment
-0000015: 00 ; store offset
-0000016: 0a ; OPCODE_I32_CONST
-0000017: 00 ; i32 literal
-0000018: 0a ; OPCODE_I32_CONST
-0000019: 00 ; i32 literal
-000001a: 2e ; OPCODE_I32_STORE_MEM8
-000001b: 01 ; alignment
-000001c: 00 ; store offset
-000001d: 0a ; OPCODE_I32_CONST
-000001e: 00 ; i32 literal
-000001f: 0a ; OPCODE_I32_CONST
-0000020: 00 ; i32 literal
-0000021: 2e ; OPCODE_I32_STORE_MEM8
-0000022: 02 ; alignment
-0000023: 00 ; store offset
-0000024: 0a ; OPCODE_I32_CONST
-0000025: 00 ; i32 literal
-0000026: 0a ; OPCODE_I32_CONST
-0000027: 00 ; i32 literal
-0000028: 2e ; OPCODE_I32_STORE_MEM8
-0000029: 03 ; alignment
-000002a: 00 ; store offset
-000002b: 0a ; OPCODE_I32_CONST
-000002c: 00 ; i32 literal
-000002d: 0a ; OPCODE_I32_CONST
-000002e: 00 ; i32 literal
-000002f: 2f ; OPCODE_I32_STORE_MEM16
-0000030: 00 ; alignment
-0000031: 00 ; store offset
-0000032: 0a ; OPCODE_I32_CONST
-0000033: 00 ; i32 literal
-0000034: 0a ; OPCODE_I32_CONST
-0000035: 00 ; i32 literal
-0000036: 2f ; OPCODE_I32_STORE_MEM16
-0000037: 01 ; alignment
-0000038: 00 ; store offset
-0000039: 0a ; OPCODE_I32_CONST
-000003a: 00 ; i32 literal
-000003b: 0a ; OPCODE_I32_CONST
-000003c: 00 ; i32 literal
-000003d: 2f ; OPCODE_I32_STORE_MEM16
-000003e: 02 ; alignment
-000003f: 00 ; store offset
-0000040: 0a ; OPCODE_I32_CONST
-0000041: 00 ; i32 literal
-0000042: 0a ; OPCODE_I32_CONST
-0000043: 00 ; i32 literal
-0000044: 2f ; OPCODE_I32_STORE_MEM16
-0000045: 03 ; alignment
-0000046: 00 ; store offset
+0000040: 00 ; func body size (guess)
+0000041: 00 ; local decl count
+0000042: 2e ; OPCODE_I32_STORE_MEM8
+0000043: 00 ; alignment
+0000044: 00 ; store offset
+0000045: 0a ; OPCODE_I32_CONST
+0000046: 00 ; i32 literal
0000047: 0a ; OPCODE_I32_CONST
0000048: 00 ; i32 literal
-0000049: 0a ; OPCODE_I32_CONST
-000004a: 00 ; i32 literal
-000004b: 33 ; OPCODE_I32_STORE_MEM
-000004c: 00 ; alignment
-000004d: 00 ; store offset
+0000049: 2e ; OPCODE_I32_STORE_MEM8
+000004a: 01 ; alignment
+000004b: 00 ; store offset
+000004c: 0a ; OPCODE_I32_CONST
+000004d: 00 ; i32 literal
000004e: 0a ; OPCODE_I32_CONST
000004f: 00 ; i32 literal
-0000050: 0a ; OPCODE_I32_CONST
-0000051: 00 ; i32 literal
-0000052: 33 ; OPCODE_I32_STORE_MEM
-0000053: 01 ; alignment
-0000054: 00 ; store offset
+0000050: 2e ; OPCODE_I32_STORE_MEM8
+0000051: 02 ; alignment
+0000052: 00 ; store offset
+0000053: 0a ; OPCODE_I32_CONST
+0000054: 00 ; i32 literal
0000055: 0a ; OPCODE_I32_CONST
0000056: 00 ; i32 literal
-0000057: 0a ; OPCODE_I32_CONST
-0000058: 00 ; i32 literal
-0000059: 33 ; OPCODE_I32_STORE_MEM
-000005a: 02 ; alignment
-000005b: 00 ; store offset
+0000057: 2e ; OPCODE_I32_STORE_MEM8
+0000058: 03 ; alignment
+0000059: 00 ; store offset
+000005a: 0a ; OPCODE_I32_CONST
+000005b: 00 ; i32 literal
000005c: 0a ; OPCODE_I32_CONST
000005d: 00 ; i32 literal
-000005e: 0a ; OPCODE_I32_CONST
-000005f: 00 ; i32 literal
-0000060: 33 ; OPCODE_I32_STORE_MEM
-0000061: 03 ; alignment
-0000062: 00 ; store offset
+000005e: 2f ; OPCODE_I32_STORE_MEM16
+000005f: 00 ; alignment
+0000060: 00 ; store offset
+0000061: 0a ; OPCODE_I32_CONST
+0000062: 00 ; i32 literal
0000063: 0a ; OPCODE_I32_CONST
0000064: 00 ; i32 literal
-0000065: 0a ; OPCODE_I32_CONST
-0000066: 00 ; i32 literal
-0000067: 34 ; OPCODE_I64_STORE_MEM
-0000068: 00 ; alignment
-0000069: 00 ; store offset
+0000065: 2f ; OPCODE_I32_STORE_MEM16
+0000066: 01 ; alignment
+0000067: 00 ; store offset
+0000068: 0a ; OPCODE_I32_CONST
+0000069: 00 ; i32 literal
000006a: 0a ; OPCODE_I32_CONST
000006b: 00 ; i32 literal
-000006c: 0b ; OPCODE_I64_CONST
-000006d: 00 ; i64 literal
-000006e: 34 ; OPCODE_I64_STORE_MEM
-000006f: 01 ; alignment
-0000070: 00 ; store offset
+000006c: 2f ; OPCODE_I32_STORE_MEM16
+000006d: 02 ; alignment
+000006e: 00 ; store offset
+000006f: 0a ; OPCODE_I32_CONST
+0000070: 00 ; i32 literal
0000071: 0a ; OPCODE_I32_CONST
0000072: 00 ; i32 literal
-0000073: 0b ; OPCODE_I64_CONST
-0000074: 00 ; i64 literal
-0000075: 34 ; OPCODE_I64_STORE_MEM
-0000076: 02 ; alignment
-0000077: 00 ; store offset
+0000073: 2f ; OPCODE_I32_STORE_MEM16
+0000074: 03 ; alignment
+0000075: 00 ; store offset
+0000076: 0a ; OPCODE_I32_CONST
+0000077: 00 ; i32 literal
0000078: 0a ; OPCODE_I32_CONST
0000079: 00 ; i32 literal
-000007a: 0b ; OPCODE_I64_CONST
-000007b: 00 ; i64 literal
-000007c: 34 ; OPCODE_I64_STORE_MEM
-000007d: 03 ; alignment
-000007e: 00 ; store offset
+000007a: 33 ; OPCODE_I32_STORE_MEM
+000007b: 00 ; alignment
+000007c: 00 ; store offset
+000007d: 0a ; OPCODE_I32_CONST
+000007e: 00 ; i32 literal
000007f: 0a ; OPCODE_I32_CONST
0000080: 00 ; i32 literal
-0000081: 0b ; OPCODE_I64_CONST
-0000082: 00 ; i64 literal
-0000083: 30 ; OPCODE_I64_STORE_MEM8
-0000084: 00 ; alignment
-0000085: 00 ; store offset
+0000081: 33 ; OPCODE_I32_STORE_MEM
+0000082: 01 ; alignment
+0000083: 00 ; store offset
+0000084: 0a ; OPCODE_I32_CONST
+0000085: 00 ; i32 literal
0000086: 0a ; OPCODE_I32_CONST
0000087: 00 ; i32 literal
-0000088: 0b ; OPCODE_I64_CONST
-0000089: 00 ; i64 literal
-000008a: 30 ; OPCODE_I64_STORE_MEM8
-000008b: 01 ; alignment
-000008c: 00 ; store offset
+0000088: 33 ; OPCODE_I32_STORE_MEM
+0000089: 02 ; alignment
+000008a: 00 ; store offset
+000008b: 0a ; OPCODE_I32_CONST
+000008c: 00 ; i32 literal
000008d: 0a ; OPCODE_I32_CONST
000008e: 00 ; i32 literal
-000008f: 0b ; OPCODE_I64_CONST
-0000090: 00 ; i64 literal
-0000091: 30 ; OPCODE_I64_STORE_MEM8
-0000092: 02 ; alignment
-0000093: 00 ; store offset
+000008f: 33 ; OPCODE_I32_STORE_MEM
+0000090: 03 ; alignment
+0000091: 00 ; store offset
+0000092: 0a ; OPCODE_I32_CONST
+0000093: 00 ; i32 literal
0000094: 0a ; OPCODE_I32_CONST
0000095: 00 ; i32 literal
-0000096: 0b ; OPCODE_I64_CONST
-0000097: 00 ; i64 literal
-0000098: 30 ; OPCODE_I64_STORE_MEM8
-0000099: 03 ; alignment
-000009a: 00 ; store offset
-000009b: 0a ; OPCODE_I32_CONST
-000009c: 00 ; i32 literal
-000009d: 0b ; OPCODE_I64_CONST
-000009e: 00 ; i64 literal
-000009f: 31 ; OPCODE_I64_STORE_MEM16
-00000a0: 00 ; alignment
-00000a1: 00 ; store offset
-00000a2: 0a ; OPCODE_I32_CONST
-00000a3: 00 ; i32 literal
-00000a4: 0b ; OPCODE_I64_CONST
-00000a5: 00 ; i64 literal
-00000a6: 31 ; OPCODE_I64_STORE_MEM16
-00000a7: 01 ; alignment
-00000a8: 00 ; store offset
-00000a9: 0a ; OPCODE_I32_CONST
-00000aa: 00 ; i32 literal
-00000ab: 0b ; OPCODE_I64_CONST
-00000ac: 00 ; i64 literal
-00000ad: 31 ; OPCODE_I64_STORE_MEM16
-00000ae: 02 ; alignment
-00000af: 00 ; store offset
-00000b0: 0a ; OPCODE_I32_CONST
-00000b1: 00 ; i32 literal
-00000b2: 0b ; OPCODE_I64_CONST
-00000b3: 00 ; i64 literal
-00000b4: 31 ; OPCODE_I64_STORE_MEM16
-00000b5: 03 ; alignment
-00000b6: 00 ; store offset
-00000b7: 0a ; OPCODE_I32_CONST
-00000b8: 00 ; i32 literal
-00000b9: 0b ; OPCODE_I64_CONST
-00000ba: 00 ; i64 literal
-00000bb: 34 ; OPCODE_I64_STORE_MEM
-00000bc: 00 ; alignment
-00000bd: 00 ; store offset
-00000be: 0a ; OPCODE_I32_CONST
-00000bf: 00 ; i32 literal
-00000c0: 0b ; OPCODE_I64_CONST
-00000c1: 00 ; i64 literal
-00000c2: 34 ; OPCODE_I64_STORE_MEM
-00000c3: 01 ; alignment
-00000c4: 00 ; store offset
-00000c5: 0a ; OPCODE_I32_CONST
-00000c6: 00 ; i32 literal
-00000c7: 0b ; OPCODE_I64_CONST
-00000c8: 00 ; i64 literal
-00000c9: 34 ; OPCODE_I64_STORE_MEM
-00000ca: 02 ; alignment
-00000cb: 00 ; store offset
-00000cc: 0a ; OPCODE_I32_CONST
-00000cd: 00 ; i32 literal
-00000ce: 0b ; OPCODE_I64_CONST
-00000cf: 00 ; i64 literal
-00000d0: 34 ; OPCODE_I64_STORE_MEM
-00000d1: 03 ; alignment
-00000d2: 00 ; store offset
-00000d3: 0a ; OPCODE_I32_CONST
-00000d4: 00 ; i32 literal
-00000d5: 0b ; OPCODE_I64_CONST
-00000d6: 00 ; i64 literal
-; move data: [12, d7) -> [13, d8)
-0000011: c501 ; FIXUP func body size
-00000d8: 06 ; WASM_BINARY_SECTION_END
+0000096: 34 ; OPCODE_I64_STORE_MEM
+0000097: 00 ; alignment
+0000098: 00 ; store offset
+0000099: 0a ; OPCODE_I32_CONST
+000009a: 00 ; i32 literal
+000009b: 0b ; OPCODE_I64_CONST
+000009c: 00 ; i64 literal
+000009d: 34 ; OPCODE_I64_STORE_MEM
+000009e: 01 ; alignment
+000009f: 00 ; store offset
+00000a0: 0a ; OPCODE_I32_CONST
+00000a1: 00 ; i32 literal
+00000a2: 0b ; OPCODE_I64_CONST
+00000a3: 00 ; i64 literal
+00000a4: 34 ; OPCODE_I64_STORE_MEM
+00000a5: 02 ; alignment
+00000a6: 00 ; store offset
+00000a7: 0a ; OPCODE_I32_CONST
+00000a8: 00 ; i32 literal
+00000a9: 0b ; OPCODE_I64_CONST
+00000aa: 00 ; i64 literal
+00000ab: 34 ; OPCODE_I64_STORE_MEM
+00000ac: 03 ; alignment
+00000ad: 00 ; store offset
+00000ae: 0a ; OPCODE_I32_CONST
+00000af: 00 ; i32 literal
+00000b0: 0b ; OPCODE_I64_CONST
+00000b1: 00 ; i64 literal
+00000b2: 30 ; OPCODE_I64_STORE_MEM8
+00000b3: 00 ; alignment
+00000b4: 00 ; store offset
+00000b5: 0a ; OPCODE_I32_CONST
+00000b6: 00 ; i32 literal
+00000b7: 0b ; OPCODE_I64_CONST
+00000b8: 00 ; i64 literal
+00000b9: 30 ; OPCODE_I64_STORE_MEM8
+00000ba: 01 ; alignment
+00000bb: 00 ; store offset
+00000bc: 0a ; OPCODE_I32_CONST
+00000bd: 00 ; i32 literal
+00000be: 0b ; OPCODE_I64_CONST
+00000bf: 00 ; i64 literal
+00000c0: 30 ; OPCODE_I64_STORE_MEM8
+00000c1: 02 ; alignment
+00000c2: 00 ; store offset
+00000c3: 0a ; OPCODE_I32_CONST
+00000c4: 00 ; i32 literal
+00000c5: 0b ; OPCODE_I64_CONST
+00000c6: 00 ; i64 literal
+00000c7: 30 ; OPCODE_I64_STORE_MEM8
+00000c8: 03 ; alignment
+00000c9: 00 ; store offset
+00000ca: 0a ; OPCODE_I32_CONST
+00000cb: 00 ; i32 literal
+00000cc: 0b ; OPCODE_I64_CONST
+00000cd: 00 ; i64 literal
+00000ce: 31 ; OPCODE_I64_STORE_MEM16
+00000cf: 00 ; alignment
+00000d0: 00 ; store offset
+00000d1: 0a ; OPCODE_I32_CONST
+00000d2: 00 ; i32 literal
+00000d3: 0b ; OPCODE_I64_CONST
+00000d4: 00 ; i64 literal
+00000d5: 31 ; OPCODE_I64_STORE_MEM16
+00000d6: 01 ; alignment
+00000d7: 00 ; store offset
+00000d8: 0a ; OPCODE_I32_CONST
+00000d9: 00 ; i32 literal
+00000da: 0b ; OPCODE_I64_CONST
+00000db: 00 ; i64 literal
+00000dc: 31 ; OPCODE_I64_STORE_MEM16
+00000dd: 02 ; alignment
+00000de: 00 ; store offset
+00000df: 0a ; OPCODE_I32_CONST
+00000e0: 00 ; i32 literal
+00000e1: 0b ; OPCODE_I64_CONST
+00000e2: 00 ; i64 literal
+00000e3: 31 ; OPCODE_I64_STORE_MEM16
+00000e4: 03 ; alignment
+00000e5: 00 ; store offset
+00000e6: 0a ; OPCODE_I32_CONST
+00000e7: 00 ; i32 literal
+00000e8: 0b ; OPCODE_I64_CONST
+00000e9: 00 ; i64 literal
+00000ea: 34 ; OPCODE_I64_STORE_MEM
+00000eb: 00 ; alignment
+00000ec: 00 ; store offset
+00000ed: 0a ; OPCODE_I32_CONST
+00000ee: 00 ; i32 literal
+00000ef: 0b ; OPCODE_I64_CONST
+00000f0: 00 ; i64 literal
+00000f1: 34 ; OPCODE_I64_STORE_MEM
+00000f2: 01 ; alignment
+00000f3: 00 ; store offset
+00000f4: 0a ; OPCODE_I32_CONST
+00000f5: 00 ; i32 literal
+00000f6: 0b ; OPCODE_I64_CONST
+00000f7: 00 ; i64 literal
+00000f8: 34 ; OPCODE_I64_STORE_MEM
+00000f9: 02 ; alignment
+00000fa: 00 ; store offset
+00000fb: 0a ; OPCODE_I32_CONST
+00000fc: 00 ; i32 literal
+00000fd: 0b ; OPCODE_I64_CONST
+00000fe: 00 ; i64 literal
+00000ff: 34 ; OPCODE_I64_STORE_MEM
+0000100: 03 ; alignment
+0000101: 00 ; store offset
+0000102: 0a ; OPCODE_I32_CONST
+0000103: 00 ; i32 literal
+0000104: 0b ; OPCODE_I64_CONST
+0000105: 00 ; i64 literal
+; move data: [41, 106) -> [42, 107)
+0000040: c501 ; FIXUP func body size
+; move data: [2f, 107) -> [30, 108)
+000002e: d801 ; FIXUP section size
+; section "end"
+0000108: 00 ; section size (guess)
+0000109: 03 ; string length
+000010a: 656e 64 ; section id: "end"
+0000108: 04 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0101 0000 0a01 000b
-0000010: 01c5 0100 2e00 000a 000a 002e 0100 0a00
-0000020: 0a00 2e02 000a 000a 002e 0300 0a00 0a00
-0000030: 2f00 000a 000a 002f 0100 0a00 0a00 2f02
-0000040: 000a 000a 002f 0300 0a00 0a00 3300 000a
-0000050: 000a 0033 0100 0a00 0a00 3302 000a 000a
-0000060: 0033 0300 0a00 0a00 3400 000a 000b 0034
-0000070: 0100 0a00 0b00 3402 000a 000b 0034 0300
-0000080: 0a00 0b00 3000 000a 000b 0030 0100 0a00
-0000090: 0b00 3002 000a 000b 0030 0300 0a00 0b00
-00000a0: 3100 000a 000b 0031 0100 0a00 0b00 3102
-00000b0: 000a 000b 0031 0300 0a00 0b00 3400 000a
-00000c0: 000b 0034 0100 0a00 0b00 3402 000a 000b
-00000d0: 0034 0300 0a00 0b00 06
+0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
+0000010: 7572 6573 0100 0016 1366 756e 6374 696f
+0000020: 6e5f 7369 676e 6174 7572 6573 0100 d801
+0000030: 0f66 756e 6374 696f 6e5f 626f 6469 6573
+0000040: 01c5 0100 2e00 000a 000a 002e 0100 0a00
+0000050: 0a00 2e02 000a 000a 002e 0300 0a00 0a00
+0000060: 2f00 000a 000a 002f 0100 0a00 0a00 2f02
+0000070: 000a 000a 002f 0300 0a00 0a00 3300 000a
+0000080: 000a 0033 0100 0a00 0a00 3302 000a 000a
+0000090: 0033 0300 0a00 0a00 3400 000a 000b 0034
+00000a0: 0100 0a00 0b00 3402 000a 000b 0034 0300
+00000b0: 0a00 0b00 3000 000a 000b 0030 0100 0a00
+00000c0: 0b00 3002 000a 000b 0030 0300 0a00 0b00
+00000d0: 3100 000a 000b 0031 0100 0a00 0b00 3102
+00000e0: 000a 000b 0031 0300 0a00 0b00 3400 000a
+00000f0: 000b 0034 0100 0a00 0b00 3402 000a 000b
+0000100: 0034 0300 0a00 0b00 0403 656e 64
;;; STDOUT ;;)
diff --git a/test/dump/store.txt b/test/dump/store.txt
index ff6999fa..edde041b 100644
--- a/test/dump/store.txt
+++ b/test/dump/store.txt
@@ -13,89 +13,109 @@
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
0000004: 0a00 0000 ; WASM_BINARY_VERSION
-0000008: 01 ; WASM_BINARY_SECTION_SIGNATURES
-0000009: 01 ; num signatures
+; section "signatures"
+0000008: 00 ; section size (guess)
+0000009: 0a ; string length
+000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
+0000014: 01 ; num signatures
; signature 0
-000000a: 00 ; num params
-000000b: 00 ; result_type
-000000c: 0a ; WASM_BINARY_SECTION_FUNCTION_SIGNATURES
-000000d: 01 ; num functions
-000000e: 00 ; function 0 signature index
-000000f: 0b ; WASM_BINARY_SECTION_FUNCTION_BODIES
-0000010: 01 ; num functions
+0000015: 00 ; num params
+0000016: 00 ; result_type
+0000008: 0e ; FIXUP section size
+; section "function_signatures"
+0000017: 00 ; section size (guess)
+0000018: 13 ; string length
+0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
+0000029: 7265 73 ; section id: "function_signatures"
+000002c: 01 ; num functions
+000002d: 00 ; function 0 signature index
+0000017: 16 ; FIXUP section size
+; section "function_bodies"
+000002e: 00 ; section size (guess)
+000002f: 0f ; string length
+0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
+000003f: 01 ; num functions
; function body 0
-0000011: 00 ; func body size (guess)
-0000012: 00 ; local decl count
-0000013: 2e ; OPCODE_I32_STORE_MEM8
-0000014: 00 ; alignment
-0000015: 00 ; store offset
-0000016: 0a ; OPCODE_I32_CONST
-0000017: 00 ; i32 literal
-0000018: 0a ; OPCODE_I32_CONST
-0000019: 00 ; i32 literal
-000001a: 2f ; OPCODE_I32_STORE_MEM16
-000001b: 01 ; alignment
-000001c: 00 ; store offset
-000001d: 0a ; OPCODE_I32_CONST
-000001e: 00 ; i32 literal
-000001f: 0a ; OPCODE_I32_CONST
-0000020: 00 ; i32 literal
-0000021: 33 ; OPCODE_I32_STORE_MEM
-0000022: 02 ; alignment
-0000023: 00 ; store offset
-0000024: 0a ; OPCODE_I32_CONST
-0000025: 00 ; i32 literal
-0000026: 0a ; OPCODE_I32_CONST
-0000027: 00 ; i32 literal
-0000028: 34 ; OPCODE_I64_STORE_MEM
-0000029: 03 ; alignment
-000002a: 00 ; store offset
-000002b: 0a ; OPCODE_I32_CONST
-000002c: 00 ; i32 literal
-000002d: 0b ; OPCODE_I64_CONST
-000002e: 00 ; i64 literal
-000002f: 30 ; OPCODE_I64_STORE_MEM8
-0000030: 00 ; alignment
-0000031: 00 ; store offset
-0000032: 0a ; OPCODE_I32_CONST
-0000033: 00 ; i32 literal
-0000034: 0b ; OPCODE_I64_CONST
-0000035: 00 ; i64 literal
-0000036: 31 ; OPCODE_I64_STORE_MEM16
-0000037: 01 ; alignment
-0000038: 00 ; store offset
-0000039: 0a ; OPCODE_I32_CONST
-000003a: 00 ; i32 literal
-000003b: 0b ; OPCODE_I64_CONST
-000003c: 00 ; i64 literal
-000003d: 32 ; OPCODE_I64_STORE_MEM32
-000003e: 02 ; alignment
-000003f: 00 ; store offset
-0000040: 0a ; OPCODE_I32_CONST
-0000041: 00 ; i32 literal
-0000042: 0b ; OPCODE_I64_CONST
-0000043: 00 ; i64 literal
-0000044: 35 ; OPCODE_F32_STORE_MEM
-0000045: 02 ; alignment
-0000046: 00 ; store offset
+0000040: 00 ; func body size (guess)
+0000041: 00 ; local decl count
+0000042: 2e ; OPCODE_I32_STORE_MEM8
+0000043: 00 ; alignment
+0000044: 00 ; store offset
+0000045: 0a ; OPCODE_I32_CONST
+0000046: 00 ; i32 literal
0000047: 0a ; OPCODE_I32_CONST
0000048: 00 ; i32 literal
-0000049: 0d ; OPCODE_F32_CONST
-000004a: 0000 0000 ; f32 literal
-000004e: 36 ; OPCODE_F64_STORE_MEM
-000004f: 03 ; alignment
-0000050: 00 ; store offset
-0000051: 0a ; OPCODE_I32_CONST
-0000052: 00 ; i32 literal
-0000053: 0c ; OPCODE_F64_CONST
-0000054: 0000 0000 0000 0000 ; f64 literal
-0000011: 4a ; FIXUP func body size
-000005c: 06 ; WASM_BINARY_SECTION_END
+0000049: 2f ; OPCODE_I32_STORE_MEM16
+000004a: 01 ; alignment
+000004b: 00 ; store offset
+000004c: 0a ; OPCODE_I32_CONST
+000004d: 00 ; i32 literal
+000004e: 0a ; OPCODE_I32_CONST
+000004f: 00 ; i32 literal
+0000050: 33 ; OPCODE_I32_STORE_MEM
+0000051: 02 ; alignment
+0000052: 00 ; store offset
+0000053: 0a ; OPCODE_I32_CONST
+0000054: 00 ; i32 literal
+0000055: 0a ; OPCODE_I32_CONST
+0000056: 00 ; i32 literal
+0000057: 34 ; OPCODE_I64_STORE_MEM
+0000058: 03 ; alignment
+0000059: 00 ; store offset
+000005a: 0a ; OPCODE_I32_CONST
+000005b: 00 ; i32 literal
+000005c: 0b ; OPCODE_I64_CONST
+000005d: 00 ; i64 literal
+000005e: 30 ; OPCODE_I64_STORE_MEM8
+000005f: 00 ; alignment
+0000060: 00 ; store offset
+0000061: 0a ; OPCODE_I32_CONST
+0000062: 00 ; i32 literal
+0000063: 0b ; OPCODE_I64_CONST
+0000064: 00 ; i64 literal
+0000065: 31 ; OPCODE_I64_STORE_MEM16
+0000066: 01 ; alignment
+0000067: 00 ; store offset
+0000068: 0a ; OPCODE_I32_CONST
+0000069: 00 ; i32 literal
+000006a: 0b ; OPCODE_I64_CONST
+000006b: 00 ; i64 literal
+000006c: 32 ; OPCODE_I64_STORE_MEM32
+000006d: 02 ; alignment
+000006e: 00 ; store offset
+000006f: 0a ; OPCODE_I32_CONST
+0000070: 00 ; i32 literal
+0000071: 0b ; OPCODE_I64_CONST
+0000072: 00 ; i64 literal
+0000073: 35 ; OPCODE_F32_STORE_MEM
+0000074: 02 ; alignment
+0000075: 00 ; store offset
+0000076: 0a ; OPCODE_I32_CONST
+0000077: 00 ; i32 literal
+0000078: 0d ; OPCODE_F32_CONST
+0000079: 0000 0000 ; f32 literal
+000007d: 36 ; OPCODE_F64_STORE_MEM
+000007e: 03 ; alignment
+000007f: 00 ; store offset
+0000080: 0a ; OPCODE_I32_CONST
+0000081: 00 ; i32 literal
+0000082: 0c ; OPCODE_F64_CONST
+0000083: 0000 0000 0000 0000 ; f64 literal
+0000040: 4a ; FIXUP func body size
+000002e: 5c ; FIXUP section size
+; section "end"
+000008b: 00 ; section size (guess)
+000008c: 03 ; string length
+000008d: 656e 64 ; section id: "end"
+000008b: 04 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0101 0000 0a01 000b
-0000010: 014a 002e 0000 0a00 0a00 2f01 000a 000a
-0000020: 0033 0200 0a00 0a00 3403 000a 000b 0030
-0000030: 0000 0a00 0b00 3101 000a 000b 0032 0200
-0000040: 0a00 0b00 3502 000a 000d 0000 0000 3603
-0000050: 000a 000c 0000 0000 0000 0000 06
+0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
+0000010: 7572 6573 0100 0016 1366 756e 6374 696f
+0000020: 6e5f 7369 676e 6174 7572 6573 0100 5c0f
+0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 7301
+0000040: 4a00 2e00 000a 000a 002f 0100 0a00 0a00
+0000050: 3302 000a 000a 0034 0300 0a00 0b00 3000
+0000060: 000a 000b 0031 0100 0a00 0b00 3202 000a
+0000070: 000b 0035 0200 0a00 0d00 0000 0036 0300
+0000080: 0a00 0c00 0000 0000 0000 0004 0365 6e64
;;; STDOUT ;;)
diff --git a/test/dump/table.txt b/test/dump/table.txt
index 91bc737b..bbff99ad 100644
--- a/test/dump/table.txt
+++ b/test/dump/table.txt
@@ -8,50 +8,76 @@
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
0000004: 0a00 0000 ; WASM_BINARY_VERSION
-0000008: 01 ; WASM_BINARY_SECTION_SIGNATURES
-0000009: 03 ; num signatures
+; section "signatures"
+0000008: 00 ; section size (guess)
+0000009: 0a ; string length
+000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
+0000014: 03 ; num signatures
; signature 0
-000000a: 01 ; num params
-000000b: 00 ; result_type
-000000c: 01 ; param type
+0000015: 01 ; num params
+0000016: 00 ; result_type
+0000017: 01 ; param type
; signature 1
-000000d: 02 ; num params
-000000e: 00 ; result_type
-000000f: 01 ; param type
-0000010: 02 ; param type
+0000018: 02 ; num params
+0000019: 00 ; result_type
+000001a: 01 ; param type
+000001b: 02 ; param type
; signature 2
-0000011: 00 ; num params
-0000012: 04 ; result_type
-0000013: 0a ; WASM_BINARY_SECTION_FUNCTION_SIGNATURES
-0000014: 03 ; num functions
-0000015: 00 ; function 0 signature index
-0000016: 01 ; function 1 signature index
-0000017: 02 ; function 2 signature index
-0000018: 0b ; WASM_BINARY_SECTION_FUNCTION_BODIES
-0000019: 03 ; num functions
+000001c: 00 ; num params
+000001d: 04 ; result_type
+0000008: 15 ; FIXUP section size
+; section "function_signatures"
+000001e: 00 ; section size (guess)
+000001f: 13 ; string length
+0000020: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
+0000030: 7265 73 ; section id: "function_signatures"
+0000033: 03 ; num functions
+0000034: 00 ; function 0 signature index
+0000035: 01 ; function 1 signature index
+0000036: 02 ; function 2 signature index
+000001e: 18 ; FIXUP section size
+; section "function_bodies"
+0000037: 00 ; section size (guess)
+0000038: 0f ; string length
+0000039: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
+0000048: 03 ; num functions
; function body 0
-000001a: 00 ; func body size (guess)
-000001b: 00 ; local decl count
-000001a: 01 ; FIXUP func body size
+0000049: 00 ; func body size (guess)
+000004a: 00 ; local decl count
+0000049: 01 ; FIXUP func body size
; function body 1
-000001c: 00 ; func body size (guess)
-000001d: 00 ; local decl count
-000001c: 01 ; FIXUP func body size
+000004b: 00 ; func body size (guess)
+000004c: 00 ; local decl count
+000004b: 01 ; FIXUP func body size
; function body 2
-000001e: 00 ; func body size (guess)
-000001f: 00 ; local decl count
-0000020: 0c ; OPCODE_F64_CONST
-0000021: 0000 0000 0000 0000 ; f64 literal
-000001e: 0a ; FIXUP func body size
-0000029: 05 ; WASM_BINARY_SECTION_FUNCTION_TABLE
-000002a: 04 ; num function table entries
-000002b: 00 ; function table entry
-000002c: 00 ; function table entry
-000002d: 01 ; function table entry
-000002e: 02 ; function table entry
-000002f: 06 ; WASM_BINARY_SECTION_END
+000004d: 00 ; func body size (guess)
+000004e: 00 ; local decl count
+000004f: 0c ; OPCODE_F64_CONST
+0000050: 0000 0000 0000 0000 ; f64 literal
+000004d: 0a ; FIXUP func body size
+0000037: 20 ; FIXUP section size
+; section "function_table"
+0000058: 00 ; section size (guess)
+0000059: 0e ; string length
+000005a: 6675 6e63 7469 6f6e 5f74 6162 6c65 ; section id: "function_table"
+0000068: 04 ; num function table entries
+0000069: 00 ; function table entry
+000006a: 00 ; function table entry
+000006b: 01 ; function table entry
+000006c: 02 ; function table entry
+0000058: 14 ; FIXUP section size
+; section "end"
+000006d: 00 ; section size (guess)
+000006e: 03 ; string length
+000006f: 656e 64 ; section id: "end"
+000006d: 04 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0103 0100 0102 0001
-0000010: 0200 040a 0300 0102 0b03 0100 0100 0a00
-0000020: 0c00 0000 0000 0000 0005 0400 0001 0206
+0000000: 0061 736d 0a00 0000 150a 7369 676e 6174
+0000010: 7572 6573 0301 0001 0200 0102 0004 1813
+0000020: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
+0000030: 7265 7303 0001 0220 0f66 756e 6374 696f
+0000040: 6e5f 626f 6469 6573 0301 0001 000a 000c
+0000050: 0000 0000 0000 0000 140e 6675 6e63 7469
+0000060: 6f6e 5f74 6162 6c65 0400 0001 0204 0365
+0000070: 6e64
;;; STDOUT ;;)
diff --git a/test/dump/unary.txt b/test/dump/unary.txt
index 05bb7632..9a63be2d 100644
--- a/test/dump/unary.txt
+++ b/test/dump/unary.txt
@@ -28,53 +28,73 @@
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
0000004: 0a00 0000 ; WASM_BINARY_VERSION
-0000008: 01 ; WASM_BINARY_SECTION_SIGNATURES
-0000009: 01 ; num signatures
+; section "signatures"
+0000008: 00 ; section size (guess)
+0000009: 0a ; string length
+000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
+0000014: 01 ; num signatures
; signature 0
-000000a: 00 ; num params
-000000b: 00 ; result_type
-000000c: 0a ; WASM_BINARY_SECTION_FUNCTION_SIGNATURES
-000000d: 01 ; num functions
-000000e: 00 ; function 0 signature index
-000000f: 0b ; WASM_BINARY_SECTION_FUNCTION_BODIES
-0000010: 01 ; num functions
+0000015: 00 ; num params
+0000016: 00 ; result_type
+0000008: 0e ; FIXUP section size
+; section "function_signatures"
+0000017: 00 ; section size (guess)
+0000018: 13 ; string length
+0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
+0000029: 7265 73 ; section id: "function_signatures"
+000002c: 01 ; num functions
+000002d: 00 ; function 0 signature index
+0000017: 16 ; FIXUP section size
+; section "function_bodies"
+000002e: 00 ; section size (guess)
+000002f: 0f ; string length
+0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
+000003f: 01 ; num functions
; function body 0
-0000011: 00 ; func body size (guess)
-0000012: 00 ; local decl count
-0000013: 5a ; OPCODE_BOOL_NOT
-0000014: 57 ; OPCODE_I32_CLZ
-0000015: 58 ; OPCODE_I32_CTZ
-0000016: 59 ; OPCODE_I32_POPCNT
-0000017: 0a ; OPCODE_I32_CONST
-0000018: 00 ; i32 literal
-0000019: 72 ; OPCODE_I64_CLZ
-000001a: 73 ; OPCODE_I64_CTZ
-000001b: 74 ; OPCODE_I64_POPCNT
-000001c: 0b ; OPCODE_I64_CONST
-000001d: 00 ; i64 literal
-000001e: 7c ; OPCODE_F32_NEG
-000001f: 7b ; OPCODE_F32_ABS
-0000020: 82 ; OPCODE_F32_SQRT
-0000021: 7e ; OPCODE_F32_CEIL
-0000022: 7f ; OPCODE_F32_FLOOR
-0000023: 80 ; OPCODE_F32_TRUNC
-0000024: 81 ; OPCODE_F32_NEAREST_INT
-0000025: 0d ; OPCODE_F32_CONST
-0000026: 0000 0000 ; f32 literal
-000002a: 90 ; OPCODE_F64_NEG
-000002b: 8f ; OPCODE_F64_ABS
-000002c: 96 ; OPCODE_F64_SQRT
-000002d: 92 ; OPCODE_F64_CEIL
-000002e: 93 ; OPCODE_F64_FLOOR
-000002f: 94 ; OPCODE_F64_TRUNC
-0000030: 95 ; OPCODE_F64_NEAREST_INT
-0000031: 0c ; OPCODE_F64_CONST
-0000032: 0000 0000 0000 0000 ; f64 literal
-0000011: 28 ; FIXUP func body size
-000003a: 06 ; WASM_BINARY_SECTION_END
+0000040: 00 ; func body size (guess)
+0000041: 00 ; local decl count
+0000042: 5a ; OPCODE_BOOL_NOT
+0000043: 57 ; OPCODE_I32_CLZ
+0000044: 58 ; OPCODE_I32_CTZ
+0000045: 59 ; OPCODE_I32_POPCNT
+0000046: 0a ; OPCODE_I32_CONST
+0000047: 00 ; i32 literal
+0000048: 72 ; OPCODE_I64_CLZ
+0000049: 73 ; OPCODE_I64_CTZ
+000004a: 74 ; OPCODE_I64_POPCNT
+000004b: 0b ; OPCODE_I64_CONST
+000004c: 00 ; i64 literal
+000004d: 7c ; OPCODE_F32_NEG
+000004e: 7b ; OPCODE_F32_ABS
+000004f: 82 ; OPCODE_F32_SQRT
+0000050: 7e ; OPCODE_F32_CEIL
+0000051: 7f ; OPCODE_F32_FLOOR
+0000052: 80 ; OPCODE_F32_TRUNC
+0000053: 81 ; OPCODE_F32_NEAREST_INT
+0000054: 0d ; OPCODE_F32_CONST
+0000055: 0000 0000 ; f32 literal
+0000059: 90 ; OPCODE_F64_NEG
+000005a: 8f ; OPCODE_F64_ABS
+000005b: 96 ; OPCODE_F64_SQRT
+000005c: 92 ; OPCODE_F64_CEIL
+000005d: 93 ; OPCODE_F64_FLOOR
+000005e: 94 ; OPCODE_F64_TRUNC
+000005f: 95 ; OPCODE_F64_NEAREST_INT
+0000060: 0c ; OPCODE_F64_CONST
+0000061: 0000 0000 0000 0000 ; f64 literal
+0000040: 28 ; FIXUP func body size
+000002e: 3a ; FIXUP section size
+; section "end"
+0000069: 00 ; section size (guess)
+000006a: 03 ; string length
+000006b: 656e 64 ; section id: "end"
+0000069: 04 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0101 0000 0a01 000b
-0000010: 0128 005a 5758 590a 0072 7374 0b00 7c7b
-0000020: 827e 7f80 810d 0000 0000 908f 9692 9394
-0000030: 950c 0000 0000 0000 0000 06
+0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
+0000010: 7572 6573 0100 0016 1366 756e 6374 696f
+0000020: 6e5f 7369 676e 6174 7572 6573 0100 3a0f
+0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 7301
+0000040: 2800 5a57 5859 0a00 7273 740b 007c 7b82
+0000050: 7e7f 8081 0d00 0000 0090 8f96 9293 9495
+0000060: 0c00 0000 0000 0000 0004 0365 6e64
;;; STDOUT ;;)
diff --git a/test/dump/unreachable.txt b/test/dump/unreachable.txt
index 823bc947..b6881ce6 100644
--- a/test/dump/unreachable.txt
+++ b/test/dump/unreachable.txt
@@ -5,23 +5,43 @@
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
0000004: 0a00 0000 ; WASM_BINARY_VERSION
-0000008: 01 ; WASM_BINARY_SECTION_SIGNATURES
-0000009: 01 ; num signatures
+; section "signatures"
+0000008: 00 ; section size (guess)
+0000009: 0a ; string length
+000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
+0000014: 01 ; num signatures
; signature 0
-000000a: 00 ; num params
-000000b: 00 ; result_type
-000000c: 0a ; WASM_BINARY_SECTION_FUNCTION_SIGNATURES
-000000d: 01 ; num functions
-000000e: 00 ; function 0 signature index
-000000f: 0b ; WASM_BINARY_SECTION_FUNCTION_BODIES
-0000010: 01 ; num functions
+0000015: 00 ; num params
+0000016: 00 ; result_type
+0000008: 0e ; FIXUP section size
+; section "function_signatures"
+0000017: 00 ; section size (guess)
+0000018: 13 ; string length
+0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
+0000029: 7265 73 ; section id: "function_signatures"
+000002c: 01 ; num functions
+000002d: 00 ; function 0 signature index
+0000017: 16 ; FIXUP section size
+; section "function_bodies"
+000002e: 00 ; section size (guess)
+000002f: 0f ; string length
+0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
+000003f: 01 ; num functions
; function body 0
-0000011: 00 ; func body size (guess)
-0000012: 00 ; local decl count
-0000013: 15 ; OPCODE_UNREACHABLE
-0000011: 02 ; FIXUP func body size
-0000014: 06 ; WASM_BINARY_SECTION_END
+0000040: 00 ; func body size (guess)
+0000041: 00 ; local decl count
+0000042: 15 ; OPCODE_UNREACHABLE
+0000040: 02 ; FIXUP func body size
+000002e: 14 ; FIXUP section size
+; section "end"
+0000043: 00 ; section size (guess)
+0000044: 03 ; string length
+0000045: 656e 64 ; section id: "end"
+0000043: 04 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0101 0000 0a01 000b
-0000010: 0102 0015 06
+0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
+0000010: 7572 6573 0100 0016 1366 756e 6374 696f
+0000020: 6e5f 7369 676e 6174 7572 6573 0100 140f
+0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 7301
+0000040: 0200 1504 0365 6e64
;;; STDOUT ;;)