1# List of format the tool supports for converting, for example, 2# GNU tools uses objectcopy, which supports the following: ihex, srec, binary 3set_property(TARGET bintools PROPERTY elfconvert_formats ihex binary) 4 5# armclang toolchain does not support all options in a single command 6# Therefore a CMake script is used, so that multiple commands can be executed 7# successively. 8set_property(TARGET bintools PROPERTY elfconvert_command ${CMAKE_COMMAND}) 9 10set_property(TARGET bintools PROPERTY elfconvert_flag 11 -DFROMELF=${CMAKE_FROMELF} 12) 13 14set_property(TARGET bintools PROPERTY elfconvert_flag_final 15 -P ${CMAKE_CURRENT_LIST_DIR}/elfconvert_command.cmake) 16 17set_property(TARGET bintools PROPERTY elfconvert_flag_strip_all "-DSTRIP_ALL=True") 18set_property(TARGET bintools PROPERTY elfconvert_flag_strip_debug "-DSTRIP_DEBUG=True") 19 20set_property(TARGET bintools PROPERTY elfconvert_flag_intarget "-DINTARGET=") 21set_property(TARGET bintools PROPERTY elfconvert_flag_outtarget "-DOUTTARGET=") 22 23set_property(TARGET bintools PROPERTY elfconvert_flag_section_remove "-DREMOVE_SECTION=") 24set_property(TARGET bintools PROPERTY elfconvert_flag_section_only "-DONLY_SECTION=") 25 26# mwdt doesn't handle rename, consider adjusting abstraction. 27set_property(TARGET bintools PROPERTY elfconvert_flag_section_rename "-DRENAME_SECTION=") 28 29set_property(TARGET bintools PROPERTY elfconvert_flag_gapfill "-DGAP_FILL=") 30set_property(TARGET bintools PROPERTY elfconvert_flag_srec_len "-DSREC_LEN=") 31 32set_property(TARGET bintools PROPERTY elfconvert_flag_infile "-DINFILE=") 33set_property(TARGET bintools PROPERTY elfconvert_flag_outfile "-DOUTFILE=") 34 35# 36# - disassembly : Name of command for disassembly of files 37# In this implementation `fromelf` is used 38# disassembly_flag : --disassemble 39# disassembly_flag_final : empty 40# disassembly_flag_inline_source : --interleave=source 41# disassembly_flag_all : empty, fromelf does not differentiate on this. 42# disassembly_flag_infile : empty, fromelf doesn't take arguments for filenames 43# disassembly_flag_outfile : --output 44 45set_property(TARGET bintools PROPERTY disassembly_command ${CMAKE_FROMELF}) 46set_property(TARGET bintools PROPERTY disassembly_flag --disassemble) 47set_property(TARGET bintools PROPERTY disassembly_flag_final "") 48set_property(TARGET bintools PROPERTY disassembly_flag_inline_source --interleave=source) 49set_property(TARGET bintools PROPERTY disassembly_flag_all "") 50 51set_property(TARGET bintools PROPERTY disassembly_flag_infile "") 52set_property(TARGET bintools PROPERTY disassembly_flag_outfile "--output=" ) 53 54# 55# - readelf : Name of command for reading elf files. 56# In this implementation `fromelf` is used 57# readelf_flag : empty 58# readelf_flag_final : empty 59# readelf_flag_headers : --text 60# readelf_flag_infile : empty, fromelf doesn't take arguments for filenames 61# readelf_flag_outfile : --output 62 63# This is using fromelf from arm-ds / Keil. 64set_property(TARGET bintools PROPERTY readelf_command ${CMAKE_FROMELF}) 65 66set_property(TARGET bintools PROPERTY readelf_flag "") 67set_property(TARGET bintools PROPERTY readelf_flag_final "") 68set_property(TARGET bintools PROPERTY readelf_flag_headers --text) 69 70set_property(TARGET bintools PROPERTY readelf_flag_infile "") 71set_property(TARGET bintools PROPERTY readelf_flag_outfile "--output=") 72