U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] x86: add support for CONFIG_REMAKE_ELF
@ 2026-07-16 20:52 dmukhin
  2026-07-17 20:39 ` Tom Rini
  2026-07-19 17:59 ` Simon Glass
  0 siblings, 2 replies; 4+ messages in thread
From: dmukhin @ 2026-07-16 20:52 UTC (permalink / raw)
  To: u-boot; +Cc: sjg, trini, dmukhin

From: Denis Mukhin <dmukhin@ford.com> 

Fix objcopy/ld parameters for x86 to enable CONFIG_REMAKE_ELF
configurations.

That adds new 'PLATFORM_ELF_ELFLDFLAGS' make variable for injecting
proper linker arguments when u-boot.elf is requested.

Signed-off-by: Denis Mukhin <dmukhin@ford.com>
---
CI: https://github.com/u-boot/u-boot/pull/1013
---
 Makefile           | 1 +
 arch/x86/config.mk | 8 ++++++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 8cb9a06f6a41..31db0d37a631 100644
--- a/Makefile
+++ b/Makefile
@@ -1937,6 +1937,7 @@ u-boot-with-spl-pbl.bin: spl/u-boot-spl.pbl $(UBOOT_BINLOAD) FORCE
 quiet_cmd_u-boot-elf ?= LD      $@
 	cmd_u-boot-elf ?= $(LD) u-boot-elf.o -o $@ \
 	$(if $(CONFIG_SYS_BIG_ENDIAN),-EB,-EL) \
+	$(PLATFORM_ELFLDFLAGS) \
 	-T u-boot-elf.lds --defsym=$(CONFIG_PLATFORM_ELFENTRY)=$(CONFIG_TEXT_BASE) \
 	-Ttext=$(CONFIG_TEXT_BASE)
 u-boot.elf: u-boot.bin u-boot-elf.lds
diff --git a/arch/x86/config.mk b/arch/x86/config.mk
index c2bb5549b7c8..4a6404344679 100644
--- a/arch/x86/config.mk
+++ b/arch/x86/config.mk
@@ -24,9 +24,13 @@ EFI_IS_32BIT :=
 endif
 
 ifeq ($(IS_32BIT),y)
-PLATFORM_CPPFLAGS += -march=i386 -m32
+PLATFORM_CPPFLAGS	+= -march=i386 -m32
+PLATFORM_ELFFLAGS	+= -O elf32-i386 -B i386
+PLATFORM_ELFLDFLAGS	+= -m elf_i386
 else
-PLATFORM_CPPFLAGS += $(if $(CONFIG_XPL_BUILD),,-fpic) -fno-common -march=core2 -m64
+PLATFORM_CPPFLAGS	+= $(if $(CONFIG_XPL_BUILD),,-fpic) -fno-common -march=core2 -m64
+PLATFORM_ELFFLAGS	+= -O elf64-x86-64 -B i386:x86-64
+PLATFORM_ELFLDFLAGS	+= -m elf_x86_64
 
 ifndef CONFIG_X86_HARDFP
 PLATFORM_CPPFLAGS += -mno-mmx -mno-sse
-- 
2.54.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-07-23  0:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-16 20:52 [PATCH v1] x86: add support for CONFIG_REMAKE_ELF dmukhin
2026-07-17 20:39 ` Tom Rini
2026-07-19 17:59 ` Simon Glass
2026-07-23  0:48   ` Denis Mukhin via U-Boot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox