To prepare to update our Kbuild logic, start switching some of our cases
of adding different bit/endian linker flags via ldflags-y

Cc: Rick Chen <r...@andestech.com>
Signed-off-by: Tom Rini <tr...@konsulko.com>
---
 arch/riscv/config.mk | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/arch/riscv/config.mk b/arch/riscv/config.mk
index 84654eb3ed87..df91a85f677f 100644
--- a/arch/riscv/config.mk
+++ b/arch/riscv/config.mk
@@ -10,16 +10,14 @@
 # Rick Chen, Andes Technology Corporation <r...@andestech.com>
 #
 
-32bit-emul             := elf32lriscv
-64bit-emul             := elf64lriscv
+ldflags-$(CONFIG_32BIT) := -m elf32lriscv
+ldflags-$(CONFIG_64BIT) := -m elf64lriscv
 
 ifdef CONFIG_32BIT
-PLATFORM_LDFLAGS       += -m $(32bit-emul)
 EFI_LDS                        := elf_riscv32_efi.lds
 endif
 
 ifdef CONFIG_64BIT
-PLATFORM_LDFLAGS       += -m $(64bit-emul)
 EFI_LDS                        := elf_riscv64_efi.lds
 endif
 
@@ -29,6 +27,7 @@ PLATFORM_CPPFLAGS     += -ffixed-gp -fpic
 PLATFORM_RELFLAGS      += -fno-common -gdwarf-2 -ffunction-sections \
                           -fdata-sections
 LDFLAGS_u-boot         += --gc-sections -static -pie
+PLATFORM_LDFLAGS       += $(ldflags-y)
 
 EFI_CRT0               := crt0_riscv_efi.o
 EFI_RELOC              := reloc_riscv_efi.o
-- 
2.17.1

Reply via email to