diff options
29 files changed, 94 insertions, 76 deletions
diff --git a/src/binary-reader-logging.cc b/src/binary-reader-logging.cc index c843639e..335b24c1 100644 --- a/src/binary-reader-logging.cc +++ b/src/binary-reader-logging.cc @@ -573,6 +573,10 @@ Result BinaryReaderLogging::OnOpcodeBare() { return reader->OnOpcodeBare(); } +Result BinaryReaderLogging::OnOpcodeIndex(Index value) { + return reader->OnOpcodeIndex(value); +} + Result BinaryReaderLogging::OnOpcodeUint32(uint32_t value) { return reader->OnOpcodeUint32(value); } diff --git a/src/binary-reader-logging.h b/src/binary-reader-logging.h index ecbfb94e..22516268 100644 --- a/src/binary-reader-logging.h +++ b/src/binary-reader-logging.h @@ -121,6 +121,7 @@ class BinaryReaderLogging : public BinaryReader { Result OnOpcode(Opcode opcode) override; Result OnOpcodeBare() override; + Result OnOpcodeIndex(Index value) override; Result OnOpcodeUint32(uint32_t value) override; Result OnOpcodeUint32Uint32(uint32_t value, uint32_t value2) override; Result OnOpcodeUint64(uint64_t value) override; diff --git a/src/binary-reader-nop.h b/src/binary-reader-nop.h index 5f76d5aa..7e934116 100644 --- a/src/binary-reader-nop.h +++ b/src/binary-reader-nop.h @@ -157,6 +157,7 @@ class BinaryReaderNop : public BinaryReader { EndFunctionBody */ Result OnOpcode(Opcode Opcode) override { return Result::Ok; } Result OnOpcodeBare() override { return Result::Ok; } + Result OnOpcodeIndex(Index value) override { return Result::Ok; } Result OnOpcodeUint32(uint32_t value) override { return Result::Ok; } Result OnOpcodeUint32Uint32(uint32_t value, uint32_t value2) override { return Result::Ok; diff --git a/src/binary-reader-objdump.cc b/src/binary-reader-objdump.cc index a28652dd..8b40c2ad 100644 --- a/src/binary-reader-objdump.cc +++ b/src/binary-reader-objdump.cc @@ -169,6 +169,7 @@ class BinaryReaderObjdumpDisassemble : public BinaryReaderObjdumpBase { virtual Result OnOpcode(Opcode Opcode); virtual Result OnOpcodeBare(); + virtual Result OnOpcodeIndex(Index value); virtual Result OnOpcodeUint32(uint32_t value); virtual Result OnOpcodeUint32Uint32(uint32_t value, uint32_t value2); virtual Result OnOpcodeUint64(uint64_t value); @@ -296,6 +297,16 @@ Result BinaryReaderObjdumpDisassemble::OnOpcodeBare() { return Result::Ok; } +Result BinaryReaderObjdumpDisassemble::OnOpcodeIndex(Index value) { + Offset immediate_len = state->offset - current_opcode_offset; + const char *name; + if (current_opcode == Opcode::Call && (name = GetFunctionName(value))) + LogOpcode(data, immediate_len, "%d <%s>", value, name); + else + LogOpcode(data, immediate_len, "%d", value); + return Result::Ok; +} + Result BinaryReaderObjdumpDisassemble::OnOpcodeUint32(uint32_t value) { Offset immediate_len = state->offset - current_opcode_offset; LogOpcode(data, immediate_len, "%#x", value); diff --git a/src/binary-reader.cc b/src/binary-reader.cc index 3e0f1231..8b8e3ee7 100644 --- a/src/binary-reader.cc +++ b/src/binary-reader.cc @@ -545,7 +545,7 @@ static void read_function_body(Context* ctx, Offset end_offset) { Index depth; in_index(ctx, &depth, "br depth"); CALLBACK(OnBrExpr, depth); - CALLBACK(OnOpcodeUint32, depth); + CALLBACK(OnOpcodeIndex, depth); break; } @@ -553,7 +553,7 @@ static void read_function_body(Context* ctx, Offset end_offset) { Index depth; in_index(ctx, &depth, "br_if depth"); CALLBACK(OnBrIfExpr, depth); - CALLBACK(OnOpcodeUint32, depth); + CALLBACK(OnOpcodeIndex, depth); break; } @@ -604,7 +604,7 @@ static void read_function_body(Context* ctx, Offset end_offset) { break; case Opcode::I32Const: { - uint32_t value = 0; + uint32_t value; in_i32_leb128(ctx, &value, "i32.const value"); CALLBACK(OnI32ConstExpr, value); CALLBACK(OnOpcodeUint32, value); @@ -612,7 +612,7 @@ static void read_function_body(Context* ctx, Offset end_offset) { } case Opcode::I64Const: { - uint64_t value = 0; + uint64_t value; in_i64_leb128(ctx, &value, "i64.const value"); CALLBACK(OnI64ConstExpr, value); CALLBACK(OnOpcodeUint64, value); @@ -639,7 +639,7 @@ static void read_function_body(Context* ctx, Offset end_offset) { Index global_index; in_index(ctx, &global_index, "get_global global index"); CALLBACK(OnGetGlobalExpr, global_index); - CALLBACK(OnOpcodeUint32, global_index); + CALLBACK(OnOpcodeIndex, global_index); break; } @@ -647,7 +647,7 @@ static void read_function_body(Context* ctx, Offset end_offset) { Index local_index; in_index(ctx, &local_index, "get_local local index"); CALLBACK(OnGetLocalExpr, local_index); - CALLBACK(OnOpcodeUint32, local_index); + CALLBACK(OnOpcodeIndex, local_index); break; } @@ -655,7 +655,7 @@ static void read_function_body(Context* ctx, Offset end_offset) { Index global_index; in_index(ctx, &global_index, "set_global global index"); CALLBACK(OnSetGlobalExpr, global_index); - CALLBACK(OnOpcodeUint32, global_index); + CALLBACK(OnOpcodeIndex, global_index); break; } @@ -663,7 +663,7 @@ static void read_function_body(Context* ctx, Offset end_offset) { Index local_index; in_index(ctx, &local_index, "set_local local index"); CALLBACK(OnSetLocalExpr, local_index); - CALLBACK(OnOpcodeUint32, local_index); + CALLBACK(OnOpcodeIndex, local_index); break; } @@ -674,7 +674,7 @@ static void read_function_body(Context* ctx, Offset end_offset) { "invalid call function index: %" PRIindex, func_index); CALLBACK(OnCallExpr, func_index); - CALLBACK(OnOpcodeUint32, func_index); + CALLBACK(OnOpcodeIndex, func_index); break; } @@ -696,7 +696,7 @@ static void read_function_body(Context* ctx, Offset end_offset) { Index local_index; in_index(ctx, &local_index, "tee_local local index"); CALLBACK(OnTeeLocalExpr, local_index); - CALLBACK(OnOpcodeUint32, local_index); + CALLBACK(OnOpcodeIndex, local_index); break; } diff --git a/src/binary-reader.h b/src/binary-reader.h index 9f3426ce..6eea17b7 100644 --- a/src/binary-reader.h +++ b/src/binary-reader.h @@ -154,6 +154,7 @@ class BinaryReader { virtual Result OnOpcode(Opcode Opcode) = 0; virtual Result OnOpcodeBare() = 0; virtual Result OnOpcodeUint32(uint32_t value) = 0; + virtual Result OnOpcodeIndex(Index value) = 0; virtual Result OnOpcodeUint32Uint32(uint32_t value, uint32_t value2) = 0; virtual Result OnOpcodeUint64(uint64_t value) = 0; virtual Result OnOpcodeF32(uint32_t value) = 0; diff --git a/test/dump/basic.txt b/test/dump/basic.txt index fbafa56d..c1307ee8 100644 --- a/test/dump/basic.txt +++ b/test/dump/basic.txt @@ -100,7 +100,7 @@ Code Disassembly: 00002f: 6a | i32.add 000030: 36 02 00 | i32.store 2 0 000033: 20 00 | get_local 0 - 000035: 20 01 | get_local 0x1 + 000035: 20 01 | get_local 1 000037: 6a | i32.add 000038: 0b | end ;;; STDOUT ;;) diff --git a/test/dump/basic_dump_only.txt b/test/dump/basic_dump_only.txt index 4de40045..16a0009f 100644 --- a/test/dump/basic_dump_only.txt +++ b/test/dump/basic_dump_only.txt @@ -26,7 +26,7 @@ Code Disassembly: 00002f: 6a | i32.add 000030: 36 02 00 | i32.store 2 0 000033: 20 00 | get_local 0 - 000035: 20 01 | get_local 0x1 + 000035: 20 01 | get_local 1 000037: 6a | i32.add 000038: 0b | end ;;; STDOUT ;;) diff --git a/test/dump/br-block-named.txt b/test/dump/br-block-named.txt index 49fbb082..35996c80 100644 --- a/test/dump/br-block-named.txt +++ b/test/dump/br-block-named.txt @@ -74,7 +74,7 @@ Code Disassembly: 00001f: 1a | drop 000020: 02 40 | block 000022: 0c 00 | br 0 - 000024: 0c 03 | br 0x3 + 000024: 0c 03 | br 3 000026: 0b | end 000027: 0b | end 000028: 0b | end diff --git a/test/dump/br-block.txt b/test/dump/br-block.txt index 2aba2eff..1efef96f 100644 --- a/test/dump/br-block.txt +++ b/test/dump/br-block.txt @@ -80,9 +80,9 @@ Code Disassembly: 00001f: 1a | drop 000020: 02 40 | block 000022: 0c 00 | br 0 - 000024: 0c 01 | br 0x1 - 000026: 0c 02 | br 0x2 - 000028: 0c 03 | br 0x3 + 000024: 0c 01 | br 1 + 000026: 0c 02 | br 2 + 000028: 0c 03 | br 3 00002a: 0b | end 00002b: 0b | end 00002c: 0b | end diff --git a/test/dump/br-loop-inner-expr.txt b/test/dump/br-loop-inner-expr.txt index b07e3513..04da5d98 100644 --- a/test/dump/br-loop-inner-expr.txt +++ b/test/dump/br-loop-inner-expr.txt @@ -79,12 +79,12 @@ Code Disassembly: 00001a: 03 7f | loop i32 00001c: 41 01 | i32.const 0x1 00001e: 04 40 | if - 000020: 0c 01 | br 0x1 + 000020: 0c 01 | br 1 000022: 0b | end 000023: 41 03 | i32.const 0x3 000025: 04 40 | if 000027: 41 04 | i32.const 0x4 - 000029: 0c 02 | br 0x2 + 000029: 0c 02 | br 2 00002b: 0b | end 00002c: 41 05 | i32.const 0x5 00002e: 0b | end diff --git a/test/dump/br-loop-inner.txt b/test/dump/br-loop-inner.txt index c67e5686..74a080a3 100644 --- a/test/dump/br-loop-inner.txt +++ b/test/dump/br-loop-inner.txt @@ -65,11 +65,11 @@ Code Disassembly: 000019: 03 40 | loop 00001b: 41 01 | i32.const 0x1 00001d: 04 40 | if - 00001f: 0c 02 | br 0x2 + 00001f: 0c 02 | br 2 000021: 0b | end 000022: 41 02 | i32.const 0x2 000024: 04 40 | if - 000026: 0c 01 | br 0x1 + 000026: 0c 01 | br 1 000028: 0b | end 000029: 0b | end 00002a: 0b | end diff --git a/test/dump/br-loop.txt b/test/dump/br-loop.txt index 91a9c693..7003be39 100644 --- a/test/dump/br-loop.txt +++ b/test/dump/br-loop.txt @@ -55,7 +55,7 @@ Code Disassembly: 000017: 03 40 | loop 000019: 41 01 | i32.const 0x1 00001b: 04 40 | if - 00001d: 0c 01 | br 0x1 + 00001d: 0c 01 | br 1 00001f: 0b | end 000020: 0b | end 000021: 0b | end diff --git a/test/dump/brtable.txt b/test/dump/brtable.txt index ce29ff7e..c62cd922 100644 --- a/test/dump/brtable.txt +++ b/test/dump/brtable.txt @@ -91,7 +91,7 @@ Code Disassembly: 000027: 1a | drop 000028: 41 02 | i32.const 0x2 00002a: 1a | drop - 00002b: 0c 01 | br 0x1 + 00002b: 0c 01 | br 1 00002d: 0b | end 00002e: 0b | end 00002f: 41 03 | i32.const 0x3 diff --git a/test/dump/callimport.txt b/test/dump/callimport.txt index 5e04a008..5ebbb482 100644 --- a/test/dump/callimport.txt +++ b/test/dump/callimport.txt @@ -77,6 +77,6 @@ Code Disassembly: 00002d: 43 00 00 00 40 | f32.const 0x1p+1 000032: 10 00 | call 0 000034: 1a | drop - 000035: 10 01 | call 0x1 + 000035: 10 01 | call 1 000037: 0b | end ;;; STDOUT ;;) diff --git a/test/dump/getlocal-param.txt b/test/dump/getlocal-param.txt index b5bec83d..ef06b7d5 100644 --- a/test/dump/getlocal-param.txt +++ b/test/dump/getlocal-param.txt @@ -79,15 +79,15 @@ Code Disassembly: 000017 func[0]: 000021: 20 00 | get_local 0 000023: 1a | drop - 000024: 20 01 | get_local 0x1 + 000024: 20 01 | get_local 1 000026: 1a | drop - 000027: 20 02 | get_local 0x2 + 000027: 20 02 | get_local 2 000029: 1a | drop - 00002a: 20 03 | get_local 0x3 + 00002a: 20 03 | get_local 3 00002c: 1a | drop - 00002d: 20 04 | get_local 0x4 + 00002d: 20 04 | get_local 4 00002f: 1a | drop - 000030: 20 05 | get_local 0x5 + 000030: 20 05 | get_local 5 000032: 1a | drop 000033: 0b | end ;;; STDOUT ;;) diff --git a/test/dump/getlocal.txt b/test/dump/getlocal.txt index 48ad8af8..2cf2e7ce 100644 --- a/test/dump/getlocal.txt +++ b/test/dump/getlocal.txt @@ -93,19 +93,19 @@ Code Disassembly: 000015 func[0]: 000025: 20 00 | get_local 0 000027: 1a | drop - 000028: 20 01 | get_local 0x1 + 000028: 20 01 | get_local 1 00002a: 1a | drop - 00002b: 20 02 | get_local 0x2 + 00002b: 20 02 | get_local 2 00002d: 1a | drop - 00002e: 20 03 | get_local 0x3 + 00002e: 20 03 | get_local 3 000030: 1a | drop - 000031: 20 04 | get_local 0x4 + 000031: 20 04 | get_local 4 000033: 1a | drop - 000034: 20 05 | get_local 0x5 + 000034: 20 05 | get_local 5 000036: 1a | drop - 000037: 20 06 | get_local 0x6 + 000037: 20 06 | get_local 6 000039: 1a | drop - 00003a: 20 07 | get_local 0x7 + 00003a: 20 07 | get_local 7 00003c: 1a | drop 00003d: 0b | end ;;; STDOUT ;;) diff --git a/test/dump/loop-257-exprs-br.txt b/test/dump/loop-257-exprs-br.txt index e453511e..94cd390c 100644 --- a/test/dump/loop-257-exprs-br.txt +++ b/test/dump/loop-257-exprs-br.txt @@ -617,9 +617,9 @@ Code Disassembly: 00011a: 01 | nop 00011b: 01 | nop 00011c: 01 | nop - 00011d: 0c 01 | br 0x1 + 00011d: 0c 01 | br 1 00011f: 0c 00 | br 0 - 000121: 0c 01 | br 0x1 + 000121: 0c 01 | br 1 000123: 0c 00 | br 0 000125: 0b | end 000126: 0b | end diff --git a/test/dump/no-canonicalize.txt b/test/dump/no-canonicalize.txt index 4523095e..19453c72 100644 --- a/test/dump/no-canonicalize.txt +++ b/test/dump/no-canonicalize.txt @@ -153,7 +153,7 @@ Code Disassembly: 000071 func[1]: 000077: 20 00 | get_local 0 - 000079: 20 01 | get_local 0x1 + 000079: 20 01 | get_local 1 00007b: 11 01 00 | call_indirect 1 0 00007e: 1a | drop 00007f: 0b | end diff --git a/test/dump/relocations.txt b/test/dump/relocations.txt index 64f8fd6b..ef2c42f3 100644 --- a/test/dump/relocations.txt +++ b/test/dump/relocations.txt @@ -32,7 +32,7 @@ Code Disassembly: 000050 func[1]: 000052: 23 80 80 80 80 00 | get_global 0 000053: R_GLOBAL_INDEX_LEB 0 - 000058: 10 81 80 80 80 00 | call 0x1 + 000058: 10 81 80 80 80 00 | call 1 000059: R_FUNC_INDEX_LEB 1 00005e: 10 80 80 80 80 00 | call 0 00005f: R_FUNC_INDEX_LEB 0 diff --git a/test/dump/setlocal-param.txt b/test/dump/setlocal-param.txt index e9ac34ee..a1e71309 100644 --- a/test/dump/setlocal-param.txt +++ b/test/dump/setlocal-param.txt @@ -90,14 +90,14 @@ Code Disassembly: 000021: 41 00 | i32.const 0 000023: 21 00 | set_local 0 000025: 43 00 00 00 00 | f32.const 0x0p+0 - 00002a: 21 01 | set_local 0x1 + 00002a: 21 01 | set_local 1 00002c: 42 00 | i64.const 0 - 00002e: 21 02 | set_local 0x2 + 00002e: 21 02 | set_local 2 000030: 43 00 00 00 00 | f32.const 0x0p+0 - 000035: 21 03 | set_local 0x3 + 000035: 21 03 | set_local 3 000037: 41 00 | i32.const 0 - 000039: 21 04 | set_local 0x4 + 000039: 21 04 | set_local 4 00003b: 43 00 00 00 00 | f32.const 0x0p+0 - 000040: 21 05 | set_local 0x5 + 000040: 21 05 | set_local 5 000042: 0b | end ;;; STDOUT ;;) diff --git a/test/dump/setlocal.txt b/test/dump/setlocal.txt index 1da02c6d..388cc96e 100644 --- a/test/dump/setlocal.txt +++ b/test/dump/setlocal.txt @@ -106,18 +106,18 @@ Code Disassembly: 000025: 44 00 00 00 00 00 00 00 00 | f64.const 0x0p+0 00002e: 21 00 | set_local 0 000030: 43 00 00 00 00 | f32.const 0x0p+0 - 000035: 21 01 | set_local 0x1 + 000035: 21 01 | set_local 1 000037: 42 00 | i64.const 0 - 000039: 21 02 | set_local 0x2 + 000039: 21 02 | set_local 2 00003b: 41 00 | i32.const 0 - 00003d: 21 03 | set_local 0x3 + 00003d: 21 03 | set_local 3 00003f: 41 00 | i32.const 0 - 000041: 21 04 | set_local 0x4 + 000041: 21 04 | set_local 4 000043: 43 00 00 00 00 | f32.const 0x0p+0 - 000048: 21 05 | set_local 0x5 + 000048: 21 05 | set_local 5 00004a: 44 00 00 00 00 00 00 00 00 | f64.const 0x0p+0 - 000053: 21 06 | set_local 0x6 + 000053: 21 06 | set_local 6 000055: 42 00 | i64.const 0 - 000057: 21 07 | set_local 0x7 + 000057: 21 07 | set_local 7 000059: 0b | end ;;; STDOUT ;;) diff --git a/test/link/export.txt b/test/link/export.txt index c2fec9a0..2b3b2fdd 100644 --- a/test/link/export.txt +++ b/test/link/export.txt @@ -50,7 +50,7 @@ Code Disassembly: 00003c: 0b | end 00003d func[1]: 00003f: 41 02 | i32.const 0x2 - 000041: 10 81 80 80 80 00 | call 0x1 + 000041: 10 81 80 80 80 00 | call 1 000042: R_FUNC_INDEX_LEB 1 000047: 0b | end ;;; STDOUT ;;) diff --git a/test/link/function_calls.txt b/test/link/function_calls.txt index 5b97aa9e..338c8ec4 100644 --- a/test/link/function_calls.txt +++ b/test/link/function_calls.txt @@ -59,19 +59,19 @@ Code Disassembly: 00005a func[2]: 00005c: 20 00 | get_local 0 - 00005e: 10 82 80 80 80 00 | call 0x2 + 00005e: 10 82 80 80 80 00 | call 2 00005f: R_FUNC_INDEX_LEB 2 - 000064: 10 83 80 80 80 00 | call 0x3 + 000064: 10 83 80 80 80 00 | call 3 000065: R_FUNC_INDEX_LEB 3 00006a: 10 80 80 80 80 00 | call 0 00006b: R_FUNC_INDEX_LEB 0 000070: 0b | end 000071 func[3]: 000073: 44 00 00 00 00 00 00 f0 3f | f64.const 0x1p+0 - 00007c: 10 81 80 80 80 00 | call 0x1 + 00007c: 10 81 80 80 80 00 | call 1 00007d: R_FUNC_INDEX_LEB 1 000082: 42 0a | i64.const 10 - 000084: 10 83 80 80 80 00 | call 0x3 + 000084: 10 83 80 80 80 00 | call 3 000085: R_FUNC_INDEX_LEB 3 00008a: 0b | end ;;; STDOUT ;;) diff --git a/test/link/function_calls_incremental.txt b/test/link/function_calls_incremental.txt index 7cb3ab88..39e36d94 100644 --- a/test/link/function_calls_incremental.txt +++ b/test/link/function_calls_incremental.txt @@ -68,23 +68,23 @@ Code Disassembly: 000078: 20 00 | get_local 0 00007a: 10 80 80 80 80 00 | call 0 00007b: R_FUNC_INDEX_LEB 0 - 000080: 10 83 80 80 80 00 | call 0x3 + 000080: 10 83 80 80 80 00 | call 3 000081: R_FUNC_INDEX_LEB 3 000086: 0b | end 000087 func[4]: 000089: 44 00 00 00 00 00 00 f0 3f | f64.const 0x1p+0 - 000092: 10 81 80 80 80 00 | call 0x1 + 000092: 10 81 80 80 80 00 | call 1 000093: R_FUNC_INDEX_LEB 1 000098: 42 0a | i64.const 10 - 00009a: 10 84 80 80 80 00 | call 0x4 + 00009a: 10 84 80 80 80 00 | call 4 00009b: R_FUNC_INDEX_LEB 4 0000a0: 0b | end 0000a1 func[5]: 0000a3: 43 00 00 80 3f | f32.const 0x1p+0 - 0000a8: 10 82 80 80 80 00 | call 0x2 + 0000a8: 10 82 80 80 80 00 | call 2 0000a9: R_FUNC_INDEX_LEB 2 0000ae: 41 0a | i32.const 0xa - 0000b0: 10 85 80 80 80 00 | call 0x5 + 0000b0: 10 85 80 80 80 00 | call 5 0000b1: R_FUNC_INDEX_LEB 5 0000b6: 0b | end ;;; STDOUT ;;) diff --git a/test/link/globals.txt b/test/link/globals.txt index 9da06d71..b0676cbb 100644 --- a/test/link/globals.txt +++ b/test/link/globals.txt @@ -62,9 +62,9 @@ Custom: Code Disassembly: 000059 func[0]: - 00005b: 23 83 80 80 80 00 | get_global 0x3 + 00005b: 23 83 80 80 80 00 | get_global 3 00005c: R_GLOBAL_INDEX_LEB 3 - 000061: 23 82 80 80 80 00 | get_global 0x2 + 000061: 23 82 80 80 80 00 | get_global 2 000062: R_GLOBAL_INDEX_LEB 2 000067: 6a | i32.add 000068: 23 80 80 80 80 00 | get_global 0 @@ -74,11 +74,11 @@ Code Disassembly: 000070: R_FUNC_INDEX_LEB 0 000075: 0b | end 000076 func[1]: - 000078: 23 81 80 80 80 00 | get_global 0x1 + 000078: 23 81 80 80 80 00 | get_global 1 000079: R_GLOBAL_INDEX_LEB 1 - 00007e: 23 84 80 80 80 00 | get_global 0x4 + 00007e: 23 84 80 80 80 00 | get_global 4 00007f: R_GLOBAL_INDEX_LEB 4 - 000084: 10 81 80 80 80 00 | call 0x1 + 000084: 10 81 80 80 80 00 | call 1 000085: R_FUNC_INDEX_LEB 1 00008a: 0b | end ;;; STDOUT ;;) diff --git a/test/link/incremental.txt b/test/link/incremental.txt index cc628a58..c19a4316 100644 --- a/test/link/incremental.txt +++ b/test/link/incremental.txt @@ -96,23 +96,23 @@ Code Disassembly: 0000b2: 20 00 | get_local 0 0000b4: 10 80 80 80 80 00 | call 0 0000b5: R_FUNC_INDEX_LEB 0 - 0000ba: 10 83 80 80 80 00 | call 0x3 + 0000ba: 10 83 80 80 80 00 | call 3 0000bb: R_FUNC_INDEX_LEB 3 0000c0: 0b | end 0000c1 func[4]: 0000c3: 44 00 00 00 00 00 00 f0 3f | f64.const 0x1p+0 - 0000cc: 10 81 80 80 80 00 | call 0x1 + 0000cc: 10 81 80 80 80 00 | call 1 0000cd: R_FUNC_INDEX_LEB 1 0000d2: 42 0a | i64.const 10 - 0000d4: 10 84 80 80 80 00 | call 0x4 + 0000d4: 10 84 80 80 80 00 | call 4 0000d5: R_FUNC_INDEX_LEB 4 0000da: 0b | end 0000db func[5]: 0000dd: 43 00 00 80 3f | f32.const 0x1p+0 - 0000e2: 10 82 80 80 80 00 | call 0x2 + 0000e2: 10 82 80 80 80 00 | call 2 0000e3: R_FUNC_INDEX_LEB 2 0000e8: 41 0a | i32.const 0xa - 0000ea: 10 85 80 80 80 00 | call 0x5 + 0000ea: 10 85 80 80 80 00 | call 5 0000eb: R_FUNC_INDEX_LEB 5 0000f0: 0b | end ;;; STDOUT ;;) diff --git a/test/link/interp.txt b/test/link/interp.txt index dd9c103c..0b4690c6 100644 --- a/test/link/interp.txt +++ b/test/link/interp.txt @@ -87,12 +87,12 @@ Code Disassembly: 00007f: 0f | return 000080: 0b | end 000081 func[1]: - 000083: 10 83 80 80 80 00 | call 0x3 + 000083: 10 83 80 80 80 00 | call 3 000084: R_FUNC_INDEX_LEB 3 000089: 0f | return 00008a: 0b | end 00008b func[2]: - 00008d: 10 84 80 80 80 00 | call 0x4 + 00008d: 10 84 80 80 80 00 | call 4 00008e: R_FUNC_INDEX_LEB 4 000093: 0f | return 000094: 0b | end diff --git a/test/link/names.txt b/test/link/names.txt index 495c882c..4db64be2 100644 --- a/test/link/names.txt +++ b/test/link/names.txt @@ -71,19 +71,19 @@ Code Disassembly: 00007d <$name1>: 00007f: 41 01 | i32.const 0x1 - 000081: 10 86 80 80 80 00 | call 0x6 + 000081: 10 86 80 80 80 00 | call 6 <$name3> 000082: R_FUNC_INDEX_LEB 6 <$name3> 000087: 0b | end 000088 <$name2>: 00008a: 42 01 | i64.const 1 - 00008c: 10 82 80 80 80 00 | call 0x2 + 00008c: 10 82 80 80 80 00 | call 2 <$import_func2> 00008d: R_FUNC_INDEX_LEB 2 <$import_func2> 000092: 0b | end 000093 func[5]: 000095: 0b | end 000096 <$name3>: 000098: 41 02 | i32.const 0x2 - 00009a: 10 86 80 80 80 00 | call 0x6 + 00009a: 10 86 80 80 80 00 | call 6 <$name3> 00009b: R_FUNC_INDEX_LEB 6 <$name3> 0000a0: 0b | end ;;; STDOUT ;;) |