altos: Use -ffunction-sections -fdata-sections
authorKeith Packard <keithp@keithp.com>
Sun, 25 Sep 2022 20:55:04 +0000 (13:55 -0700)
committerKeith Packard <keithp@keithp.com>
Sun, 25 Sep 2022 20:55:04 +0000 (13:55 -0700)
This allows the linker to discard unused functions.

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

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