make/disassembly: generate disassembly file

Create the nuttx.asm in the disassembly format using the objdump program.

NOTE:
'>', objdump doesn't take arguments for output file,
but result is printed to standard out, and is redirected.

Signed-off-by: fanjiangang <fanjiangang@lixiang.com>
Signed-off-by: chao an <anchao@lixiang.com>
This commit is contained in:
fanjiangang
2024-07-03 14:49:02 +08:00
committed by Xiang Xiao
parent ddbbdd7fd3
commit 5e9358b782
3 changed files with 20 additions and 0 deletions
+6
View File
@@ -410,6 +410,12 @@ config RAW_BINARY
different loaders using the GNU objcopy program. This option different loaders using the GNU objcopy program. This option
should not be selected if you are not using the GNU toolchain. 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 menuconfig UBOOT_UIMAGE
bool "U-Boot uImage" bool "U-Boot uImage"
select RAW_BINARY select RAW_BINARY
+9
View File
@@ -45,4 +45,13 @@ function(nuttx_generate_outputs target)
add_custom_target(${target}-bin ALL DEPENDS ${target}.bin) add_custom_target(${target}-bin ALL DEPENDS ${target}.bin)
file(APPEND ${CMAKE_BINARY_DIR}/nuttx.manifest "${target}.bin\n") file(APPEND ${CMAKE_BINARY_DIR}/nuttx.manifest "${target}.bin\n")
endif() 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) endfunction(nuttx_generate_outputs)
+5
View File
@@ -572,6 +572,11 @@ ifeq ($(CONFIG_UBOOT_UIMAGE),y)
cp -f uImage /tftpboot/uImage; \ cp -f uImage /tftpboot/uImage; \
fi fi
$(Q) echo "uImage" >> nuttx.manifest $(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 endif
$(call POSTBUILD, $(TOPDIR)) $(call POSTBUILD, $(TOPDIR))