mtd-utils: activate --gc-sections
authorHauke Mehrtens <hauke@hauke-m.de>
Fri, 30 Mar 2018 13:32:07 +0000 (15:32 +0200)
committerHauke Mehrtens <hauke@hauke-m.de>
Sat, 28 Apr 2018 13:29:22 +0000 (15:29 +0200)
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@hauke-m.de>
Tested-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
package/utils/mtd-utils/Makefile

index 2ce7d671fee25c64d6be896dae45664c87ad8f3b..ca60726d81a94e298a9392147ce61c8e5b896509 100644 (file)
@@ -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) \