altos: Use --gc-sections
authorKeith Packard <keithp@keithp.com>
Sun, 25 Sep 2022 20:55:04 +0000 (13:55 -0700)
committerKeith Packard <keithp@keithp.com>
Thu, 27 Oct 2022 23:58:32 +0000 (16:58 -0700)
This allows the linker to discard unused functions.

Don't use -ffunctions-sections and -fdata-sections as that eliminates
several optimization opportunities and increases code size.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/Makefile.defs

index d9b719973da61e5c52fabe871d8b3111318b7630..c2d5247cd1ea1cfcbf4129b2e7c291e2f87c3ed7 100644 (file)
@@ -23,6 +23,7 @@ OPT=-Os -Wl,-Map=$(PROGNAME)-$(VERSION).map
 
 PICOLIBC_CFLAGS= \
        -specs=picolibc.specs \
+       -Wl,--gc-sections \
        $(PICOLIBC_PRINTF_CFLAGS)
 
 AO_CFLAGS=\