reduce executable size (-fdata-sections and -Wl,--gc-sections)

This commit is contained in:
devsaurus 2015-02-02 22:48:15 +01:00
parent ed8681f956
commit 18a44e7c60
2 changed files with 3 additions and 2 deletions

View File

@ -22,7 +22,7 @@ ifeq ($(OS),Windows_NT)
else
# It is gcc, may be cygwin
# Can we use -fdata-sections?
CCFLAGS += -Os -ffunction-sections -fno-jump-tables
CCFLAGS += -Os -ffunction-sections -fno-jump-tables -fdata-sections
AR = xtensa-lx106-elf-ar
CC = xtensa-lx106-elf-gcc
NM = xtensa-lx106-elf-nm
@ -49,7 +49,7 @@ else
else
ESPPORT = $(COMPORT)
endif
CCFLAGS += -Os -ffunction-sections -fno-jump-tables
CCFLAGS += -Os -ffunction-sections -fno-jump-tables -fdata-sections
AR = xtensa-lx106-elf-ar
CC = xtensa-lx106-elf-gcc
NM = xtensa-lx106-elf-nm

View File

@ -86,6 +86,7 @@ COMPONENTS_eagle.app.v6 = \
LINKFLAGS_eagle.app.v6 = \
-L../lib \
-Wl,--gc-sections \
-Xlinker -Map=mapfile \
-nostdlib \
-T$(LD_FILE) \