From 1c8e12406e1540cd5baf1a0436636a0ef5acf197 Mon Sep 17 00:00:00 2001 From: "chao.an" Date: Thu, 21 Apr 2022 21:18:11 +0800 Subject: [PATCH] compile/opt: add config DEBUG_LINK_MAP Selecting this option will pass "-Map=$(TOPDIR)$(DELIM)nuttx.map" to ld when linking NuttX ELF. That file can be useful for verifying and debugging magic section games, and for seeing which pieces of code get eliminated with DEBUG_OPT_UNUSED_SECTIONS. Signed-off-by: chao.an --- Kconfig | 10 ++++++++++ arch/arm/src/arm/Toolchain.defs | 6 ++++++ arch/arm/src/armv6-m/Toolchain.defs | 6 ++++++ arch/arm/src/armv7-a/Toolchain.defs | 6 ++++++ arch/arm/src/armv7-m/Toolchain.defs | 6 ++++++ arch/arm/src/armv7-r/Toolchain.defs | 6 ++++++ arch/arm/src/armv8-m/Toolchain.defs | 6 ++++++ arch/arm/src/phy62xx/Make.defs | 2 -- arch/mips/src/mips32/Toolchain.defs | 6 ++++++ arch/risc-v/src/common/Toolchain.defs | 6 ++++++ arch/xtensa/src/lx6/Toolchain.defs | 6 ++++++ arch/xtensa/src/lx7/Toolchain.defs | 6 ++++++ arch/z80/src/Makefile.clang | 2 +- arch/z80/src/ez80/Toolchain.defs | 6 ++++++ boards/arm/cxd56xx/spresense/scripts/Make.defs | 1 - boards/arm/imxrt/imxrt1060-evk/scripts/Make.defs | 1 - boards/arm/imxrt/imxrt1064-evk/scripts/Make.defs | 1 - boards/arm/samv7/same70-qmtech/scripts/Make.defs | 1 - boards/arm/samv7/same70-xplained/scripts/Make.defs | 1 - boards/arm/samv7/samv71-xult/configs/knsh/Make.defs | 1 - boards/arm/samv7/samv71-xult/scripts/Make.defs | 1 - boards/arm/stm32/b-g431b-esc1/scripts/Make.defs | 3 --- boards/arm/stm32/b-g474e-dpow1/scripts/Make.defs | 3 --- boards/arm/stm32/nucleo-g431kb/scripts/Make.defs | 3 --- boards/arm/stm32/nucleo-g431rb/scripts/Make.defs | 3 --- .../stm32l4/stm32l476vg-disco/configs/knsh/Make.defs | 1 - boards/arm/stm32l4/stm32l476vg-disco/scripts/Make.defs | 1 - .../stm32l4/stm32l4r9ai-disco/configs/knsh/Make.defs | 1 - boards/arm/stm32l4/stm32l4r9ai-disco/scripts/Make.defs | 1 - boards/risc-v/bl602/bl602evb/scripts/Make.defs | 3 +-- boards/risc-v/esp32c3/esp32c3-devkit/scripts/Make.defs | 1 - boards/xtensa/esp32/esp32-devkitc/scripts/Make.defs | 1 - .../xtensa/esp32/esp32-ethernet-kit/scripts/Make.defs | 1 - boards/xtensa/esp32/esp32-wrover-kit/scripts/Make.defs | 1 - boards/xtensa/esp32/ttgo_lora_esp32/scripts/Make.defs | 1 - .../xtensa/esp32s2/esp32s2-saola-1/scripts/Make.defs | 1 - boards/xtensa/esp32s3/esp32s3-devkit/scripts/Make.defs | 1 - 37 files changed, 78 insertions(+), 35 deletions(-) diff --git a/Kconfig b/Kconfig index 6f17d66a93..04f11fb037 100644 --- a/Kconfig +++ b/Kconfig @@ -1969,6 +1969,16 @@ config DEBUG_OPT_UNUSED_SECTIONS linker by compiling with " -ffunction-sections -fdata-sections ", and linking with " --gc-sections ". +config DEBUG_LINK_MAP + bool "Generate link map file" + default y + depends on ARCH_TOOLCHAIN_GNU + ---help--- + Selecting this option will pass "-Map=$(TOPDIR)$(DELIM)nuttx.map" to ld + when linking NuttX ELF. That file can be useful for verifying + and debugging magic section games, and for seeing which + pieces of code get eliminated with DEBUG_OPT_UNUSED_SECTIONS. + endmenu # Build Setup menu "System Type" diff --git a/arch/arm/src/arm/Toolchain.defs b/arch/arm/src/arm/Toolchain.defs index dc8c98b14e..2da7e041c6 100644 --- a/arch/arm/src/arm/Toolchain.defs +++ b/arch/arm/src/arm/Toolchain.defs @@ -105,6 +105,12 @@ ifeq ($(CONFIG_DEBUG_OPT_UNUSED_SECTIONS),y) MAXOPTIMIZATION += -ffunction-sections -fdata-sections endif +# Debug link map + +ifeq ($(CONFIG_DEBUG_LINK_MAP),y) + LDFLAGS += --cref -Map=$(call CONVERT_PATH,$(TOPDIR)$(DELIM)nuttx.map) +endif + # Default toolchain CC = $(CROSSDEV)gcc diff --git a/arch/arm/src/armv6-m/Toolchain.defs b/arch/arm/src/armv6-m/Toolchain.defs index dd50320fd7..b35a9dfcfc 100644 --- a/arch/arm/src/armv6-m/Toolchain.defs +++ b/arch/arm/src/armv6-m/Toolchain.defs @@ -161,6 +161,12 @@ ifeq ($(CONFIG_DEBUG_OPT_UNUSED_SECTIONS),y) MAXOPTIMIZATION += -ffunction-sections -fdata-sections endif +# Debug link map + +ifeq ($(CONFIG_DEBUG_LINK_MAP),y) + LDFLAGS += --cref -Map=$(call CONVERT_PATH,$(TOPDIR)$(DELIM)nuttx.map) +endif + # Add the builtin library COMPILER_RT_LIB = $(shell $(CC) $(ARCHCPUFLAGS) --print-libgcc-file-name) diff --git a/arch/arm/src/armv7-a/Toolchain.defs b/arch/arm/src/armv7-a/Toolchain.defs index b9769aee8e..f4c9c638ab 100644 --- a/arch/arm/src/armv7-a/Toolchain.defs +++ b/arch/arm/src/armv7-a/Toolchain.defs @@ -136,6 +136,12 @@ ifeq ($(CONFIG_DEBUG_OPT_UNUSED_SECTIONS),y) MAXOPTIMIZATION += -ffunction-sections -fdata-sections endif +# Debug link map + +ifeq ($(CONFIG_DEBUG_LINK_MAP),y) + LDFLAGS += --cref -Map=$(call CONVERT_PATH,$(TOPDIR)$(DELIM)nuttx.map) +endif + # NuttX buildroot under Linux or Cygwin ifeq ($(CONFIG_ARMV7A_TOOLCHAIN),BUILDROOT) diff --git a/arch/arm/src/armv7-m/Toolchain.defs b/arch/arm/src/armv7-m/Toolchain.defs index 2744a7e4f4..3bb153b91d 100644 --- a/arch/arm/src/armv7-m/Toolchain.defs +++ b/arch/arm/src/armv7-m/Toolchain.defs @@ -216,6 +216,12 @@ ifeq ($(CONFIG_DEBUG_OPT_UNUSED_SECTIONS),y) MAXOPTIMIZATION += -ffunction-sections -fdata-sections endif +# Debug link map + +ifeq ($(CONFIG_DEBUG_LINK_MAP),y) + LDFLAGS += --cref -Map=$(call CONVERT_PATH,$(TOPDIR)$(DELIM)nuttx.map) +endif + # Add the builtin library COMPILER_RT_LIB = $(shell $(CC) $(ARCHCPUFLAGS) --print-libgcc-file-name) diff --git a/arch/arm/src/armv7-r/Toolchain.defs b/arch/arm/src/armv7-r/Toolchain.defs index f582aef010..f29f69db86 100644 --- a/arch/arm/src/armv7-r/Toolchain.defs +++ b/arch/arm/src/armv7-r/Toolchain.defs @@ -128,6 +128,12 @@ ifeq ($(CONFIG_DEBUG_OPT_UNUSED_SECTIONS),y) MAXOPTIMIZATION += -ffunction-sections -fdata-sections endif +# Debug link map + +ifeq ($(CONFIG_DEBUG_LINK_MAP),y) + LDFLAGS += --cref -Map=$(call CONVERT_PATH,$(TOPDIR)$(DELIM)nuttx.map) +endif + # Default toolchain CC = $(CROSSDEV)gcc diff --git a/arch/arm/src/armv8-m/Toolchain.defs b/arch/arm/src/armv8-m/Toolchain.defs index b4adbdcaaa..e53f407f46 100644 --- a/arch/arm/src/armv8-m/Toolchain.defs +++ b/arch/arm/src/armv8-m/Toolchain.defs @@ -225,6 +225,12 @@ ifeq ($(CONFIG_DEBUG_OPT_UNUSED_SECTIONS),y) MAXOPTIMIZATION += -ffunction-sections -fdata-sections endif +# Debug link map + +ifeq ($(CONFIG_DEBUG_LINK_MAP),y) + LDFLAGS += --cref -Map=$(call CONVERT_PATH,$(TOPDIR)$(DELIM)nuttx.map) +endif + # Add the builtin library COMPILER_RT_LIB = $(shell $(CC) $(ARCHCPUFLAGS) --print-libgcc-file-name) diff --git a/arch/arm/src/phy62xx/Make.defs b/arch/arm/src/phy62xx/Make.defs index 6aa45028fd..43b1554ccd 100644 --- a/arch/arm/src/phy62xx/Make.defs +++ b/arch/arm/src/phy62xx/Make.defs @@ -121,8 +121,6 @@ LDFLAGS += "$(ARCH_SRCDIR)$(DELIM)chip$(DELIM)bb_rom_sym_m0.gdbsym" context:: .buildlib -LDFLAGS += -Map="../../../phyplus_build.map" - ifndef CONFIG_PHY6222_SDK EXTRA_LIBPATHS += -L$(TOPDIR)/arch/arm/src/chip EXTRA_LIBS += -lphy62xxble diff --git a/arch/mips/src/mips32/Toolchain.defs b/arch/mips/src/mips32/Toolchain.defs index 6b19c7dd3d..d4383c5b2e 100644 --- a/arch/mips/src/mips32/Toolchain.defs +++ b/arch/mips/src/mips32/Toolchain.defs @@ -284,6 +284,12 @@ ifeq ($(CONFIG_DEBUG_OPT_UNUSED_SECTIONS),y) MAXOPTIMIZATION += -ffunction-sections -fdata-sections endif +# Debug link map + +ifeq ($(CONFIG_DEBUG_LINK_MAP),y) + LDFLAGS += --cref -Map=$(call CONVERT_PATH,$(TOPDIR)$(DELIM)nuttx.map) +endif + # Add the builtin library EXTRA_LIBS += $(wildcard $(shell $(CC) $(ARCHCPUFLAGS) --print-libgcc-file-name)) diff --git a/arch/risc-v/src/common/Toolchain.defs b/arch/risc-v/src/common/Toolchain.defs index fb52eaa0e9..f39edecf85 100644 --- a/arch/risc-v/src/common/Toolchain.defs +++ b/arch/risc-v/src/common/Toolchain.defs @@ -73,6 +73,12 @@ ifeq ($(CONFIG_DEBUG_OPT_UNUSED_SECTIONS),y) MAXOPTIMIZATION += -ffunction-sections -fdata-sections endif +# Debug link map + +ifeq ($(CONFIG_DEBUG_LINK_MAP),y) + LDFLAGS += --cref -Map=$(call CONVERT_PATH,$(TOPDIR)$(DELIM)nuttx.map) +endif + # Generic GNU RVG toolchain ifeq ($(CONFIG_RISCV_TOOLCHAIN),GNU_RVG) diff --git a/arch/xtensa/src/lx6/Toolchain.defs b/arch/xtensa/src/lx6/Toolchain.defs index 8a0e64bb1d..1914fe9697 100644 --- a/arch/xtensa/src/lx6/Toolchain.defs +++ b/arch/xtensa/src/lx6/Toolchain.defs @@ -77,6 +77,12 @@ ifeq ($(CONFIG_DEBUG_OPT_UNUSED_SECTIONS),y) MAXOPTIMIZATION += -ffunction-sections -fdata-sections endif +# Debug link map + +ifeq ($(CONFIG_DEBUG_LINK_MAP),y) + LDFLAGS += --cref -Map=$(call CONVERT_PATH,$(TOPDIR)$(DELIM)nuttx.map) +endif + # Default toolchain ifeq ($(CONFIG_XTENSA_TOOLCHAIN_XCC), y) CC = $(CROSSDEV)xcc diff --git a/arch/xtensa/src/lx7/Toolchain.defs b/arch/xtensa/src/lx7/Toolchain.defs index 9c838cc619..6d36a74de6 100644 --- a/arch/xtensa/src/lx7/Toolchain.defs +++ b/arch/xtensa/src/lx7/Toolchain.defs @@ -77,6 +77,12 @@ ifeq ($(CONFIG_DEBUG_OPT_UNUSED_SECTIONS),y) MAXOPTIMIZATION += -ffunction-sections -fdata-sections endif +# Debug link map + +ifeq ($(CONFIG_DEBUG_LINK_MAP),y) + LDFLAGS += --cref -Map=$(call CONVERT_PATH,$(TOPDIR)$(DELIM)nuttx.map) +endif + # Default toolchain ifeq ($(CONFIG_XTENSA_TOOLCHAIN_XCC), y) CC = $(CROSSDEV)xcc diff --git a/arch/z80/src/Makefile.clang b/arch/z80/src/Makefile.clang index 5a8893cc20..94eac47022 100644 --- a/arch/z80/src/Makefile.clang +++ b/arch/z80/src/Makefile.clang @@ -90,7 +90,7 @@ NUTTX = "$(TOPDIR)$(DELIM)nuttx$(EXEEXT)" nuttx$(EXEEXT): $(HEAD_OBJ) board$(DELIM)libboard$(LIBEXT) $(LINKCMD) $(Q) echo "LD: nuttx into $(NUTTX)" $(Q) "$(LD)" -o $(NUTTX) $(HEAD_OBJ) -T $(LINKCMD) --orphan-handling=error --print-memory-usage \ - $(LIBPATHS) "-(" $(LDLIBS) "-)" $(LDFLAGS) -Map="$(TOPDIR)$(DELIM)nuttx.map" + $(LIBPATHS) "-(" $(LDLIBS) "-)" $(LDFLAGS) .depend: Makefile chip$(DELIM)Make.defs $(DEPSRCS) $(TOPDIR)$(DELIM).config $(Q) if [ -e board$(DELIM)Makefile ]; then \ diff --git a/arch/z80/src/ez80/Toolchain.defs b/arch/z80/src/ez80/Toolchain.defs index 1a818199c7..decbdea53b 100644 --- a/arch/z80/src/ez80/Toolchain.defs +++ b/arch/z80/src/ez80/Toolchain.defs @@ -71,6 +71,12 @@ ifeq ($(CONFIG_DEBUG_OPT_UNUSED_SECTIONS),y) MAXOPTIMIZATION += -ffunction-sections -fdata-sections endif +# Debug link map + +ifeq ($(CONFIG_DEBUG_LINK_MAP),y) + LDFLAGS += --cref -Map=$(call CONVERT_PATH,$(TOPDIR)$(DELIM)nuttx.map) +endif + # Tool names/paths. CROSSDEV = ez80-none-elf- diff --git a/boards/arm/cxd56xx/spresense/scripts/Make.defs b/boards/arm/cxd56xx/spresense/scripts/Make.defs index 16dfaa719a..d0ae7c04af 100644 --- a/boards/arm/cxd56xx/spresense/scripts/Make.defs +++ b/boards/arm/cxd56xx/spresense/scripts/Make.defs @@ -84,7 +84,6 @@ endif # Output map file with cross reference table -LDFLAGS += -Map=$(call CONVERT_PATH,$(TOPDIR)/nuttx.map) --cref ifneq ($(CONFIG_ASMP_MEMSIZE),) LDFLAGS += --defsym=__reserved_ramsize=$(CONFIG_ASMP_MEMSIZE) endif diff --git a/boards/arm/imxrt/imxrt1060-evk/scripts/Make.defs b/boards/arm/imxrt/imxrt1060-evk/scripts/Make.defs index 34dfff71e1..660ea090e5 100644 --- a/boards/arm/imxrt/imxrt1060-evk/scripts/Make.defs +++ b/boards/arm/imxrt/imxrt1060-evk/scripts/Make.defs @@ -63,7 +63,6 @@ CMODULEFLAGS = $(CFLAGS) -mlong-calls # --target1-abs LDMODULEFLAGS = -r -e module_initialize LDMODULEFLAGS += -T $(call CONVERT_PATH,$(TOPDIR)/libs/libc/modlib/gnu-elf.ld) -LDFLAGS += -Map=$(call CONVERT_PATH,$(TOPDIR)/nuttx.map) ifeq ($(CONFIG_DEBUG_SYMBOLS),y) LDFLAGS += -g endif diff --git a/boards/arm/imxrt/imxrt1064-evk/scripts/Make.defs b/boards/arm/imxrt/imxrt1064-evk/scripts/Make.defs index 507f579c05..aaab8fefb9 100644 --- a/boards/arm/imxrt/imxrt1064-evk/scripts/Make.defs +++ b/boards/arm/imxrt/imxrt1064-evk/scripts/Make.defs @@ -63,7 +63,6 @@ CMODULEFLAGS = $(CFLAGS) -mlong-calls # --target1-abs LDMODULEFLAGS = -r -e module_initialize LDMODULEFLAGS += -T $(call CONVERT_PATH,$(TOPDIR)/libs/libc/modlib/gnu-elf.ld) -LDFLAGS += -Map=$(call CONVERT_PATH,$(TOPDIR)/nuttx.map) ifeq ($(CONFIG_DEBUG_SYMBOLS),y) LDFLAGS += -g endif diff --git a/boards/arm/samv7/same70-qmtech/scripts/Make.defs b/boards/arm/samv7/same70-qmtech/scripts/Make.defs index 5f24af22f0..8e42e5fed3 100644 --- a/boards/arm/samv7/same70-qmtech/scripts/Make.defs +++ b/boards/arm/samv7/same70-qmtech/scripts/Make.defs @@ -67,7 +67,6 @@ CMODULEFLAGS = $(CFLAGS) -mlong-calls # --target1-abs LDMODULEFLAGS = -r -e module_initialize LDMODULEFLAGS += -T $(call CONVERT_PATH,$(TOPDIR)/libs/libc/modlib/gnu-elf.ld) -LDFLAGS += -Map=$(call CONVERT_PATH,$(TOPDIR)/nuttx.map) --cref ifeq ($(CONFIG_DEBUG_SYMBOLS),y) LDFLAGS += -g endif diff --git a/boards/arm/samv7/same70-xplained/scripts/Make.defs b/boards/arm/samv7/same70-xplained/scripts/Make.defs index c7fd7eb3d6..e525da19fb 100644 --- a/boards/arm/samv7/same70-xplained/scripts/Make.defs +++ b/boards/arm/samv7/same70-xplained/scripts/Make.defs @@ -67,7 +67,6 @@ CMODULEFLAGS = $(CFLAGS) -mlong-calls # --target1-abs LDMODULEFLAGS = -r -e module_initialize LDMODULEFLAGS += -T $(call CONVERT_PATH,$(TOPDIR)/libs/libc/modlib/gnu-elf.ld) -LDFLAGS += -Map=$(call CONVERT_PATH,$(TOPDIR)/nuttx.map) --cref ifeq ($(CONFIG_DEBUG_SYMBOLS),y) LDFLAGS += -g endif diff --git a/boards/arm/samv7/samv71-xult/configs/knsh/Make.defs b/boards/arm/samv7/samv71-xult/configs/knsh/Make.defs index d5089c8273..e29c547a44 100644 --- a/boards/arm/samv7/samv71-xult/configs/knsh/Make.defs +++ b/boards/arm/samv7/samv71-xult/configs/knsh/Make.defs @@ -73,7 +73,6 @@ CMODULEFLAGS = $(CFLAGS) -mlong-calls # --target1-abs LDMODULEFLAGS = -r -e module_initialize LDMODULEFLAGS += -T $(call CONVERT_PATH,$(TOPDIR)/libs/libc/modlib/gnu-elf.ld) -LDFLAGS += -Map=$(call CONVERT_PATH,$(TOPDIR)/nuttx.map) --cref ifeq ($(CONFIG_DEBUG_SYMBOLS),y) LDFLAGS += -g endif diff --git a/boards/arm/samv7/samv71-xult/scripts/Make.defs b/boards/arm/samv7/samv71-xult/scripts/Make.defs index 5c513d129a..660a6b8242 100644 --- a/boards/arm/samv7/samv71-xult/scripts/Make.defs +++ b/boards/arm/samv7/samv71-xult/scripts/Make.defs @@ -67,7 +67,6 @@ CMODULEFLAGS = $(CFLAGS) -mlong-calls # --target1-abs LDMODULEFLAGS = -r -e module_initialize LDMODULEFLAGS += -T $(call CONVERT_PATH,$(TOPDIR)/libs/libc/modlib/gnu-elf.ld) -LDFLAGS += -Map=$(call CONVERT_PATH,$(TOPDIR)/nuttx.map) --cref ifeq ($(CONFIG_DEBUG_SYMBOLS),y) LDFLAGS += -g endif diff --git a/boards/arm/stm32/b-g431b-esc1/scripts/Make.defs b/boards/arm/stm32/b-g431b-esc1/scripts/Make.defs index a526d4b902..d9a81ccfc3 100644 --- a/boards/arm/stm32/b-g431b-esc1/scripts/Make.defs +++ b/boards/arm/stm32/b-g431b-esc1/scripts/Make.defs @@ -59,9 +59,6 @@ ifeq ($(CONFIG_DEBUG_SYMBOLS),y) LDFLAGS += -g endif -# Provide map file needed by the "Memory Allocation" view in Eclipse: -LDFLAGS += -Map=$(TOPDIR)/NuttX.map - # Embed absolute path to source file in debug information so that Eclipse # source level debugging won't get confused. See: # https://stackoverflow.com/questions/1275476/gcc-gdb-how-to-embed-absolute-path-to-source-file-in-debug-information diff --git a/boards/arm/stm32/b-g474e-dpow1/scripts/Make.defs b/boards/arm/stm32/b-g474e-dpow1/scripts/Make.defs index db270148fc..707008aa36 100644 --- a/boards/arm/stm32/b-g474e-dpow1/scripts/Make.defs +++ b/boards/arm/stm32/b-g474e-dpow1/scripts/Make.defs @@ -59,9 +59,6 @@ ifeq ($(CONFIG_DEBUG_SYMBOLS),y) LDFLAGS += -g endif -# Provide map file needed by the "Memory Allocation" view in Eclipse: -LDFLAGS += -Map=$(TOPDIR)/NuttX.map - # Embed absolute path to source file in debug information so that Eclipse # source level debugging won't get confused. See: # https://stackoverflow.com/questions/1275476/gcc-gdb-how-to-embed-absolute-path-to-source-file-in-debug-information diff --git a/boards/arm/stm32/nucleo-g431kb/scripts/Make.defs b/boards/arm/stm32/nucleo-g431kb/scripts/Make.defs index ed43db161d..91da9ad18f 100755 --- a/boards/arm/stm32/nucleo-g431kb/scripts/Make.defs +++ b/boards/arm/stm32/nucleo-g431kb/scripts/Make.defs @@ -59,9 +59,6 @@ ifeq ($(CONFIG_DEBUG_SYMBOLS),y) LDFLAGS += -g endif -# Provide map file needed by the "Memory Allocation" view in Eclipse: -LDFLAGS += -Map=$(TOPDIR)/NuttX.map - # Embed absolute path to source file in debug information so that Eclipse # source level debugging won't get confused. See: # https://stackoverflow.com/questions/1275476/gcc-gdb-how-to-embed-absolute-path-to-source-file-in-debug-information diff --git a/boards/arm/stm32/nucleo-g431rb/scripts/Make.defs b/boards/arm/stm32/nucleo-g431rb/scripts/Make.defs index b761097bb8..e042a4a5ec 100644 --- a/boards/arm/stm32/nucleo-g431rb/scripts/Make.defs +++ b/boards/arm/stm32/nucleo-g431rb/scripts/Make.defs @@ -59,9 +59,6 @@ ifeq ($(CONFIG_DEBUG_SYMBOLS),y) LDFLAGS += -g endif -# Provide map file needed by the "Memory Allocation" view in Eclipse: -LDFLAGS += -Map=$(TOPDIR)/NuttX.map - # Embed absolute path to source file in debug information so that Eclipse # source level debugging won't get confused. See: # https://stackoverflow.com/questions/1275476/gcc-gdb-how-to-embed-absolute-path-to-source-file-in-debug-information diff --git a/boards/arm/stm32l4/stm32l476vg-disco/configs/knsh/Make.defs b/boards/arm/stm32l4/stm32l476vg-disco/configs/knsh/Make.defs index 2f50025c85..8e0c8b9c3f 100644 --- a/boards/arm/stm32l4/stm32l476vg-disco/configs/knsh/Make.defs +++ b/boards/arm/stm32l4/stm32l476vg-disco/configs/knsh/Make.defs @@ -57,6 +57,5 @@ ifeq ($(CONFIG_DEBUG_SYMBOLS),y) LDFLAGS += -g endif -#LDFLAGS += -Map=$(TOPDIR)/nuttx.map #CFLAGS += -Wa,-adhln #CXXFLAGS += -Wa,-adhln diff --git a/boards/arm/stm32l4/stm32l476vg-disco/scripts/Make.defs b/boards/arm/stm32l4/stm32l476vg-disco/scripts/Make.defs index 9ccb9a8ab9..a80b20e335 100644 --- a/boards/arm/stm32l4/stm32l476vg-disco/scripts/Make.defs +++ b/boards/arm/stm32l4/stm32l476vg-disco/scripts/Make.defs @@ -55,6 +55,5 @@ ifeq ($(CONFIG_DEBUG_SYMBOLS),y) LDFLAGS += -g endif -LDFLAGS += -Map=$(TOPDIR)/nuttx.map #CFLAGS += -Wa,-adhln #CXXFLAGS += -Wa,-adhln diff --git a/boards/arm/stm32l4/stm32l4r9ai-disco/configs/knsh/Make.defs b/boards/arm/stm32l4/stm32l4r9ai-disco/configs/knsh/Make.defs index 2949881ffb..f583677e7f 100644 --- a/boards/arm/stm32l4/stm32l4r9ai-disco/configs/knsh/Make.defs +++ b/boards/arm/stm32l4/stm32l4r9ai-disco/configs/knsh/Make.defs @@ -57,6 +57,5 @@ ifeq ($(CONFIG_DEBUG_SYMBOLS),y) LDFLAGS += -g endif -#LDFLAGS += -Map=$(TOPDIR)/nuttx.map #CFLAGS += -Wa,-adhln #CXXFLAGS += -Wa,-adhln diff --git a/boards/arm/stm32l4/stm32l4r9ai-disco/scripts/Make.defs b/boards/arm/stm32l4/stm32l4r9ai-disco/scripts/Make.defs index 6ffddc46d7..f8c23463f1 100644 --- a/boards/arm/stm32l4/stm32l4r9ai-disco/scripts/Make.defs +++ b/boards/arm/stm32l4/stm32l4r9ai-disco/scripts/Make.defs @@ -55,6 +55,5 @@ ifeq ($(CONFIG_DEBUG_SYMBOLS),y) LDFLAGS += -g endif -LDFLAGS += -Map=$(TOPDIR)/nuttx.map #CFLAGS += -Wa,-adhln #CXXFLAGS += -Wa,-adhln diff --git a/boards/risc-v/bl602/bl602evb/scripts/Make.defs b/boards/risc-v/bl602/bl602evb/scripts/Make.defs index 59897b407d..20d5f04c21 100644 --- a/boards/risc-v/bl602/bl602evb/scripts/Make.defs +++ b/boards/risc-v/bl602/bl602evb/scripts/Make.defs @@ -66,6 +66,5 @@ CXXELFFLAGS = $(CXXFLAGS) LDELFFLAGS = -melf32lriscv -r -e main LDELFFLAGS += -T $(call CONVERT_PATH,$(BOARD_DIR)$(DELIM)scripts$(DELIM)gnu-elf.ld) -LDFLAGS += -melf32lriscv --cref -LDFLAGS += -Map=$(TOPDIR)/nuttx.map +LDFLAGS += -melf32lriscv diff --git a/boards/risc-v/esp32c3/esp32c3-devkit/scripts/Make.defs b/boards/risc-v/esp32c3/esp32c3-devkit/scripts/Make.defs index f857d2af8e..b21729ecc6 100644 --- a/boards/risc-v/esp32c3/esp32c3-devkit/scripts/Make.defs +++ b/boards/risc-v/esp32c3/esp32c3-devkit/scripts/Make.defs @@ -69,5 +69,4 @@ CXXELFFLAGS = $(CXXFLAGS) -fno-common LDELFFLAGS = -melf32lriscv -r -e main LDELFFLAGS += -T $(call CONVERT_PATH,$(TOPDIR)$(DELIM)binfmt$(DELIM)libelf$(DELIM)gnu-elf.ld) -LDFLAGS += -Map=$(call CONVERT_PATH,$(TOPDIR)/nuttx.map) --cref LDFLAGS += -melf32lriscv diff --git a/boards/xtensa/esp32/esp32-devkitc/scripts/Make.defs b/boards/xtensa/esp32/esp32-devkitc/scripts/Make.defs index afa6a7c39e..720e619621 100644 --- a/boards/xtensa/esp32/esp32-devkitc/scripts/Make.defs +++ b/boards/xtensa/esp32/esp32-devkitc/scripts/Make.defs @@ -99,7 +99,6 @@ CXXELFFLAGS = $(CXXFLAGS) -mtext-section-literals LDELFFLAGS = -r -e main LDELFFLAGS += -T $(call CONVERT_PATH,$(TOPDIR)$(DELIM)binfmt$(DELIM)libelf$(DELIM)gnu-elf.ld) -LDFLAGS += -Map=$(call CONVERT_PATH,$(TOPDIR)/nuttx.map) --cref ifeq ($(CONFIG_DEBUG_SYMBOLS),y) LDFLAGS += -g endif diff --git a/boards/xtensa/esp32/esp32-ethernet-kit/scripts/Make.defs b/boards/xtensa/esp32/esp32-ethernet-kit/scripts/Make.defs index 30778dbd9e..f953edc174 100644 --- a/boards/xtensa/esp32/esp32-ethernet-kit/scripts/Make.defs +++ b/boards/xtensa/esp32/esp32-ethernet-kit/scripts/Make.defs @@ -99,7 +99,6 @@ CXXELFFLAGS = $(CXXFLAGS) -mtext-section-literals LDELFFLAGS = -r -e main LDELFFLAGS += -T $(call CONVERT_PATH,$(TOPDIR)$(DELIM)binfmt$(DELIM)libelf$(DELIM)gnu-elf.ld) -LDFLAGS += -Map=$(call CONVERT_PATH,$(TOPDIR)/nuttx.map) --cref ifeq ($(CONFIG_DEBUG_SYMBOLS),y) LDFLAGS += -g endif diff --git a/boards/xtensa/esp32/esp32-wrover-kit/scripts/Make.defs b/boards/xtensa/esp32/esp32-wrover-kit/scripts/Make.defs index 855a8c1994..3500eec110 100644 --- a/boards/xtensa/esp32/esp32-wrover-kit/scripts/Make.defs +++ b/boards/xtensa/esp32/esp32-wrover-kit/scripts/Make.defs @@ -99,7 +99,6 @@ CXXELFFLAGS = $(CXXFLAGS) -mtext-section-literals LDELFFLAGS = -r -e main LDELFFLAGS += -T $(call CONVERT_PATH,$(TOPDIR)$(DELIM)binfmt$(DELIM)libelf$(DELIM)gnu-elf.ld) -LDFLAGS += -Map=$(call CONVERT_PATH,$(TOPDIR)/nuttx.map) --cref ifeq ($(CONFIG_DEBUG_SYMBOLS),y) LDFLAGS += -g endif diff --git a/boards/xtensa/esp32/ttgo_lora_esp32/scripts/Make.defs b/boards/xtensa/esp32/ttgo_lora_esp32/scripts/Make.defs index b459003113..2421fd5baf 100644 --- a/boards/xtensa/esp32/ttgo_lora_esp32/scripts/Make.defs +++ b/boards/xtensa/esp32/ttgo_lora_esp32/scripts/Make.defs @@ -99,7 +99,6 @@ CXXELFFLAGS = $(CXXFLAGS) -mtext-section-literals LDELFFLAGS = -r -e main LDELFFLAGS += -T $(call CONVERT_PATH,$(TOPDIR)$(DELIM)binfmt$(DELIM)libelf$(DELIM)gnu-elf.ld) -LDFLAGS += -Map=$(call CONVERT_PATH,$(TOPDIR)/nuttx.map) --cref ifeq ($(CONFIG_DEBUG_SYMBOLS),y) LDFLAGS += -g endif diff --git a/boards/xtensa/esp32s2/esp32s2-saola-1/scripts/Make.defs b/boards/xtensa/esp32s2/esp32s2-saola-1/scripts/Make.defs index 828e3b07da..27e7b40d00 100644 --- a/boards/xtensa/esp32s2/esp32s2-saola-1/scripts/Make.defs +++ b/boards/xtensa/esp32s2/esp32s2-saola-1/scripts/Make.defs @@ -74,7 +74,6 @@ CXXELFFLAGS = $(CXXFLAGS) -mtext-section-literals LDELFFLAGS = -r -e main LDELFFLAGS += -T $(call CONVERT_PATH,$(BOARD_DIR)$(DELIM)scripts$(DELIM)gnu-elf.ld) -LDFLAGS += -Map=$(call CONVERT_PATH,$(TOPDIR)/nuttx.map) --cref ifeq ($(CONFIG_DEBUG_SYMBOLS),y) LDFLAGS += -g endif diff --git a/boards/xtensa/esp32s3/esp32s3-devkit/scripts/Make.defs b/boards/xtensa/esp32s3/esp32s3-devkit/scripts/Make.defs index 79396a053c..c2bf6202f1 100644 --- a/boards/xtensa/esp32s3/esp32s3-devkit/scripts/Make.defs +++ b/boards/xtensa/esp32s3/esp32s3-devkit/scripts/Make.defs @@ -64,7 +64,6 @@ CXXELFFLAGS = $(CXXFLAGS) -mtext-section-literals LDELFFLAGS = -r -e main LDELFFLAGS += -T $(call CONVERT_PATH,$(BOARD_DIR)$(DELIM)scripts$(DELIM)gnu-elf.ld) -LDFLAGS += -Map=$(call CONVERT_PATH,$(TOPDIR)/nuttx.map) --cref ifeq ($(CONFIG_DEBUG_SYMBOLS),y) LDFLAGS += -g endif