[PATCH v2 04/13] ARM: lds: Add SoC specific sections to go before .text_head_prologue

Jules Maselbas jmaselbas at zdiv.net
Wed May 24 16:43:19 PDT 2023


On sunxi platforms the boot rom (BROM) looks for a specific header which
will also be loaded in memory, causing pbl, or barebox, image not loaded
at the expected BASE addresse. This also cause an issue with relocatable
pbl: instruction used for relocation expect the image to be aligned on a
4K page boundary.

The proposed solution here is to allow to soc specific section to be put
in the very begging of the .text section, before anything else.

Signed-off-by: Jules Maselbas <jmaselbas at zdiv.net>
---
rfc->v2:
 - fix typo in commit title
 - replace the use of macro with SORT_BY_NAME(.text_head_soc_header*)

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

diff --git a/arch/arm/lib/pbl.lds.S b/arch/arm/lib/pbl.lds.S
index 114ec7bc81..059909806e 100644
--- a/arch/arm/lib/pbl.lds.S
+++ b/arch/arm/lib/pbl.lds.S
@@ -27,6 +27,7 @@ SECTIONS
 	.text      :
 	{
 		_stext = .;
+		*(SORT_BY_NAME(.text_head_soc_header*))
 		*(.text_head_prologue*)
 		*(.text_head_entry*)
 		__bare_init_start = .;
-- 
2.40.1




More information about the barebox mailing list