diff --git a/src/binary-reader-objdump.cc b/src/binary-reader-objdump.cc index b2ae36544..6c7039abb 100644 --- a/src/binary-reader-objdump.cc +++ b/src/binary-reader-objdump.cc @@ -2161,7 +2161,7 @@ Result BinaryReaderObjdump::OnDylinkNeeded(std::string_view so_name) { } Result BinaryReaderObjdump::OnRelocCount(Index count, Index section_index) { - BinaryReaderObjdumpBase::OnRelocCount(count, section_index); + CHECK_RESULT(BinaryReaderObjdumpBase::OnRelocCount(count, section_index)); PrintDetails(" - relocations for section: %d (" PRIstringview ") [%d]\n", section_index, WABT_PRINTF_STRING_VIEW_ARG(GetSectionName(section_index)), diff --git a/test/binary/bad-relocs.txt b/test/binary/bad-relocs.txt index 6240ced06..2ca701a61 100644 --- a/test/binary/bad-relocs.txt +++ b/test/binary/bad-relocs.txt @@ -4,7 +4,10 @@ magic version section("reloc.BAD") { reloc_section[99] - reloc_count[0] + reloc_count[1] + reloc_type[0] ;; R_WASM_FUNCTION_INDEX_LEB + offset[0] + index[0] } (;; STDERR ;;; invalid relocation section index: 99 @@ -20,7 +23,6 @@ Section Details: Custom: - name: "reloc.BAD" - - relocations for section: 99 () [0] Code Disassembly: