diff options
author | Eugen.Hristev@microchip.com <Eugen.Hristev@microchip.com> | 2018-11-28 09:33:43 +0000 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2018-12-07 08:13:44 -0500 |
commit | bbaeb7ac2200c6505a76f1bf5ba85cfe58fb750b (patch) | |
tree | 5242c144c162db0ace7ef3a2e2cc31d62a5a9827 /arch | |
parent | 075b0185b6e785f08391802dccd3293ce8517a93 (diff) |
ARM: at91: lds: add test for SPL binary size and bss size
Add test for the SPL binary size and the bss section size.
This will throw an error at build time if the SPL sections
do not fit in the designated RAM area, thus avoiding oversizing the SPL.
Based on original work by Wenyou Yang.
Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-at91/arm926ejs/u-boot-spl.lds | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/arm/mach-at91/arm926ejs/u-boot-spl.lds b/arch/arm/mach-at91/arm926ejs/u-boot-spl.lds index eca78f8104..b714e93b3b 100644 --- a/arch/arm/mach-at91/arm926ejs/u-boot-spl.lds +++ b/arch/arm/mach-at91/arm926ejs/u-boot-spl.lds @@ -48,3 +48,13 @@ SECTIONS __bss_end = .; } >.sdram } + +#if defined(CONFIG_SPL_MAX_SIZE) +ASSERT(__image_copy_end - __start < (CONFIG_SPL_MAX_SIZE), \ + "SPL image too big"); +#endif + +#if defined(CONFIG_SPL_BSS_MAX_SIZE) +ASSERT(__bss_end - __bss_start < (CONFIG_SPL_BSS_MAX_SIZE), \ + "SPL image BSS too big"); +#endif |