[PATCH v3 20/31] rockchip: Add symbols for spl_reloc

Jonas Karlman jonas at kwiboo.se
Fri Mar 28 17:29:04 CET 2025


Hi Simon,

On 2025-03-28 16:35, Simon Glass wrote:
> Add various symbols so that this feature works as intended. This allows
> xPL to copy the relocating-jump code up to the top of memory, then use
> it to decompress and start the next phase.
> 
> Signed-off-by: Simon Glass <sjg at chromium.org>
> ---
> 
> (no changes since v1)
> 
>  arch/arm/mach-rockchip/u-boot-tpl-v8.lds | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/arch/arm/mach-rockchip/u-boot-tpl-v8.lds b/arch/arm/mach-rockchip/u-boot-tpl-v8.lds
> index 958a1b70aef..842bd4eb07f 100644
> --- a/arch/arm/mach-rockchip/u-boot-tpl-v8.lds
> +++ b/arch/arm/mach-rockchip/u-boot-tpl-v8.lds
> @@ -25,10 +25,21 @@ SECTIONS
>  	__image_copy_start = ADDR(.text);
>  	.text : {
>  		. = ALIGN(8);
> +		__image_copy_start = .;

__image_copy_start is defined a few lines above,
why is this duplication needed?

>  		CPUDIR/start.o (.text*)
> +
> +		/* put relocation code all together */
> +		//. = . + 0xc0;
> +		_rcode_start = .;
> +		*(.text.rcode)
> +		*(.text.rdata)
> +		_rcode_end = .;
> +
>  		*(.text*)
>  	}
>  
> +	_rcode_size = _rcode_end - _rcode_start;
> +
>  	.rodata : {
>  		. = ALIGN(8);
>  		*(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
> @@ -48,6 +59,7 @@ SECTIONS
>  	__image_copy_end = .;
>  	_end = .;
>  	_image_binary_end = .;
> +	__image_copy_end = .;

__image_copy_end is defined a few lines above,
why is this duplication needed?

Regards,
Jonas

>  
>  	.bss ALIGN(8) : {
>  		__bss_start = .;
> @@ -55,6 +67,7 @@ SECTIONS
>  		. = ALIGN(8);
>  		__bss_end = .;
>  	}
> +	__bss_size = __bss_end - __bss_start;
>  
>  	/DISCARD/ : { *(.dynsym) }
>  	/DISCARD/ : { *(.dynstr*) }



More information about the U-Boot mailing list