1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Makefile.include: Generate lst file using objdump

The MAP file does not provide all information necessary to do a full
analize of generated code. This automatically generate the LST file
with all relavant C and ASM code to help inspect code generated.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
This commit is contained in:
Gerson Fernando Budke 2023-06-17 11:48:01 +02:00
parent 755442fe27
commit ae61702ffe

View File

@ -624,7 +624,7 @@ include $(RIOTMAKE)/modules.inc.mk
.PHONY: all link clean flash flash-only termdeps term doc debug debug-server reset objdump help info-modules
.PHONY: print-size elffile binfile hexfile flashfile cosy
.PHONY: print-size elffile lstfile binfile hexfile flashfile cosy
.PHONY: ..in-docker-container
# Targets that depend on FORCE will always be rebuilt. Contrary to a .PHONY
@ -658,6 +658,7 @@ HEXFILE ?= $(ELFFILE:.elf=.hex)
BINFILE ?= $(ELFFILE:.elf=.bin)
HASHFILE ?= $(BINFILE)
MAPFILE ?= $(ELFFILE:.elf=.map)
LSTFILE ?= $(ELFFILE:.elf=.lst)
ifneq (,$(filter suit,$(USEMODULE)))
include $(RIOTMAKE)/suit.base.inc.mk
@ -680,6 +681,7 @@ DEBUG_ELFFILE ?= $(ELFFILE)
elffile: $(ELFFILE)
hexfile: $(HEXFILE)
binfile: $(BINFILE)
lstfile: $(LSTFILE)
# FLASHFILE is the file used by the flasher
# Usually set to $(ELFFILE), $(HEXFILE) or $(BINFILE) in the board/flasher
# or application specific files
@ -691,6 +693,15 @@ endif
BUILD_FILES += $(ELFFILE) $(BINFILE) $(FLASHFILE) $(HASHFILE)
# when not in CI, aid developers in debugging the firmware with a full memory
# layout and disassembly provided by the lst file:
ifneq ($(RIOT_CI_BUILD),1)
# as of now, the xtensa tools cannot create lst files
ifeq (,$(findstring xtensa,$(PREFIX)))
BUILD_FILES += $(LSTFILE)
endif
endif
# variables used to compile and link c++
ifneq (,$(filter cpp,$(USEMODULE)))
CPPMIX ?= 1
@ -779,6 +790,11 @@ $(BUILD_DIR)/CACHEDIR.TAG:
%.bin: %.elf
$(Q)$(OBJCOPY) $(OFLAGS) -Obinary $< $@
%.lst: %.elf
$(Q)$(OBJDUMP) --disassemble-all --file-headers --file-offsets \
--section-headers --line-numbers --private-headers --source --wide \
--disassemble-zeroes $< > $@
endif # BUILD_IN_DOCKER
# Check given command is available in the path