Repository : ssh://git@open-mesh.org/openwrt-feed-batman-adv
On branch : master
commit 3e056f38754cd39678a1fe16ef5a86b6fd0818dc Author: Sven Eckelmann sven@narfation.org Date: Tue May 7 14:51:08 2013 +0200
batman-adv-devel: Use section garbage collection to reduce binary size
The linker can identify unused sections of a binary when each symbol is stored in a separate section. This mostly removes unused linker sections and reduces the size by ~3% on mipsel.
Signed-off-by: Sven Eckelmann sven@narfation.org
3e056f38754cd39678a1fe16ef5a86b6fd0818dc batman-adv-devel/Makefile | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/batman-adv-devel/Makefile b/batman-adv-devel/Makefile index 69dfdc7..79b4294 100644 --- a/batman-adv-devel/Makefile +++ b/batman-adv-devel/Makefile @@ -64,6 +64,13 @@ MAKE_BATMAN_ADV_ARGS += \ CONFIG_BATMAN_ADV_NC=$(if $(CONFIG_KMOD_BATMAN_ADV_DEVEL_NC),y,n) \ REVISION="$(PKG_BATMAN_SHORTREV)" all
+# The linker can identify unused sections of a binary when each symbol is stored +# in a separate section. This mostly removes unused linker sections and reduces +# the size by ~3% on mipsel. + +TARGET_CFLAGS += -ffunction-sections -fdata-sections +TARGET_LDFLAGS += -Wl,--gc-sections + MAKE_BATCTL_ENV += \ CPPFLAGS="$(TARGET_CPPFLAGS)" \ CFLAGS="$(TARGET_CFLAGS)" \