|
| 1 | +# List of format the tool supports for converting, for example, |
| 2 | +# GNU tools uses objectcopyy, which supports the following: ihex, srec, binary |
| 3 | +set_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. |
| 8 | +set_property(TARGET bintools PROPERTY elfconvert_command ${CMAKE_COMMAND}) |
| 9 | + |
| 10 | +set_property(TARGET bintools PROPERTY elfconvert_flag |
| 11 | + -DFROMELF=${CMAKE_FROMELF} |
| 12 | +) |
| 13 | + |
| 14 | +set_property(TARGET bintools PROPERTY elfconvert_flag_final |
| 15 | + -P ${CMAKE_CURRENT_LIST_DIR}/elfconvert_command.cmake) |
| 16 | + |
| 17 | +set_property(TARGET bintools PROPERTY elfconvert_flag_strip_all "-DSTRIP_ALL=True") |
| 18 | +set_property(TARGET bintools PROPERTY elfconvert_flag_strip_debug "-DSTRIP_DEBUG=True") |
| 19 | + |
| 20 | +set_property(TARGET bintools PROPERTY elfconvert_flag_intarget "-DINTARGET=") |
| 21 | +set_property(TARGET bintools PROPERTY elfconvert_flag_outtarget "-DOUTTARGET=") |
| 22 | + |
| 23 | +set_property(TARGET bintools PROPERTY elfconvert_flag_section_remove "-DREMOVE_SECTION=") |
| 24 | +set_property(TARGET bintools PROPERTY elfconvert_flag_section_only "-DONLY_SECTION=") |
| 25 | + |
| 26 | +# mwdt doesn't handle rename, consider adjusting abstraction. |
| 27 | +set_property(TARGET bintools PROPERTY elfconvert_flag_section_rename "-DRENAME_SECTION=") |
| 28 | + |
| 29 | +set_property(TARGET bintools PROPERTY elfconvert_flag_gapfill "-DGAP_FILL=") |
| 30 | +set_property(TARGET bintools PROPERTY elfconvert_flag_srec_len "-DSREC_LEN=") |
| 31 | + |
| 32 | +set_property(TARGET bintools PROPERTY elfconvert_flag_infile "-DINFILE=") |
| 33 | +set_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 | + |
| 45 | +set_property(TARGET bintools PROPERTY disassembly_command ${CMAKE_FROMELF}) |
| 46 | +set_property(TARGET bintools PROPERTY disassembly_flag --disassemble) |
| 47 | +set_property(TARGET bintools PROPERTY disassembly_flag_final "") |
| 48 | +set_property(TARGET bintools PROPERTY disassembly_flag_inline_source --interleave=source) |
| 49 | +set_property(TARGET bintools PROPERTY disassembly_flag_all "") |
| 50 | + |
| 51 | +set_property(TARGET bintools PROPERTY disassembly_flag_infile "") |
| 52 | +set_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. |
| 64 | +set_property(TARGET bintools PROPERTY readelf_command ${CMAKE_FROMELF}) |
| 65 | + |
| 66 | +set_property(TARGET bintools PROPERTY readelf_flag "") |
| 67 | +set_property(TARGET bintools PROPERTY readelf_flag_final "") |
| 68 | +set_property(TARGET bintools PROPERTY readelf_flag_headers --text) |
| 69 | + |
| 70 | +set_property(TARGET bintools PROPERTY readelf_flag_infile "") |
| 71 | +set_property(TARGET bintools PROPERTY readelf_flag_outfile "--output=") |
0 commit comments