[openwrt/openwrt] mtd-utils: activate --gc-sections

LEDE Commits lede-commits at lists.infradead.org
Sat Apr 28 06:31:11 PDT 2018


hauke pushed a commit to openwrt/openwrt.git, branch master:
https://git.lede-project.org/3e93df07071e79bb8cf1d8fb7fd1539c87bdc3a4

commit 3e93df07071e79bb8cf1d8fb7fd1539c87bdc3a4
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Fri Mar 30 15:32:07 2018 +0200

    mtd-utils: activate --gc-sections
    
    This reduces the size of the binary a bit:
    
    old:
     37556 bin/targets/lantiq/xrx200/packages/nand-utils_2.0.1-1_mips_24kc.ipk
     81697 bin/targets/lantiq/xrx200/packages/ubi-utils_2.0.1-1_mips_24kc.ipk
    
    new:
     27450 bin/targets/lantiq/xrx200/packages/nand-utils_2.0.1-1_mips_24kc.ipk
     71796 bin/targets/lantiq/xrx200/packages/ubi-utils_2.0.1-1_mips_24kc.ipk
    
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
    Tested-by: Koen Vandeputte <koen.vandeputte at ncentric.com>
---
 package/utils/mtd-utils/Makefile | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/package/utils/mtd-utils/Makefile b/package/utils/mtd-utils/Makefile
index 2ce7d67..ca60726 100644
--- a/package/utils/mtd-utils/Makefile
+++ b/package/utils/mtd-utils/Makefile
@@ -61,6 +61,9 @@ CONFIGURE_ARGS += \
 	--without-xattr \
 	--without-lzo
 
+TARGET_CFLAGS += -ffunction-sections -fdata-sections
+TARGET_LDFLAGS += -Wl,--gc-sections
+
 define Package/ubi-utils/install
 	$(INSTALL_DIR) $(1)/usr/sbin
 	$(INSTALL_BIN) \



More information about the lede-commits mailing list