arm: put .hash, .got.plt and .machine_param back in binaries
Subsystems (2)
PATCH 1/1 arm: put .hash, .got.plt and .machine_param back in binaries
Some targets will build fine but not boot if sections .hash and .got.plt are not present in the binary. Add them back.
Also, Exynos machines require .machine_param section in SPL. Add it.
---
This patch was prepared with the help of Rajeshwari Birge. Please test, especially if you own an Exynos-based board.
arch/arm/config.mk | 2 +- arch/arm/cpu/armv7/exynos/config.mk | 7 +++++++ arch/arm/cpu/u-boot.lds | 3 +-- spl/Makefile | 3 ++- 4 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 arch/arm/cpu/armv7/exynos/config.mk
arch/arm/config.mk +1 -1
@@ -105,4 +105,4 @@ PLATFORM_CPPFLAGS += $(call cc-option, -mword-relocations) endif # limit ourselves to the sections we want in the .bin. -OBJCFLAGS += -j .text -j .rodata -j .data -j .u_boot_list -j .rel.dyn +OBJCFLAGS += -j .text -j .rodata -j .hash -j .data -j .got.plt -j .u_boot_list -j .rel.dyn
arch/arm/cpu/armv7/exynos/config.mk new file +7 -0
@@ -0,0 +1,7 @@ +# +# Copyright (C) Albert ARIBAUD <[email protected]> +# +# SPDX-License-Identifier: GPL-2.0+ +# + +SPL_OBJCFLAGS += -j .machine_param
arch/arm/cpu/u-boot.lds +1 -2
@@ -92,8 +92,6 @@ SECTIONS } .dynsym _end : { *(.dynsym) } - .hash : { *(.hash) } - .got.plt : { *(.got.plt) } .dynbss : { *(.dynbss) } .dynstr : { *(.dynstr*) } .dynamic : { *(.dynamic*) }
@@ -101,4 +99,5 @@ SECTIONS .interp : { *(.interp*) } .gnu : { *(.gnu*) } .ARM.exidx : { *(.ARM.exidx*) } + .gnu.linkonce.armexidx : { *(.gnu.linkonce.armexidx.*) } }
spl/Makefile +2 -1
@@ -171,7 +171,8 @@ $(obj)$(BOARD)-spl.bin: $(obj)u-boot-spl.bin endif $(obj)$(SPL_BIN).bin: $(obj)$(SPL_BIN) - $(OBJCOPY) $(OBJCFLAGS) -O binary $< $@ + $(OBJCOPY) $(OBJCFLAGS) $(SPL_OBJCFLAGS) -O srec $< $(obj)$(SPL_BIN).srec + $(OBJCOPY) $(OBJCFLAGS) $(SPL_OBJCFLAGS) -O binary $< $@ GEN_UBOOT = \ cd $(obj) && $(LD) $(LDFLAGS) $(LDFLAGS_$(@F)) $(__START) \
Signature · 1 line
1.8.3.2
PATCH 1/1 arm: put .hash, .got.plt and .machine_param back in binaries
Hi Albert,
Tested on SMDK5250 and working fine.
Tested by: Rajeshwari S Shinde <[email protected]>
Regards,
Rajeshwari.
Quoted 80 lines · Albert ARIBAUD
Some targets will build fine but not boot if sections .hash and .got.plt are not present in the binary. Add them back.
Also, Exynos machines require .machine_param section in SPL. Add it.
Signed-off-by Albert ARIBAUD <[email protected]>---
This patch was prepared with the help of Rajeshwari Birge. Please test, especially if you own an Exynos-based board.arch/arm/config.mk | 2 +- arch/arm/cpu/armv7/exynos/config.mk | 7 +++++++ arch/arm/cpu/u-boot.lds | 3 +-- spl/Makefile | 3 ++- 4 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 arch/arm/cpu/armv7/exynos/config.mkarch/arm/config.mk +1
-1@@ -105,4 +105,4 @@ PLATFORM_CPPFLAGS += $(call cc-option, -mword-relocations) endif # limit ourselves to the sections we want in the .bin. -OBJCFLAGS += -j .text -j .rodata -j .data -j .u_boot_list -j .rel.dyn +OBJCFLAGS += -j .text -j .rodata -j .hash -j .data -j .got.plt -j .u_boot_list -j .rel.dynarch/arm/cpu/armv7/exynos/config.mk new file +7
-0@@ -0,0 +1,7 @@ +# +# Copyright (C) Albert ARIBAUD <[email protected]> +# +# SPDX-License-Identifier: GPL-2.0+ +# + +SPL_OBJCFLAGS += -j .machine_paramarch/arm/cpu/u-boot.lds +1
-2@@ -92,8 +92,6 @@ SECTIONS } .dynsym _end : { *(.dynsym) } - .hash : { *(.hash) } - .got.plt : { *(.got.plt) } .dynbss : { *(.dynbss) } .dynstr : { *(.dynstr*) } .dynamic : { *(.dynamic*) }@@ -101,4 +99,5 @@ SECTIONS .interp : { *(.interp*) } .gnu : { *(.gnu*) } .ARM.exidx : { *(.ARM.exidx*) } + .gnu.linkonce.armexidx : { *(.gnu.linkonce.armexidx.*) } }spl/Makefile +2
-2@@ -171,7 +171,8 @@ $(obj)$(BOARD)-spl.bin: $(obj)u-boot-spl.bin endif $(obj)$(SPL_BIN).bin: $(obj)$(SPL_BIN) - $(OBJCOPY) $(OBJCFLAGS) -O binary $< $@ + $(OBJCOPY) $(OBJCFLAGS) $(SPL_OBJCFLAGS) -O srec $< $(obj)$(SPL_BIN).srec + $(OBJCOPY) $(OBJCFLAGS) $(SPL_OBJCFLAGS) -O binary $< $@ GEN_UBOOT = \ cd $(obj) && $(LD) $(LDFLAGS) $(LDFLAGS_$(@F)) $(__START) \ --1.8.3.2
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot
Signature · 2 lines
Regards, Rajeshwari Shinde
PATCH 1/1 arm: put .hash, .got.plt and .machine_param back in binaries
In reply to Albert ARIBAUDHello Albert.
spl/Makefile $(obj)$(BOARD)-spl.bin: $(obj)u-boot-spl.bin · line 175
Quoted 4 lines
$(obj)$(SPL_BIN).bin: $(obj)$(SPL_BIN)
spl/Makefile +2
-1- $(OBJCOPY) $(OBJCFLAGS) -O binary $< $@ + $(OBJCOPY) $(OBJCFLAGS) $(SPL_OBJCFLAGS) -O srec $< $(obj)$(SPL_BIN).srec + $(OBJCOPY) $(OBJCFLAGS) $(SPL_OBJCFLAGS) -O binary $< $@
The new file .srec is not mentioned in the commit log. Is it your intentional change?
If so, please describe them separetely.
Best Regards
Masahiro Yamada
PATCH 1/1 arm: put .hash, .got.plt and .machine_param back in binaries
Hi Masahiro,
Quoted 11 lines · Masahiro Yamada
Hello Albert.
spl/Makefile $(obj)$(BOARD)-spl.bin: $(obj)u-boot-spl.bin · line 175
Quoted 4 lines
$(obj)$(SPL_BIN).bin: $(obj)$(SPL_BIN)
spl/Makefile +2
-1- $(OBJCOPY) $(OBJCFLAGS) -O binary $< $@ + $(OBJCOPY) $(OBJCFLAGS) $(SPL_OBJCFLAGS) -O srec $< $(obj)$(SPL_BIN).srec + $(OBJCOPY) $(OBJCFLAGS) $(SPL_OBJCFLAGS) -O binary $< $@The new file .srec is not mentioned in the commit log. Is it your intentional change?
Quoted 1 line
If so, please describe them separetely.
Thanks for spotting this.
Actually it is not intentional; I had added it in my tests so that I could compare binaries from different builds more easily. Unless people think it should stay, I will remove it through a v2 patch.
Quoted 2 lines
Best Regards
Masahiro Yamada
Amicalement,
Signature · 1 line
Albert.
PATCH 1/1 arm: put .hash, .got.plt and .machine_param back in binaries
Hi Albert,
Any idea when are you getting this patch in as it is effecting the SMDK5250 booting.
Regards,
Rajeshwari
Quoted 36 lines · Albert ARIBAUD
Hi Masahiro,
Quoted 6 lines · Masahiro Yamada
Hello Albert.
Quoted 3 lines
$(obj)$(SPL_BIN).bin: $(obj)$(SPL_BIN)
(quoted diff) +1
-1- $(OBJCOPY) $(OBJCFLAGS) -O binary $< $@ + $(OBJCOPY) $(OBJCFLAGS) $(SPL_OBJCFLAGS) -O srec $<$(obj)$(SPL_BIN).srec
Quoted 6 lines
Quoted 1 line
+ $(OBJCOPY) $(OBJCFLAGS) $(SPL_OBJCFLAGS) -O binary $< $@
The new file .srec is not mentioned in the commit log. Is it your intentional change?
If so, please describe them separetely.
Thanks for spotting this.
Actually it is not intentional; I had added it in my tests so that I could compare binaries from different builds more easily. Unless people think it should stay, I will remove it through a v2 patch.
Quoted 2 lines
Best Regards
Masahiro YamadaAmicalement,
--
Albert.
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot
Signature · 2 lines
Regards, Rajeshwari Shinde
PATCH 1/1 arm: put .hash, .got.plt and .machine_param back in binaries
In reply to Albert ARIBAUDSome targets will build fine but not boot if sections .hash and .got.plt are not present in the binary. Add them back.
Also, Exynos machines require .machine_param section in SPL. Add it.
---
Changes for v2:
- removed SREC format SPL generation
arch/arm/config.mk | 2 +- arch/arm/cpu/armv7/exynos/config.mk | 7 +++++++ arch/arm/cpu/u-boot.lds | 3 +-- spl/Makefile | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 arch/arm/cpu/armv7/exynos/config.mk
arch/arm/config.mk +1 -1
@@ -105,4 +105,4 @@ PLATFORM_CPPFLAGS += $(call cc-option, -mword-relocations) endif # limit ourselves to the sections we want in the .bin. -OBJCFLAGS += -j .text -j .rodata -j .data -j .u_boot_list -j .rel.dyn +OBJCFLAGS += -j .text -j .rodata -j .hash -j .data -j .got.plt -j .u_boot_list -j .rel.dyn
arch/arm/cpu/armv7/exynos/config.mk new file +7 -0
@@ -0,0 +1,7 @@ +# +# Copyright (C) Albert ARIBAUD <[email protected]> +# +# SPDX-License-Identifier: GPL-2.0+ +# + +SPL_OBJCFLAGS += -j .machine_param
arch/arm/cpu/u-boot.lds +1 -2
@@ -92,8 +92,6 @@ SECTIONS } .dynsym _end : { *(.dynsym) } - .hash : { *(.hash) } - .got.plt : { *(.got.plt) } .dynbss : { *(.dynbss) } .dynstr : { *(.dynstr*) } .dynamic : { *(.dynamic*) }
@@ -101,4 +99,5 @@ SECTIONS .interp : { *(.interp*) } .gnu : { *(.gnu*) } .ARM.exidx : { *(.ARM.exidx*) } + .gnu.linkonce.armexidx : { *(.gnu.linkonce.armexidx.*) } }
spl/Makefile +1 -1
@@ -176,7 +176,7 @@ $(obj)$(BOARD)-spl.bin: $(obj)u-boot-spl.bin endif $(obj)$(SPL_BIN).bin: $(obj)$(SPL_BIN) - $(OBJCOPY) $(OBJCFLAGS) -O binary $< $@ + $(OBJCOPY) $(OBJCFLAGS) $(SPL_OBJCFLAGS) -O binary $< $@ GEN_UBOOT = \ cd $(obj) && $(LD) $(LDFLAGS) $(LDFLAGS_$(@F)) $(__START) \
Signature · 1 line
1.8.3.2
PATCH v3 1/1 arm: put .hash, .got.plt and .machine_param back in binaries
Some targets will build fine but not boot if sections .hash and .got.plt are not present in the binary. Add them back.
Also, Exynos machines require .machine_param section in SPL. Add it.
---
V3: rebase
V2: remove SREC generation for SPL
arch/arm/config.mk | 2 +- arch/arm/cpu/armv7/exynos/config.mk | 7 +++++++ arch/arm/cpu/u-boot.lds | 3 +-- spl/Makefile | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 arch/arm/cpu/armv7/exynos/config.mk
arch/arm/config.mk +1 -1
@@ -109,5 +109,5 @@ endif ifdef CONFIG_ARM64 OBJCFLAGS += -j .text -j .rodata -j .data -j .u_boot_list -j .rela.dyn else -OBJCFLAGS += -j .text -j .rodata -j .data -j .u_boot_list -j .rel.dyn +OBJCFLAGS += -j .text -j .rodata -j .hash -j .data -j .got.plt -j .u_boot_list -j .rel.dyn endif
arch/arm/cpu/armv7/exynos/config.mk new file +7 -0
@@ -0,0 +1,7 @@ +# +# Copyright (C) Albert ARIBAUD <[email protected]> +# +# SPDX-License-Identifier: GPL-2.0+ +# + +SPL_OBJCFLAGS += -j .machine_param
arch/arm/cpu/u-boot.lds +1 -2
@@ -92,8 +92,6 @@ SECTIONS } .dynsym _end : { *(.dynsym) } - .hash : { *(.hash) } - .got.plt : { *(.got.plt) } .dynbss : { *(.dynbss) } .dynstr : { *(.dynstr*) } .dynamic : { *(.dynamic*) }
@@ -101,4 +99,5 @@ SECTIONS .interp : { *(.interp*) } .gnu : { *(.gnu*) } .ARM.exidx : { *(.ARM.exidx*) } + .gnu.linkonce.armexidx : { *(.gnu.linkonce.armexidx.*) } }
spl/Makefile +1 -1
@@ -165,7 +165,7 @@ $(obj)$(BOARD)-spl.bin: $(obj)u-boot-spl.bin endif $(obj)$(SPL_BIN).bin: $(obj)$(SPL_BIN) - $(OBJCOPY) $(OBJCFLAGS) -O binary $< $@ + $(OBJCOPY) $(OBJCFLAGS) $(SPL_OBJCFLAGS) -O binary $< $@ GEN_UBOOT = \ cd $(obj) && $(LD) $(LDFLAGS) $(LDFLAGS_$(@F)) $(__START) \
Signature · 1 line
1.8.3.2
PATCH v3 1/1 arm: put .hash, .got.plt and .machine_param back in binaries
Quoted 66 lines · Albert ARIBAUD
Some targets will build fine but not boot if sections .hash and .got.plt are not present in the binary. Add them back.
Also, Exynos machines require .machine_param section in SPL. Add it.
Signed-off-by Albert ARIBAUD <[email protected]>---
V3: rebase
V2: remove SREC generation for SPLarch/arm/config.mk | 2 +- arch/arm/cpu/armv7/exynos/config.mk | 7 +++++++ arch/arm/cpu/u-boot.lds | 3 +-- spl/Makefile | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 arch/arm/cpu/armv7/exynos/config.mkarch/arm/config.mk +1
-1@@ -109,5 +109,5 @@ endif ifdef CONFIG_ARM64 OBJCFLAGS += -j .text -j .rodata -j .data -j .u_boot_list -j .rela.dyn else -OBJCFLAGS += -j .text -j .rodata -j .data -j .u_boot_list -j .rel.dyn +OBJCFLAGS += -j .text -j .rodata -j .hash -j .data -j .got.plt -j .u_boot_list -j .rel.dyn endifarch/arm/cpu/armv7/exynos/config.mk new file +7
-0@@ -0,0 +1,7 @@ +# +# Copyright (C) Albert ARIBAUD <[email protected]> +# +# SPDX-License-Identifier: GPL-2.0+ +# + +SPL_OBJCFLAGS += -j .machine_paramarch/arm/cpu/u-boot.lds +1
-2@@ -92,8 +92,6 @@ SECTIONS } .dynsym _end : { *(.dynsym) } - .hash : { *(.hash) } - .got.plt : { *(.got.plt) } .dynbss : { *(.dynbss) } .dynstr : { *(.dynstr*) } .dynamic : { *(.dynamic*) }@@ -101,4 +99,5 @@ SECTIONS .interp : { *(.interp*) } .gnu : { *(.gnu*) } .ARM.exidx : { *(.ARM.exidx*) } + .gnu.linkonce.armexidx : { *(.gnu.linkonce.armexidx.*) } }spl/Makefile +0
-0
spl/Makefile $(obj)$(BOARD)-spl.bin: $(obj)u-boot-spl.bin · line 171
Quoted 8 lines
spl/Makefile +1
-1@@ -165,7 +165,7 @@ $(obj)$(BOARD)-spl.bin: $(obj)u-boot-spl.bin endif $(obj)$(SPL_BIN).bin: $(obj)$(SPL_BIN) - $(OBJCOPY) $(OBJCFLAGS) -O binary $< $@ + $(OBJCOPY) $(OBJCFLAGS) $(SPL_OBJCFLAGS) -O binary $< $@ GEN_UBOOT = \ cd $(obj) && $(LD) $(LDFLAGS) $(LDFLAGS_$(@F)) $(__START) \
Applied, with Rajeshwari's (hyphen-fixed) tested-by added, to u-boot-arm/master.
Amicalement,
Signature · 1 line
Albert.