1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-29 00:11:16 +01:00

make: build with linker garbage collection

Currently only has the linker flag --gc-sections defined which tells
the linker to omit dead code. Depending on the application this leads
to significant reduction of code size.
This commit is contained in:
Thomas Eichinger 2014-10-09 15:00:31 +02:00 committed by Joakim Gebart
parent 8724e6c0cc
commit a624412597
2 changed files with 2 additions and 1 deletions

View File

@ -36,6 +36,7 @@ export ASFLAGS += $(CFLAGS_CPU) $(CFLAGS_DEBUG)
export LINKFLAGS += -L$(RIOTCPU)/$(CPU)/ldscripts -L$(RIOTCPU)/cortexm_common/ldscripts
export LINKFLAGS += -T$(RIOTCPU)/$(CPU)/ldscripts/$(CPU_MODEL).ld -Wl,--fatal-warnings
export LINKFLAGS += $(CFLAGS_DEBUG) $(CFLAGS_CPU) $(CFLAGS_STYLE) -static -lgcc -nostartfiles
export LINKFLAGS += -Wl,--gc-sections
# Import all toolchain settings
include $(RIOTBOARD)/Makefile.include.$(TOOLCHAIN)

View File

@ -19,7 +19,7 @@ export SIZE = $(PREFIX)size
export OBJCOPY = $(PREFIX)objcopy
FLASHER = mc1322x-load.pl
TERM = pyterm
LINKFLAGS += -mcpu=arm7tdmi-s -static -lgcc -nostartfiles -T$(RIOTBASE)/cpu/$(CPU)/mc1322x.lds
LINKFLAGS += -mcpu=arm7tdmi-s -static -lgcc -nostartfiles -Wl,--gc-sections -T$(RIOTBASE)/cpu/$(CPU)/mc1322x.lds
ifeq ($(strip $(PORT)),)
export PORT = /dev/ttyUSB0