Skip to contentSkip to conversation

ARM: pbl: keep __image_end section

PATCH In review Lucas Stach 2 participants 4 messages Nov 1, 2019 – Nov 4, 2019 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 ARM: pbl: keep __image_end section

Not all architectures are referencing the image_end section from code, in which case the linker is free to drop the section, which then messes up the calculation of the _barebox_image_size linker variable.

---
 arch/arm/lib/pbl.lds.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/lib/pbl.lds.S +1 -1
index 01ed38449523..b593d0329a7b 100644
@@ -114,7 +114,7 @@ SECTIONS
 	}
 	__piggydata_end = .;
 
-	.image_end : { *(.__image_end) }
+	.image_end : { KEEP(*(.__image_end)) }
 
 	pbl_image_size =  . - BASE;
 
Signature · 7 lines
2.23.0


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#1 lore raw

PATCH 2/2 ARM: force TEXT_BASE to zero only for relocatable build

Commit 2a94e821ba2e (ARM: For relocatable image force TEXT_BASE 0x0) intended to force the TEXT_BASE to zero for relocatable images, but the change added the Kconfig symbol overriding the TEXT_BASE unconditionally. This breaks non-relocatable images.

---
 arch/arm/Kconfig | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/Kconfig +2 -0
index 652ac24ce3fa..f4e943a8fd8a 100644
@@ -19,9 +19,11 @@ config ARM_USE_COMPRESSED_DTB
 	select UNCOMPRESS
 	select LZO_DECOMPRESS
 
+if RELOCATABLE
 config TEXT_BASE
 	hex
 	default 0x0
+endif
 
 menu "System Type"
 
Signature · 7 lines
2.23.0


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#2 lore raw

Re: [PATCH 2/2] ARM: force TEXT_BASE to zero only for relocatable build

Quoted 15 lines · Lucas Stach

Commit 2a94e821ba2e (ARM: For relocatable image force TEXT_BASE 0x0) intended to force the TEXT_BASE to zero for relocatable images, but the change added the Kconfig symbol overriding the TEXT_BASE unconditionally. This breaks non-relocatable images.

---
 arch/arm/Kconfig | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/Kconfig +0 -0
index 652ac24ce3fa..f4e943a8fd8a 100644

arch/arm/Kconfig config ARM_USE_COMPRESSED_DTB · line 26

Quoted 8 lines
arch/arm/Kconfig +2 -0
@@ -19,9 +19,11 @@ config ARM_USE_COMPRESSED_DTB
 	select UNCOMPRESS
 	select LZO_DECOMPRESS
 
+if RELOCATABLE
 config TEXT_BASE
 	hex
 	default 0x0
+endif

Does this really fix something? For example in the freescale-mx21-ads_defconfig we have CONFIG_TEXT_BASE=0xc3000000 which is still shown in Kconfig and barebox is correctly built with that TEXT_BASE. Yes, without this patch we have a duplicate symbol in Kconfig with concurrent default values, but the files seem to be sourced in the right order.

Sascha

Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#3 lore raw
In reply to Lucas Stach
Quoted 9 lines · Lucas Stach

Not all architectures are referencing the image_end section from code, in which case the linker is free to drop the section, which then messes up the calculation of the _barebox_image_size linker variable.

---
 arch/arm/lib/pbl.lds.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied (this one), thanks

Sascha

Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox