[U-Boot] [PATCH 7/7] add gc-sections to TPL boot
Haiying.Wang at freescale.com
Haiying.Wang at freescale.com
Fri Jan 28 05:58:10 CET 2011
From: Haiying Wang <Haiying.Wang at freescale.com>
Signed-off-by: Haiying Wang <Haiying.Wang at freescale.com>
---
arch/powerpc/config.mk | 4 ++++
config.mk | 7 ++++++-
2 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/arch/powerpc/config.mk b/arch/powerpc/config.mk
index 64191c7..78e53c4 100644
--- a/arch/powerpc/config.mk
+++ b/arch/powerpc/config.mk
@@ -27,7 +27,11 @@ STANDALONE_LOAD_ADDR = 0x40000
LDFLAGS_u-boot = --gc-sections
PLATFORM_RELFLAGS += -mrelocatable -ffunction-sections -fdata-sections
PLATFORM_CPPFLAGS += -DCONFIG_PPC -D__powerpc__
+ifdef CONFIG_HAS_TPL
+PLATFORM_LDFLAGS += -n --gc-sections
+else
PLATFORM_LDFLAGS += -n
+endif
ifdef CONFIG_SYS_LDSCRIPT
# need to strip off double quotes
diff --git a/config.mk b/config.mk
index 5147c35..d7bb07f 100644
--- a/config.mk
+++ b/config.mk
@@ -260,8 +260,13 @@ $(obj)%.s: %.c
#########################################################################
# If the list of objects to link is empty, just create an empty built-in.o
+ifdef CONFIG_HAS_TPL
+cmd_link_o_target = $(if $(strip $1),\
+ $(LD) -r -o $@ $1,\
+ rm -f $@; $(AR) rcs $@ )
+else
cmd_link_o_target = $(if $(strip $1),\
$(LD) $(LDFLAGS) -r -o $@ $1,\
rm -f $@; $(AR) rcs $@ )
-
+endif
#########################################################################
--
1.7.3.1.50.g1e633
More information about the U-Boot
mailing list