[PATCH v3 22/23] ARM: cleanup barebox proper entry

Ahmad Fatoum a.fatoum at pengutronix.de
Mon Jan 12 05:21:59 PST 2026


Hi,

On 1/8/26 4:50 PM, Sascha Hauer wrote:
> As barebox proper is now an ELF file we no longer need to map the entry
> function to the start of the image. Just link it to wherever the linker
> wants it and drop the text_entry section. Also, remove the start()
> function and set the ELF entry to barebox_non_pbl_start() directly.
> 
> While at it also remove the bare_init stuff from the barebox proper
> linker script as it's only relevant to the PBL linker script which
> is a separate script.
> 
> Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>

Reviewed-by: Ahmad Fatoum <a.fatoum at pengutronix.de>

But this could just be fixed up into the original commit that remove the
__prereloc on barebox_non_pbl_start.

Cheers,
Ahmad

> ---
>  arch/arm/cpu/start.c         | 11 -----------
>  arch/arm/lib32/barebox.lds.S |  7 +------
>  arch/arm/lib64/barebox.lds.S |  7 +------
>  3 files changed, 2 insertions(+), 23 deletions(-)
> 
> diff --git a/arch/arm/cpu/start.c b/arch/arm/cpu/start.c
> index 2498bdb894c261f587af6542ea4574c497a6edc0..c2f14736dac5948d0b751f2307690420ee4c23ca 100644
> --- a/arch/arm/cpu/start.c
> +++ b/arch/arm/cpu/start.c
> @@ -189,14 +189,3 @@ __noreturn void barebox_non_pbl_start(unsigned long membase,
>  
>  	start_barebox();
>  }
> -
> -void start(unsigned long membase, unsigned long memsize, struct handoff_data *hd);
> -/*
> - * First function in the uncompressed image. We get here from
> - * the pbl. The stack already has been set up by the pbl.
> - */
> -void __section(.text_entry) start(unsigned long membase,
> -		unsigned long memsize, struct handoff_data *hd)
> -{
> -	barebox_non_pbl_start(membase, memsize, hd);
> -}
> diff --git a/arch/arm/lib32/barebox.lds.S b/arch/arm/lib32/barebox.lds.S
> index 2fb43b4619ff29d8d21dd579d3a3002b7134ff71..e1a9495440b3330811561db2e8ea92149756ff8a 100644
> --- a/arch/arm/lib32/barebox.lds.S
> +++ b/arch/arm/lib32/barebox.lds.S
> @@ -6,7 +6,7 @@
>  
>  OUTPUT_FORMAT(BAREBOX_OUTPUT_FORMAT)
>  OUTPUT_ARCH(BAREBOX_OUTPUT_ARCH)
> -ENTRY(start)
> +ENTRY(barebox_non_pbl_start)
>  
>  PHDRS
>  {
> @@ -27,17 +27,12 @@ SECTIONS
>  	.text      :
>  	{
>  		_stext = .;
> -		*(.text_entry*)
> -		__bare_init_start = .;
> -		*(.text_bare_init*)
> -		__bare_init_end = .;
>  		. = ALIGN(0x20);
>  		__exceptions_start = .;
>  		KEEP(*(.text_exceptions*))
>  		__exceptions_stop = .;
>  		*(.text*)
>  	} :text
> -	BAREBOX_BARE_INIT_SIZE
>  
>  	. = ALIGN(4096);
>  	__start_rodata = .;
> diff --git a/arch/arm/lib64/barebox.lds.S b/arch/arm/lib64/barebox.lds.S
> index 71f677a917851270e09c6d439fe5cbe4b6b41034..2255eaf503eae3d915f51d5d7ba2e6cdc10f711a 100644
> --- a/arch/arm/lib64/barebox.lds.S
> +++ b/arch/arm/lib64/barebox.lds.S
> @@ -5,7 +5,7 @@
>  
>  OUTPUT_FORMAT(BAREBOX_OUTPUT_FORMAT)
>  OUTPUT_ARCH(BAREBOX_OUTPUT_ARCH)
> -ENTRY(start)
> +ENTRY(barebox_non_pbl_start)
>  
>  PHDRS
>  {
> @@ -26,13 +26,8 @@ SECTIONS
>  	.text      :
>  	{
>  		_stext = .;
> -		*(.text_entry*)
> -		__bare_init_start = .;
> -		*(.text_bare_init*)
> -		__bare_init_end = .;
>  		*(.text*)
>  	} :text
> -	BAREBOX_BARE_INIT_SIZE
>  
>  	. = ALIGN(4096);
>  	__start_rodata = .;
> 

-- 
Pengutronix e.K.                  |                             |
Steuerwalder Str. 21              | http://www.pengutronix.de/  |
31137 Hildesheim, Germany         | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686  | Fax:   +49-5121-206917-5555 |




More information about the barebox mailing list