From c505837e67aa4fb89964c849d905fa8d44459152 Mon Sep 17 00:00:00 2001 From: Julius Werner Date: Tue, 15 Oct 2013 17:36:17 -0700 Subject: arm: Have the linker garbage-collect unused functions and variables This patch activates -ffunction-sections and -fdata-sections for the compiler and --gc-sections for the linker. This will strip out all unused functions and static/global variables from the final binaries and reduce the amount of data we need to read over SPI. A quick test with ToT images shows a 2.5k (13%) / 10k (29%) / 12k (28%) reduction on Nyan and 3k (38%) / 23k (50%) / 13k (29%) on Pit, respectively for bootblock / romstage / ramstage. Change-Id: I052411d4ad190d0395921ac4d4677341fb91568a Signed-off-by: Julius Werner Reviewed-on: https://chromium-review.googlesource.com/177111 (cherry picked from commit 5635b138778dea67a5f179e13003132be07f7e59) Signed-off-by: Isaac Christensen Reviewed-on: http://review.coreboot.org/6904 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich --- toolchain.inc | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'toolchain.inc') diff --git a/toolchain.inc b/toolchain.inc index 326e474bee..0e3c0d194c 100644 --- a/toolchain.inc +++ b/toolchain.inc @@ -57,10 +57,7 @@ ARCHDIR-i386 := x86 ARCHDIR-x86_32 := x86 ARCHDIR-arm := arm -CFLAGS_arm += \ - -mno-unaligned-access\ - -mthumb\ - -mthumb-interwork +CFLAGS_arm := -mno-unaligned-access -ffunction-sections -fdata-sections toolchain_to_dir = \ $(foreach arch,$(ARCH_SUPPORTED),\ -- cgit v1.2.3