The linker can identify unused sections of a binary when each symbol is stored in a separate section. This mostly removes the unused debugfs function and reduces the size by ~5% on mipsel.
Signed-off-by: Sven Eckelmann sven@narfation.org --- alfred/Makefile | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/alfred/Makefile b/alfred/Makefile index 4578c3b..ab19325 100644 --- a/alfred/Makefile +++ b/alfred/Makefile @@ -44,6 +44,9 @@ endef MAKE_ALFRED_FLAGS=\ CONFIG_ALFRED_VIS=$(if $(CONFIG_PACKAGE_ALFRED_VIS),y,n)
+TARGET_CFLAGS += -ffunction-sections -fdata-sections +TARGET_LDFLAGS += -Wl,--gc-sections + define Build/Compile CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \ LDFLAGS="$(TARGET_LDFLAGS)" \