riscvobjdumpspike

Differentiating between rv64imafd and rv64imafdc isa


How can differentiate between a rv64imafd and rv64imafdc binary without executing them? I am using few compiler flags for changing the extensions but I'm not sure how to verify it. I don't want to dump the executable every time for testing on my imafd board.
I tried to study objdump of both the files and even though there was a clear difference between the opcodes, but it is not enough. Let me know if I can share more information on this regard.


Solution

  • Even if you compile with the rv64imafd flag, your executable can be rv64imadfc if you link to a library (or a crt file) compiled with rv64imadfc.
    This seems to be the case because your final executable contains the c flag even if you compile to rv64imafd.
    If you are using https://github.com/riscv/riscv-gnu-toolchain
    The build defaults to targeting rv64gc so you are linking against rv64gc libraries. if you used --enable-multilib you are linking against rv64imafdc.

    In order to generate an rv64imafd executable you have three choices: