All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mtd-utils: enable garbage collection of unused function/data sections
@ 2010-10-01  5:37 Mike Frysinger
  2010-10-01  6:41 ` Artem Bityutskiy
  0 siblings, 1 reply; 2+ messages in thread
From: Mike Frysinger @ 2010-10-01  5:37 UTC (permalink / raw)
  To: linux-mtd

On my default build, this cumulatively shaves off ~100KiB of unused
code and data from the mtd-utils programs.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
 common.mk |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/common.mk b/common.mk
index 0444ad9..a55c548 100644
--- a/common.mk
+++ b/common.mk
@@ -3,6 +3,7 @@ AR := $(CROSS)ar
 RANLIB := $(CROSS)ranlib
 
 # Stolen from Linux build system
+comma = ,
 try-run = $(shell set -e; ($(1)) >/dev/null 2>&1 && echo "$(2)" || echo "$(3)")
 cc-option = $(call try-run, $(CC) $(1) -c -xc /dev/null -o /dev/null,$(1),$(2))
 
@@ -12,6 +13,8 @@ WFLAGS := -Wall \
 	$(call cc-option,-Wwrite-strings) \
 	$(call cc-option,-Wno-sign-compare)
 CFLAGS += $(WFLAGS)
+SECTION_CFLAGS := $(call cc-option,-ffunction-sections -fdata-sections -Wl$(comma)--gc-sections)
+CFLAGS += $(SECTION_CFLAGS)
 
 ifneq ($(WITHOUT_LARGEFILE), 1)
   CPPFLAGS += -D_FILE_OFFSET_BITS=64
-- 
1.7.3.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] mtd-utils: enable garbage collection of unused function/data sections
  2010-10-01  5:37 [PATCH] mtd-utils: enable garbage collection of unused function/data sections Mike Frysinger
@ 2010-10-01  6:41 ` Artem Bityutskiy
  0 siblings, 0 replies; 2+ messages in thread
From: Artem Bityutskiy @ 2010-10-01  6:41 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: linux-mtd

On Fri, 2010-10-01 at 01:37 -0400, Mike Frysinger wrote:
> On my default build, this cumulatively shaves off ~100KiB of unused
> code and data from the mtd-utils programs.
> 
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
> ---
>  common.mk |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)

Pushed all your patches, thanks for cleaning this stuff up!

-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-10-01  6:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-01  5:37 [PATCH] mtd-utils: enable garbage collection of unused function/data sections Mike Frysinger
2010-10-01  6:41 ` Artem Bityutskiy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.