sh: Enable ffunction-sections and fdata-sections
authorMarek Vasut <marek.vasut+renesas@gmail.com>
Sun, 3 May 2020 15:22:43 +0000 (17:22 +0200)
committerMarek Vasut <marek.vasut+renesas@gmail.com>
Wed, 20 May 2020 11:20:25 +0000 (13:20 +0200)
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 <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Cc: Tom Rini <trini@konsulko.com>
arch/sh/config.mk

index 6ef44638abd0855644c024a6feecfad02279d683..85dab383e745cc129b343c3beb2b44ac363f0ae3 100644 (file)
@@ -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