From mboxrd@z Thu Jan 1 00:00:00 1970 From: Haiying.Wang at freescale.com Date: Thu, 27 Jan 2011 23:58:10 -0500 Subject: [U-Boot] [PATCH 7/7] add gc-sections to TPL boot In-Reply-To: <1296190690-21146-1-git-send-email-Haiying.Wang@freescale.com> References: <1296190690-21146-1-git-send-email-Haiying.Wang@freescale.com> Message-ID: <1296190690-21146-5-git-send-email-Haiying.Wang@freescale.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de From: Haiying Wang Signed-off-by: Haiying Wang --- 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