@lupyuen I don't know if this can help, but "li" assembly mnemonic is a pseudocode that can be converted to several real RISC-V mnemonics, including addi rd,x0,imm. on the other side, gnu objdump and gdb (that use objdump to disassemble) disassemble addi rd,x0,imm as li rd,imm by default:

objdump -d <binary>

To display real instruction, the option -M no-aliases is needed:

objdump -d -M no-aliases <binary>

on a x86_64/armv8 etc...:

riscv64-elf-objdump -d -M no-aliases <binary>

or

riscv32-elf-objdump -d -M no-aliases <binary>

Depending on target binary. Sadly, didn't found this option in gdb disassemble command.

Sign in to participate in the conversation
CleverLibre Social

CleverLibre Social is an inclusive social instance for open discussion, learning, and community.
All cultures welcome.
Hate speech and harassment strictly forbidden.