Skip to content

Commit

Permalink
risc-v/Toolchain.defs: guard -r in LDELFFLAGS
Browse files Browse the repository at this point in the history
This guards use of `-r` in LDELFFLAGS in risc-v common/Toolchain.defs so
that it is only used when BINFMT_ELF_RELOCATABLE is selected.

Signed-off-by: Yanfeng Liu <[email protected]>
  • Loading branch information
yf13 authored and xiaoxiang781216 committed Jan 12, 2025
1 parent 63c8de5 commit 71a4e86
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion arch/risc-v/src/common/Toolchain.defs
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,12 @@ LDMODULEFLAGS = -r -T $(call CONVERT_PATH,$(TOPDIR)/libs/libc/modlib/gnu-elf.ld)
CELFFLAGS = $(CFLAGS) -fvisibility=hidden
CXXELFFLAGS = $(CXXFLAGS) -fvisibility=hidden

LDELFFLAGS = -r -e main
LDELFFLAGS = -e main

ifeq ($(CONFIG_BINFMT_ELF_RELOCATABLE),y)
LDELFFLAGS += -r
endif

ifeq ($(CONFIG_ARCH_RV32),y)
LDELFFLAGS += --oformat elf32-littleriscv
else
Expand Down

0 comments on commit 71a4e86

Please sign in to comment.