From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott McNutt Date: Tue, 15 Jun 2010 21:17:28 -0400 Subject: [U-Boot] [PATCH] nios2: use gc sections to reduce image size In-Reply-To: <1275019690-4671-1-git-send-email-thomas@wytron.com.tw> References: <1275019690-4671-1-git-send-email-thomas@wytron.com.tw> Message-ID: <4C182628.8050502@psyent.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Applied to: git://git.denx.de/u-boot-nios.git next Thanks, --Scott Thomas Chou wrote: > 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 > --- > arch/nios2/config.mk | 3 +++ > 1 files changed, 3 insertions(+), 0 deletions(-) > > diff --git a/arch/nios2/config.mk b/arch/nios2/config.mk > index 793cc43..aba96b3 100644 > --- a/arch/nios2/config.mk > +++ b/arch/nios2/config.mk > @@ -31,2 +31,5 @@ PLATFORM_CPPFLAGS += -DCONFIG_NIOS2 -D__NIOS2__ > > LDSCRIPT ?= $(SRCTREE)/$(CPUDIR)/u-boot.lds > + > +LDFLAGS += --gc-sections > +PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections