summaryrefslogtreecommitdiff
path: root/firmware/Makefile
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2011-07-30 00:34:59 +0200
committerHarald Welte <laforge@gnumonks.org>2011-07-30 00:34:59 +0200
commitdda0896d875ec2d33b6de94df818a2f94526272b (patch)
tree502d58e1b72d77ca260efdf5513fbd1c51af3fba /firmware/Makefile
parenta1e7c0c5efba4eebdb1ed178b5e3604226a1421a (diff)
use gcc/ld flags -ffunction-sections and --gc-sections
This will discard unused functions from the resulting binary
Diffstat (limited to 'firmware/Makefile')
-rw-r--r--firmware/Makefile4
1 files changed, 2 insertions, 2 deletions
diff --git a/firmware/Makefile b/firmware/Makefile
index 9a95d44..b085c33 100644
--- a/firmware/Makefile
+++ b/firmware/Makefile
@@ -249,7 +249,7 @@ CFLAGS += -Wredundant-decls -Wreturn-type -Wshadow
CFLAGS += -Wbad-function-cast -Wsign-compare -Waggregate-return
CFLAGS += -Wa,-adhlns=$(subst $(suffix $<),.lst,$<)
CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
-#CFLAGS += -ffunction-sections -fdata-sections
+CFLAGS += -ffunction-sections -fdata-sections
# flags only for C
CONLYFLAGS += -Wnested-externs
@@ -315,7 +315,7 @@ LDFLAGS += -lc -lgcc
LDFLAGS += $(CPLUSPLUS_LIB)
LDFLAGS += $(patsubst %,-L%,$(EXTRA_LIBDIRS))
LDFLAGS += $(patsubst %,-l%,$(EXTRA_LIBS))
-#LDFLAGS += --gc-sections
+LDFLAGS += -Wl,--gc-sections -Wl,--entry=_startup
# Set Linker-Script Depending On Selected Memory and Controller
ifeq ($(RUN_MODE),RUN_FROM_RAM)
personal git repositories of Harald Welte. Your mileage may vary