Signed-off-by: Michael Schwingen <[email protected]>
---
 config.mk                |    6 ++++++
 include/configs/actux1.h |    1 +
 include/configs/actux2.h |    1 +
 include/configs/actux3.h |    1 +
 include/configs/actux4.h |    1 +
 5 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/config.mk b/config.mk
index 66f8fe6..f7c7760 100644
--- a/config.mk
+++ b/config.mk
@@ -152,6 +152,9 @@ endif
 RELFLAGS= $(PLATFORM_RELFLAGS)
 DBGFLAGS= -g # -DDEBUG
 OPTFLAGS= -Os #-fomit-frame-pointer
+ifeq ($(CONFIG_USE_FUNCTION_SECTIONS),y)
+OPTFLAGS += -ffunction-sections
+endif
 ifndef LDSCRIPT
 #LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot.lds.debug
 ifeq ($(CONFIG_NAND_U_BOOT),y)
@@ -205,6 +208,9 @@ endif
 AFLAGS := $(AFLAGS_DEBUG) -D__ASSEMBLY__ $(CPPFLAGS)
 
 LDFLAGS += -Bstatic -T $(obj)u-boot.lds $(PLATFORM_LDFLAGS)
+ifeq ($(CONFIG_USE_FUNCTION_SECTIONS),y)
+LDFLAGS += --gc-sections
+endif
 ifneq ($(CONFIG_SYS_TEXT_BASE),)
 LDFLAGS += -Ttext $(CONFIG_SYS_TEXT_BASE)
 endif
diff --git a/include/configs/actux1.h b/include/configs/actux1.h
index 2ffedf1..e4f7358 100644
--- a/include/configs/actux1.h
+++ b/include/configs/actux1.h
@@ -28,6 +28,7 @@
 
 #define CONFIG_IXP425                  1
 #define CONFIG_ACTUX1                  1
+#define CONFIG_USE_FUNCTION_SECTIONS    1
 
 #define CONFIG_DISPLAY_CPUINFO         1
 #define CONFIG_DISPLAY_BOARDINFO       1
diff --git a/include/configs/actux2.h b/include/configs/actux2.h
index 4ba3ce0..bef5bc0 100644
--- a/include/configs/actux2.h
+++ b/include/configs/actux2.h
@@ -28,6 +28,7 @@
 
 #define CONFIG_IXP425                  1
 #define CONFIG_ACTUX2                  1
+#define CONFIG_USE_FUNCTION_SECTIONS    1
 
 #define CONFIG_DISPLAY_CPUINFO         1
 #define CONFIG_DISPLAY_BOARDINFO       1
diff --git a/include/configs/actux3.h b/include/configs/actux3.h
index 4b9b496..33d2db1 100644
--- a/include/configs/actux3.h
+++ b/include/configs/actux3.h
@@ -28,6 +28,7 @@
 
 #define CONFIG_IXP425                  1
 #define CONFIG_ACTUX3                  1
+#define CONFIG_USE_FUNCTION_SECTIONS    1
 
 #define CONFIG_DISPLAY_CPUINFO         1
 #define CONFIG_DISPLAY_BOARDINFO       1
diff --git a/include/configs/actux4.h b/include/configs/actux4.h
index ac7d1ba..ed68302 100644
--- a/include/configs/actux4.h
+++ b/include/configs/actux4.h
@@ -28,6 +28,7 @@
 
 #define CONFIG_IXP425                  1
 #define CONFIG_ACTUX4                  1
+#define CONFIG_USE_FUNCTION_SECTIONS    1
 
 #define CONFIG_DISPLAY_CPUINFO         1
 #define CONFIG_DISPLAY_BOARDINFO       1
-- 
1.7.2.3

_______________________________________________
U-Boot mailing list
[email protected]
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to