Linking Binary files in kendryte-freertos-sdk



  • I'm looking for a way to link binary data files with the existing Kendryte toolchain and so far I have been able to do it manually but requires that I modify ELF header flags of the object file to make it compatible with RISCV Hardfloat architecture before final linking. Otherwise I get the error:

    can't link hard-float modules with soft-float modules
    

    Here is the command I'm using in one of my cmake files:

    ${CMAKE_LINKER} -r -melf64lriscv -b binary -o ${out_f} ../${src_f}
    

    Where ${src_f} is the binary source file and ${out_f} is the ELF output file to be used for final linking.

    It looks like the ELF file being generated is missing header flag: 0x00000005 to signify that the ELF is a hard-float type and as a result the linker refuses to link it.

    If anyone has a solution or a workaround please let me know - Thanks!


  • Global Moderator |  Mod

    Hi,
    Could you please attach your test code and cmake files?
    Thanks.