generate jal instruction for riscv gets the unexpected code
I have a riscv assembly code in test_jal.s:
jal a0, 42
And I compile it with
riscv64-linux-gnu-gcc -c -Wl,-Ttext=0x0 -nostdlib -mno-relax -o test_jal test_jal.s
Then I generate the raw riscv binary by
riscv64-linux-gnu-objcopy -O binary test_jal test_jal.bin
I use hexdump -C test_jal.bin to generate its hex code:
6F 05 00 00
Then I use riscv64-linux-gnu-objdump to disasm it. I got
jal a0,0x0
May I do something wrong?
System: WSL ubuntu 22.04 gcc verison: 9.3.0