summaryrefslogtreecommitdiff
path: root/firmware/common.mk
diff options
context:
space:
mode:
authorAlex Deymo <unsabi@yahoo.com>2014-04-19 21:48:58 -0700
committerAlex Deymo <unsabi@yahoo.com>2014-04-19 21:48:58 -0700
commitf4c661a963b82a7b3356aa353168f2ffb84ba942 (patch)
tree5dd1c204a6a8b3ce44e7fd64423b90800f0a69e1 /firmware/common.mk
parent00b29f33f7e993df0c592e7f74225618052954b8 (diff)
Strip unused code from the firmware.
Add -Wl,--gc-sections to the LDFLAGS to let the linker remove the unused functions from the .elf file. This not only reduces the size of the .dfu in about 2K (even for the small firmwares) but also removes that code from the .lst and .lss files. Tested that the ubertooth_rxtx still works.
Diffstat (limited to 'firmware/common.mk')
-rw-r--r--firmware/common.mk2
1 files changed, 1 insertions, 1 deletions
diff --git a/firmware/common.mk b/firmware/common.mk
index 6e0c17e..2806590 100644
--- a/firmware/common.mk
+++ b/firmware/common.mk
@@ -228,7 +228,7 @@ EXTRALIBDIRS = $(LIBS_PATH)
# --cref: add cross reference to map file
LDFLAGS = -Wl,-Map=$(TARGET).map
#LDFLAGS += -Wl,--relax
-#LDFLAGS += --gc-sections
+LDFLAGS += -Wl,--gc-sections
LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS))
LDFLAGS += -static
LDFLAGS += -Wl,--start-group