From patchwork Sun May 3 15:26:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 244940 List-Id: U-Boot discussion From: marek.vasut at gmail.com (Marek Vasut) Date: Sun, 3 May 2020 17:26:26 +0200 Subject: [PATCH] sh: Enable ffunction-sections and fdata-sections Message-ID: <20200503152626.34190-1-marek.vasut+renesas@gmail.com> Enable these two options to let compiler eliminate unused code. On R2Dplus, this results in considerable amount of saved space: text data bss dec hex filename - 266580 13196 39076 318852 4dd84 u-boot + 220214 12797 38745 271756 4258c u-boot Signed-off-by: Marek Vasut Cc: Nobuhiro Iwamatsu Cc: Tom Rini --- arch/sh/config.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/sh/config.mk b/arch/sh/config.mk index 6ef44638ab..85dab383e7 100644 --- a/arch/sh/config.mk +++ b/arch/sh/config.mk @@ -13,6 +13,6 @@ LDFLAGS_STANDALONE += -EB endif PLATFORM_CPPFLAGS += -DCONFIG_SH -D__SH__ -PLATFORM_RELFLAGS += -fpic +PLATFORM_RELFLAGS += -fpic -ffunction-sections -fdata-sections LDFLAGS_FINAL = --gc-sections PLATFORM_RELFLAGS += -ffixed-r13