diff options
author | Andrew Thoelke <andrew.thoelke@arm.com> | 2014-03-18 07:13:52 +0000 |
---|---|---|
committer | Andrew Thoelke <andrew.thoelke@arm.com> | 2014-03-26 21:54:37 +0000 |
commit | dccc537a7243d784e0b8b81ce1634e385c3b048b (patch) | |
tree | ffe79e5b2d764b904dd7253df1e9983da5e6b132 /Makefile | |
parent | 2eb01d341ff14c003d381cde97fbccdab4737afd (diff) |
Use --gc-sections during link
All common functions are being built into all binary images,
whether or not they are actually used. This change enables the
use of -ffunction-sections, -fdata-sections and --gc-sections
in the compiler and linker to remove unused code and data from
the images.
Change-Id: Ia9f78c01054ac4fa15d145af38b88a0d6fb7d409
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -150,8 +150,10 @@ ASFLAGS += -nostdinc -ffreestanding -Wa,--fatal-warnings \ CFLAGS := -nostdinc -pedantic -ffreestanding -Wall \ -Werror -mgeneral-regs-only -std=c99 -c -Os \ -DDEBUG=${DEBUG} ${INCLUDES} ${CFLAGS} +CFLAGS += -ffunction-sections -fdata-sections LDFLAGS += --fatal-warnings -O1 +LDFLAGS += --gc-sections vpath %.ld.S bl1:bl2:bl31 |