@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.

Follow

@popolon That's very helpful, thanks for the tip! :-)

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.