From 3a7ae9e964c9554a667a09d6b437fef136bc0fa0 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sun, 25 Sep 2022 13:55:04 -0700 Subject: [PATCH] altos: Use --gc-sections 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 --- src/Makefile.defs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Makefile.defs b/src/Makefile.defs index d9b71997..c2d5247c 100644 --- a/src/Makefile.defs +++ b/src/Makefile.defs @@ -23,6 +23,7 @@ OPT=-Os -Wl,-Map=$(PROGNAME)-$(VERSION).map PICOLIBC_CFLAGS= \ -specs=picolibc.specs \ + -Wl,--gc-sections \ $(PICOLIBC_PRINTF_CFLAGS) AO_CFLAGS=\ -- 2.30.2