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 --- batman-adv-devel/Makefile | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/batman-adv-devel/Makefile b/batman-adv-devel/Makefile index b9e2650..6dc66b8 100644 --- a/batman-adv-devel/Makefile +++ b/batman-adv-devel/Makefile @@ -76,6 +76,9 @@ MAKE_BATCTL_ARGS += \ STRIP="/bin/true" \ batctl install
+TARGET_CFLAGS += -ffunction-sections -fdata-sections +TARGET_LDFLAGS += -Wl,--gc-sections + ifneq ($(DEVELOPER)$(CONFIG_KMOD_BATMAN_ADV_DEVEL_BATCTL),) define Download/batctl FILE:=$(PKG_BATCTL_FNAME)