From 2f3eb6d6774ab63b75788c27bde7644da48121b2 Mon Sep 17 00:00:00 2001 From: xucheng5 Date: Mon, 17 Feb 2025 15:31:38 +0800 Subject: [PATCH] caros_x86_64: add support for generating linker map This patch introduces support for generating a linker map file during the build process for the x86_64 configuration. Signed-off-by: xucheng5 --- arch/x86_64/src/common/Toolchain.defs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/arch/x86_64/src/common/Toolchain.defs b/arch/x86_64/src/common/Toolchain.defs index 5d0abca0ef7..d789417837b 100644 --- a/arch/x86_64/src/common/Toolchain.defs +++ b/arch/x86_64/src/common/Toolchain.defs @@ -253,6 +253,16 @@ AFLAGS := $(CFLAGS) -D__ASSEMBLY__ -Wa,--divide CMODULEFLAGS = $(CFLAGS) -fvisibility=hidden LDMODULEFLAGS = -r -T $(call CONVERT_PATH,$(TOPDIR)/libs/libc/elf/gnu-elf.ld) +# Debug link map + +ifeq ($(CONFIG_DEBUG_LINK_MAP),y) + LDFLAGS += --cref -Map=$(call CONVERT_PATH,$(TOPDIR)$(DELIM)nuttx.map) +endif + +ifeq ($(CONFIG_DEBUG_SYMBOLS),y) + ARCHOPTIMIZATION += $(CONFIG_DEBUG_SYMBOLS_LEVEL) +endif + # ELF module definitions CELFFLAGS = $(CFLAGS) -fvisibility=hidden