This is an automated email from the ASF dual-hosted git repository.
ligd pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new 2f3eb6d6774 caros_x86_64: add support for generating linker map
2f3eb6d6774 is described below
commit 2f3eb6d6774ab63b75788c27bde7644da48121b2
Author: xucheng5 <[email protected]>
AuthorDate: Mon Feb 17 15:31:38 2025 +0800
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 <[email protected]>
---
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