diff --git a/Kconfig b/Kconfig index 2c3fef1530f0d..397ad247c4306 100644 --- a/Kconfig +++ b/Kconfig @@ -410,6 +410,12 @@ config RAW_BINARY different loaders using the GNU objcopy program. This option should not be selected if you are not using the GNU toolchain. +config RAW_DISASSEMBLY + bool "Create a disassembly file" + default n + ---help--- + Create the nuttx.asm in the disassembly format using the objdump program. + menuconfig UBOOT_UIMAGE bool "U-Boot uImage" select RAW_BINARY diff --git a/cmake/nuttx_generate_outputs.cmake b/cmake/nuttx_generate_outputs.cmake index 4cc2f3036f954..4e9f6ebd38646 100644 --- a/cmake/nuttx_generate_outputs.cmake +++ b/cmake/nuttx_generate_outputs.cmake @@ -45,4 +45,13 @@ function(nuttx_generate_outputs target) add_custom_target(${target}-bin ALL DEPENDS ${target}.bin) file(APPEND ${CMAKE_BINARY_DIR}/nuttx.manifest "${target}.bin\n") endif() + + if(CONFIG_RAW_DISASSEMBLY) + add_custom_command( + OUTPUT ${target}.asm + COMMAND ${CMAKE_OBJDUMP} -d ${target} > ${target}.asm + DEPENDS ${target}) + add_custom_target(${target}-asm ALL DEPENDS ${target}.asm) + file(APPEND ${CMAKE_BINARY_DIR}/nuttx.manifest "${target}.asm\n") + endif() endfunction(nuttx_generate_outputs) diff --git a/tools/Unix.mk b/tools/Unix.mk index 0597afc6e3a87..eac201f68bc19 100644 --- a/tools/Unix.mk +++ b/tools/Unix.mk @@ -572,6 +572,11 @@ ifeq ($(CONFIG_UBOOT_UIMAGE),y) cp -f uImage /tftpboot/uImage; \ fi $(Q) echo "uImage" >> nuttx.manifest +endif +ifeq ($(CONFIG_RAW_DISASSEMBLY),y) + @echo "CP: nuttx.asm" + $(Q) $(OBJDUMP) -d $(BIN) > nuttx.asm + $(Q) echo nuttx.bin >> nuttx.asm endif $(call POSTBUILD, $(TOPDIR))