riscv: Enable function sections
authorAlexander Graf <agraf@suse.de>
Mon, 23 Apr 2018 05:59:44 +0000 (07:59 +0200)
committerAndes <uboot@andestech.com>
Tue, 29 May 2018 06:43:12 +0000 (14:43 +0800)
The linker can remove sections that are never addressed, so it makes a lot
of sense to declare every function as an individual section.

This reduces the output U-Boot code size by ~30kb for me.

Signed-off-by: Alexander Graf <agraf@suse.de>
arch/riscv/config.mk

index a7448e2095aa5f531f720c602019472aae46942b..f65ed8725df8768449ecd02de22cfb3abd938e73 100644 (file)
@@ -29,5 +29,5 @@ CONFIG_STANDALONE_LOAD_ADDR = 0x00000000 \
                              -T $(srctree)/examples/standalone/riscv.lds
 
 PLATFORM_CPPFLAGS      += -ffixed-gp -fpic
-PLATFORM_RELFLAGS += -fno-strict-aliasing -fno-common -gdwarf-2
+PLATFORM_RELFLAGS += -fno-strict-aliasing -fno-common -gdwarf-2 -ffunction-sections
 LDFLAGS_u-boot += --gc-sections -static -pie