Skip to contentSkip to conversation

arm: Don't use printf() in SPL builds

PATCH New Stefan Roese 1 participant 1 message May 8, 2012 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/7 arm: Don't use printf() in SPL builds

From: Simon Glass <[email protected]>

raise() likes to call printf() if it is available, but in SPL builds it either is not available, or adds a large chunk to the resulting image size.

So don't call it even if it is available.

This change reduces SPL size from 10KB to 6.3KB on hawkboard, for example, using generic relocation.

---
 arch/arm/lib/eabi_compat.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm/lib/eabi_compat.c +2 -1
index 2028dbd..44eebe0 100644
@@ -13,7 +13,8 @@
 
 int raise (int signum)
 {
-#if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
+	/* Even if printf() is available, it's large. Punt it for SPL builds */
+#if !defined(CONFIG_SPL_BUILD)
 	printf("raise: Signal # %d caught\n", signum);
 #endif
 	return 0;
Signature · 1 line
1.7.10.1