diff --git a/config.mk b/config.mk
index c6d6f7b..591b490 100644
--- a/config.mk
+++ b/config.mk
@@ -23,6 +23,10 @@
 
 #########################################################################
 
+comma := ,
+empty :=
+space := $(empty) $(empty)
+
 ifneq ($(OBJTREE),$(SRCTREE))
 ifeq ($(CURDIR),$(SRCTREE))
 dir :=
@@ -97,6 +101,8 @@ HOSTCFLAGS	+= -pedantic
 #
 cc-option = $(shell if $(CC) $(CFLAGS) $(1) -S -o /dev/null -xc /dev/null \
 		> /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;)
+ld-option = $(shell if $(CC) -Wl$(comma)$(1) -nostdlib -xc /dev/null -o /dev/null \
+		> /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;)
 
 #
 # Include the make variables (CC, etc...)
@@ -191,6 +197,13 @@ endif
 
 CFLAGS += $(call cc-option,-fno-stack-protector)
 
+# Create a section for each function or data (useful for sections garbage collector)
+CFLAGS += $(call cc-option,-ffunction-sections)
+CFLAGS += $(call cc-option,-fdata-sections)
+
+# Sections garbage collector
+LDFLAGS += $(call ld-option,--gc-sections)
+
 # $(CPPFLAGS) sets -g, which causes gcc to pass a suitable -g<format>
 # option to the assembler.
 AFLAGS_DEBUG :=
