[PATCH 3/3] malloc: Enable SYS_MALLOC_RUNTIME_INIT by default in SPL

Tom Rini trini at konsulko.com
Tue Aug 1 17:25:34 CEST 2023


On Mon, Jul 31, 2023 at 06:33:27PM -0400, Sean Anderson wrote:

> On boards with size restrictions, 1-2k can be a significant fraction of
> the binary size. Add a new SPL version of SYS_MALLOC_RUNTIME_INIT and
> enable it by default.
> 
> Signed-off-by: Sean Anderson <sean.anderson at seco.com>
> ---
> 
>  Kconfig | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/Kconfig b/Kconfig
> index 4b32286b69..3cb31a9346 100644
> --- a/Kconfig
> +++ b/Kconfig
> @@ -381,6 +381,17 @@ config SYS_MALLOC_RUNTIME_INIT
>           reduce the size of U-Boot by letting malloc's data reside in .bss
>           instead of .data.
>  
> +config SPL_SYS_MALLOC_RUNTIME_INIT
> +	bool "Initialize malloc's internal data at runtime in SPL"
> +	default y
> +	depends on SPL
> +	help
> +	 Initialize malloc's internal data structures at SPL runtime, rather
> +	 than at compile-time. This is necessary if relocating the malloc arena
> +	 from a smaller static memory to a large DDR memory. It can also reduce
> +	 the size of U-Boot by letting malloc's data reside in .bss instead of
> +	 .data.
> +
>  config TOOLS_DEBUG
>  	bool "Enable debug information for tools"
>  	help

Can you use something like grabserial (or other tooling) to quantify the
change on a platform or two?

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20230801/2c950a16/attachment.sig>


More information about the U-Boot mailing list