From e32a268b6f96b5b4818e9c33d18cee98c0c31f7c Mon Sep 17 00:00:00 2001
From: Rob Herring <rob.herring@calxeda.com>
Date: Fri, 4 Oct 2013 10:22:40 -0500
Subject: [PATCH] examples: enable gc-sections option

This fixes building time.c when unreferenced functions are added.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
---
 examples/api/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/examples/api/Makefile b/examples/api/Makefile
index 4d683400e14..33cc91ba711 100644
--- a/examples/api/Makefile
+++ b/examples/api/Makefile
@@ -53,7 +53,7 @@ all:	$(obj).depend $(OUTPUT)
 #########################################################################
 
 $(OUTPUT):	$(OBJS)
-		$(LD) -Ttext $(LOAD_ADDR) -o $@ $^ $(PLATFORM_LIBS)
+		$(LD) --gc-sections -Ttext $(LOAD_ADDR) -o $@ $^ $(PLATFORM_LIBS)
 		$(OBJCOPY) -O binary $@ $(OUTPUT).bin 2>/dev/null
 
 # Rule to build generic library C files
-- 
GitLab