I have assembly code in which I am using RVC instructions such as:
c.j 24
and when I try to assemble it I get 32-bit machine code, but I expect to get 16-bit because it's compressed instruction. In binary file the instruction is represented with 32 bits, and the opcode of the assembled instruction corresponds to the normal RV32I instruction JAL, instead to opcode of C.JAL, which is 16bit wide.
I compile it like this:
riscv64-unknown-linux-gnu-gcc -c -mabi=ilp32 -march=rv32imac input.s -o output
Does anyone know how to solve this?