From: Thomas Chou Date: Fri, 28 May 2010 04:08:10 +0000 (+0800) Subject: nios2: use gc sections to reduce image size X-Git-Tag: v2010.09-rc1~82^2^2~5 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=cb2da50f0f7b62f2ef806bdc61ec34d103542fbb;p=u-boot nios2: use gc sections to reduce image size Follow the discussion of Charles Manning and Mike Frysinger. Using gc_sections helps reduce image size. Configuring for nios2-generic board... Before, text data bss dec hex filename 123979 3724 22892 150595 24c43 /tmp/u-boot/u-boot After, text data bss dec hex filename 115983 3800 22732 142515 22cb3 /tmp/u-boot/u-boot Signed-off-by: Thomas Chou Signed-off-by: Scott McNutt --- diff --git a/arch/nios2/config.mk b/arch/nios2/config.mk index 793cc43a1c..aba96b3019 100644 --- a/arch/nios2/config.mk +++ b/arch/nios2/config.mk @@ -30,3 +30,6 @@ PLATFORM_CPPFLAGS += -DCONFIG_NIOS2 -D__NIOS2__ PLATFORM_CPPFLAGS += -G0 LDSCRIPT ?= $(SRCTREE)/$(CPUDIR)/u-boot.lds + +LDFLAGS += --gc-sections +PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections