Skip to content

RISC-V sh2add not disassembled #8290

Description

@CouleeApps

Version and Platform (required):

  • Binary Ninja Version: 5.4.9853-dev
  • Edition: Ultimate
  • OS: macOS
  • OS Version: 26.4
  • CPU Architecture: M1

Bug Description:
The following byte sequence is not disassembled: 20a6c6b3 (LE), b3c6a620 (BE) whereas riscv64-elf-objdump can disassemble it.

Steps To Reproduce:

  1. Open this file: firmware.elf.zip as rv32gc
  2. Navigate to 0x280a
  3. Observe undefined
  4. Python: Architecture["rv32gc"].get_instruction_text(b"\xb3\xc6\xa6\x20", 0x280a)
  5. Observe empty result
  6. riscv64-elf-objdump -d ./firmware.elf | grep -C5 280a
  7. Observe objdump gets it: 280a: 20a6c6b3 sh2add a3,a3,a0

Expected Behavior:
I expected all instructions to be disassembled properly

Binary:
firmware.elf.zip

Additional Information:
Source available if necessary. Probably more instructions not handled? I haven't checked too far after main didn't work. Apparently there are some places even objdump doesn't get (0x2604)... Weird that my toolchain can't disassemble the binary it can compile.

Board is a CH572D

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions