diff mbox

[U-Boot,5/5] ARM: at91: lds: add test SPL binary size and bbs size

Message ID 20170323044152.10905-6-wenyou.yang@atmel.com
State Superseded
Delegated to: Andreas Bießmann
Headers show

Commit Message

Wenyou Yang March 23, 2017, 4:41 a.m. UTC
Add the test for the SPL binary size and the bbs section size.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
---

 arch/arm/mach-at91/arm926ejs/u-boot-spl.lds | 10 ++++++++++
 1 file changed, 10 insertions(+)
diff mbox

Patch

diff --git a/arch/arm/mach-at91/arm926ejs/u-boot-spl.lds b/arch/arm/mach-at91/arm926ejs/u-boot-spl.lds
index 1b0420611e..e142454483 100644
--- a/arch/arm/mach-at91/arm926ejs/u-boot-spl.lds
+++ b/arch/arm/mach-at91/arm926ejs/u-boot-spl.lds
@@ -49,3 +49,13 @@  SECTIONS
 		__bss_end = .;
 	} >.sdram
 }
+
+#if defined(CONFIG_SPL_MAX_SIZE)
+ASSERT(__image_copy_end - __image_copy_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