From 48846954d8506e1c95089a8654787fdc42cc098c Mon Sep 17 00:00:00 2001 From: Yanfeng Liu Date: Thu, 9 Jan 2025 08:37:42 +0800 Subject: [PATCH] arm/Toolchain.defs: skip -r for ELF_EXECUTABLE This avoids using `-r` option when linking executable programs. Signed-off-by: Yanfeng Liu --- arch/arm/src/common/Toolchain.defs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/arm/src/common/Toolchain.defs b/arch/arm/src/common/Toolchain.defs index c39bb70d65..2ddcf51084 100644 --- a/arch/arm/src/common/Toolchain.defs +++ b/arch/arm/src/common/Toolchain.defs @@ -546,7 +546,9 @@ ifeq ($(CONFIG_PIC),y) # Generate an executable elf, need to ignore undefined symbols LDELFFLAGS += --unresolved-symbols=ignore-in-object-files --emit-relocs else - LDELFFLAGS += -r + ifneq ($(CONFIG_BINFMT_ELF_EXECUTABLE),y) + LDELFFLAGS += -r + endif endif LDELFFLAGS += -e main -T $(call CONVERT_PATH,$(TOPDIR)$(DELIM)libs$(DELIM)libc$(DELIM)modlib$(DELIM)gnu-elf.ld)