[LEDE-DEV] [PATCH 2/2] mtd-utils: activate --gc-sections

Hauke Mehrtens hauke at hauke-m.de
Fri Mar 30 07:56:39 PDT 2018


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>
---
 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 cf0983164a..806bba8a4f 100644
--- a/package/utils/mtd-utils/Makefile
+++ b/package/utils/mtd-utils/Makefile
@@ -62,6 +62,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) \
-- 
2.11.0




More information about the Lede-dev mailing list