Commit 18a44e7c authored by devsaurus's avatar devsaurus
Browse files

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

parent ed8681f9
...@@ -22,7 +22,7 @@ ifeq ($(OS),Windows_NT) ...@@ -22,7 +22,7 @@ ifeq ($(OS),Windows_NT)
else else
# It is gcc, may be cygwin # It is gcc, may be cygwin
# Can we use -fdata-sections? # 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 AR = xtensa-lx106-elf-ar
CC = xtensa-lx106-elf-gcc CC = xtensa-lx106-elf-gcc
NM = xtensa-lx106-elf-nm NM = xtensa-lx106-elf-nm
...@@ -49,7 +49,7 @@ else ...@@ -49,7 +49,7 @@ else
else else
ESPPORT = $(COMPORT) ESPPORT = $(COMPORT)
endif endif
CCFLAGS += -Os -ffunction-sections -fno-jump-tables CCFLAGS += -Os -ffunction-sections -fno-jump-tables -fdata-sections
AR = xtensa-lx106-elf-ar AR = xtensa-lx106-elf-ar
CC = xtensa-lx106-elf-gcc CC = xtensa-lx106-elf-gcc
NM = xtensa-lx106-elf-nm NM = xtensa-lx106-elf-nm
......
...@@ -86,6 +86,7 @@ COMPONENTS_eagle.app.v6 = \ ...@@ -86,6 +86,7 @@ COMPONENTS_eagle.app.v6 = \
LINKFLAGS_eagle.app.v6 = \ LINKFLAGS_eagle.app.v6 = \
-L../lib \ -L../lib \
-Wl,--gc-sections \
-Xlinker -Map=mapfile \ -Xlinker -Map=mapfile \
-nostdlib \ -nostdlib \
-T$(LD_FILE) \ -T$(LD_FILE) \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment