* [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
* Re: [PATCH v1] x86: add support for CONFIG_REMAKE_ELF
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
1 sibling, 0 replies; 4+ messages in thread
From: Tom Rini @ 2026-07-17 20:39 UTC (permalink / raw)
To: dmukhin; +Cc: u-boot, sjg
[-- Attachment #1: Type: text/plain, Size: 443 bytes --]
On Thu, Jul 16, 2026 at 01:52:14PM -0700, dmukhin@ford.com wrote:
> 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>
Reviewed-by: Tom Rini <trini@konsulko.com>
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v1] x86: add support for CONFIG_REMAKE_ELF
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
1 sibling, 1 reply; 4+ messages in thread
From: Simon Glass @ 2026-07-19 17:59 UTC (permalink / raw)
To: dmukhin; +Cc: u-boot, sjg, trini
Hi Denis,
On 2026-07-16T20:52:14, None <dmukhin@ford.com> wrote:
> x86: add support for CONFIG_REMAKE_ELF
>
> 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>
>
> Makefile | 1 +
> arch/x86/config.mk | 8 ++++++--
> 2 files changed, 7 insertions(+), 2 deletions(-)
> That adds new 'PLATFORM_ELF_ELFLDFLAGS' make variable for injecting
> proper linker arguments when u-boot.elf is requested.
The variable is actually called PLATFORM_ELFLDFLAGS - please can you
fix the name here. Also, please use the imperative ("Add a new ...
variable") and mention what fails today when CONFIG_REMAKE_ELF is
enabled on x86 (presumably ld picking the wrong emulation).
> diff --git a/Makefile b/Makefile
> @@ -2003,6 +2003,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) \
Please can you add the same to cmd_u-boot-spl-elf just below,
otherwise CONFIG_SPL_REMAKE_ELF still fails on x86 (SPL is always
32-bit, so it wants -m elf_i386).
> diff --git a/arch/x86/config.mk b/arch/x86/config.mk
> @@ -24,9 +24,13 @@ EFI_IS_32BIT :=
> -PLATFORM_CPPFLAGS += -march=i386 -m32
> +PLATFORM_CPPFLAGS += -march=i386 -m32
> +PLATFORM_ELFFLAGS += -O elf32-i386 -B i386
> +PLATFORM_ELFLDFLAGS += -m elf_i386
Please drop the whitespace churn on the existing PLATFORM_CPPFLAGS
lines - the rest of the file uses a single space before +=
BTW, further down this file there is already:
KBUILD_LDFLAGS += -m $(if $(IS_32BIT),elf_i386,elf_x86_64)
so you could set PLATFORM_ELFLDFLAGS the same way in one line outside
the ifeq, next to that. What do you think?
I'm also interested in which x86 platform you are using - I am working
on getting Alder Lake supported at the moment.
Regards,
Simon
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v1] x86: add support for CONFIG_REMAKE_ELF
2026-07-19 17:59 ` Simon Glass
@ 2026-07-23 0:48 ` Denis Mukhin via U-Boot
0 siblings, 0 replies; 4+ messages in thread
From: Denis Mukhin via U-Boot @ 2026-07-23 0:48 UTC (permalink / raw)
To: Simon Glass; +Cc: dmukhin, u-boot, trini
On Sun, Jul 19, 2026 at 11:59:29AM -0600, Simon Glass wrote:
> Hi Denis,
>
> On 2026-07-16T20:52:14, None <dmukhin@ford.com> wrote:
> > x86: add support for CONFIG_REMAKE_ELF
> >
> > 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>
> >
> > Makefile | 1 +
> > arch/x86/config.mk | 8 ++++++--
> > 2 files changed, 7 insertions(+), 2 deletions(-)
>
> > That adds new 'PLATFORM_ELF_ELFLDFLAGS' make variable for injecting
> > proper linker arguments when u-boot.elf is requested.
>
> The variable is actually called PLATFORM_ELFLDFLAGS - please can you
> fix the name here. Also, please use the imperative ("Add a new ...
> variable") and mention what fails today when CONFIG_REMAKE_ELF is
> enabled on x86 (presumably ld picking the wrong emulation).
>
> > diff --git a/Makefile b/Makefile
> > @@ -2003,6 +2003,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) \
>
> Please can you add the same to cmd_u-boot-spl-elf just below,
> otherwise CONFIG_SPL_REMAKE_ELF still fails on x86 (SPL is always
> 32-bit, so it wants -m elf_i386).
>
> > diff --git a/arch/x86/config.mk b/arch/x86/config.mk
> > @@ -24,9 +24,13 @@ EFI_IS_32BIT :=
> > -PLATFORM_CPPFLAGS += -march=i386 -m32
> > +PLATFORM_CPPFLAGS += -march=i386 -m32
> > +PLATFORM_ELFFLAGS += -O elf32-i386 -B i386
> > +PLATFORM_ELFLDFLAGS += -m elf_i386
>
> Please drop the whitespace churn on the existing PLATFORM_CPPFLAGS
> lines - the rest of the file uses a single space before +=
>
> BTW, further down this file there is already:
>
> KBUILD_LDFLAGS += -m $(if $(IS_32BIT),elf_i386,elf_x86_64)
>
> so you could set PLATFORM_ELFLDFLAGS the same way in one line outside
> the ifeq, next to that. What do you think?
Will update!
>
> I'm also interested in which x86 platform you are using - I am working
> on getting Alder Lake supported at the moment.
Thanks for asking.
Unfortunately, I'm not able to share details about the platform.
>
> Regards,
> Simon
^ permalink raw reply [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