[U-Boot] [PATCH] Add gc-section support for ARM

Charles Manning cdhmanning at gmail.com
Thu May 3 03:37:51 CEST 2012


Seems odd that this hasn't been done yet.
Shaves 5k off an omap overo build.

Signed-off-by: Charles Manning <cdhmanning at gmail.com>
---
 arch/arm/config.mk |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/arch/arm/config.mk b/arch/arm/config.mk
index 45f9dca..73e0cce 100644
--- a/arch/arm/config.mk
+++ b/arch/arm/config.mk
@@ -55,6 +55,10 @@ PF_CPPFLAGS_ABI := $(call cc-option,\
 		)
 PLATFORM_CPPFLAGS += $(PF_CPPFLAGS_ARM) $(PF_CPPFLAGS_ABI)
 
+PLATFORM_RELFLAGS += -ffunction-sections
+
+LDFLAGS_FINAL += --gc-sections
+
 # For EABI, make sure to provide raise()
 ifneq (,$(findstring -mabi=aapcs-linux,$(PLATFORM_CPPFLAGS)))
 # This file is parsed many times, so the string may get added multiple
-- 
1.7.1



More information about the U-Boot mailing list