From cb2557c9881938791491e44d750c9b6062d21195 Mon Sep 17 00:00:00 2001 From: Romain Goyet Date: Tue, 1 Oct 2019 16:35:12 +0200 Subject: [PATCH] [build/device] Add a comment about gc-sections --- build/toolchain.arm-gcc.mak | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build/toolchain.arm-gcc.mak b/build/toolchain.arm-gcc.mak index 2983111c6..3537011fe 100644 --- a/build/toolchain.arm-gcc.mak +++ b/build/toolchain.arm-gcc.mak @@ -20,12 +20,12 @@ endif ifeq ($(LTO),1) # Use link-time optimization if LTO=1 -SFLAGS += -flto -Wl,--gc-sections -else -# Otherwise, just get rid of unused symbols -LDFLAGS += -Wl,--gc-sections +SFLAGS += -flto endif +# Get rid of unused symbols. This is also useful even if LTO=1. +LDFLAGS += -Wl,--gc-sections + LDFLAGS += $(SFLAGS) -lgcc -Wl,-T,$(LDSCRIPT) # To debug linker scripts, add the following line