sidk_s5jt200: optimize for minimum code size
This commit changes the optimization level and linker options for
reducing binary footprint for 'hello_with_tash' configuration.
@@ -123,13 +123,13 @@ endif
ARCHDEFINES =
ARCHPICFLAGS = -fpic -msingle-pic-base -mpic-register=r10
-CFLAGS = $(ARCHCFLAGS) $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
+CFLAGS = $(ARCHCFLAGS) $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe -ffunction-sections -fdata-sections
CPICFLAGS = $(ARCHPICFLAGS) $(CFLAGS)
CXXFLAGS = $(ARCHCXXFLAGS) $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHXXINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS)
CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
-MAXOPTIMIZATION = -O0
+MAXOPTIMIZATION = -Os
NXFLATLDFLAGS1 = -r -d -warn-common
@@ -148,6 +148,7 @@ ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
LDFLAGS += -g
endif
+LDFLAGS += --gc-sections
HOSTCC = gcc
HOSTINCLUDES = -I.
