From patchwork Tue Feb 1 14:59:57 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haiying Wang X-Patchwork-Id: 81322 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 13CCFB7088 for ; Wed, 2 Feb 2011 02:00:36 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 528CD281DA; Tue, 1 Feb 2011 16:00:33 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id a8upp3IOUHTo; Tue, 1 Feb 2011 16:00:33 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 19E6E281DB; Tue, 1 Feb 2011 16:00:32 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 21035281DB for ; Tue, 1 Feb 2011 16:00:29 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nNuVhBx2SdtG for ; Tue, 1 Feb 2011 16:00:27 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from TX2EHSOBE004.bigfish.com (tx2ehsobe002.messaging.microsoft.com [65.55.88.12]) by theia.denx.de (Postfix) with ESMTPS id 05044281DA for ; Tue, 1 Feb 2011 16:00:24 +0100 (CET) Received: from mail145-tx2-R.bigfish.com (10.9.14.250) by TX2EHSOBE004.bigfish.com (10.9.40.24) with Microsoft SMTP Server id 14.1.225.8; Tue, 1 Feb 2011 15:00:22 +0000 Received: from mail145-tx2 (localhost.localdomain [127.0.0.1]) by mail145-tx2-R.bigfish.com (Postfix) with ESMTP id 36408E884DC; Tue, 1 Feb 2011 15:00:22 +0000 (UTC) X-SpamScore: -15 X-BigFish: VS-15(zz936eK1432N98dNzz1202hzzz2dh2a8h668h) X-Forefront-Antispam-Report: KIP:(null); UIP:(null); IPVD:NLI; H:az33egw01.freescale.net; RD:az33egw01.freescale.net; EFVD:NLI Received: from mail145-tx2 (localhost.localdomain [127.0.0.1]) by mail145-tx2 (MessageSwitch) id 1296572420929132_6510; Tue, 1 Feb 2011 15:00:20 +0000 (UTC) Received: from TX2EHSMHS041.bigfish.com (unknown [10.9.14.242]) by mail145-tx2.bigfish.com (Postfix) with ESMTP id DD12D1048050; Tue, 1 Feb 2011 15:00:20 +0000 (UTC) Received: from az33egw01.freescale.net (192.88.158.102) by TX2EHSMHS041.bigfish.com (10.9.99.141) with Microsoft SMTP Server (TLS) id 14.1.225.8; Tue, 1 Feb 2011 15:00:18 +0000 Received: from az33smr02.freescale.net (az33smr02.freescale.net [10.64.34.200]) by az33egw01.freescale.net (8.14.3/8.14.3) with ESMTP id p11F02eb016520; Tue, 1 Feb 2011 08:00:12 -0700 (MST) Received: from [10.29.200.208] (haiying-laptop.am.freescale.net [10.29.200.208]) by az33smr02.freescale.net (8.13.1/8.13.0) with ESMTP id p11Exvmr027549; Tue, 1 Feb 2011 08:59:57 -0600 (CST) From: Haiying Wang To: Wolfgang Denk In-Reply-To: <20110201073401.1B343B187@gemini.denx.de> References: <1296498767-26408-1-git-send-email-Haiying.Wang@freescale.com> <20110131193309.745E7D4D67C@gemini.denx.de> <20110131135548.50d65759@udp111988uds.am.freescale.net> <20110201073401.1B343B187@gemini.denx.de> Date: Tue, 1 Feb 2011 09:59:57 -0500 Message-ID: <1296572397.1995.15.camel@haiying-laptop> MIME-Version: 1.0 X-Mailer: Evolution 2.30.3 X-OriginatorOrg: freescale.com Cc: Scott Wood , u-boot@lists.denx.de Subject: Re: [U-Boot] [PATCH] Introduce a new linker flag LDFLAGS_FINAL X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de On Tue, 2011-02-01 at 08:34 +0100, Wolfgang Denk wrote: > Can you please be more specific? I don't see where "the > LDFLAGS_u-boot commit" (you mean 8aba9dc ?) would change any related > code. The relevant hunk looks like this: > > @@ -204,9 +204,11 @@ endif > > AFLAGS := $(AFLAGS_DEBUG) -D__ASSEMBLY__ $(CPPFLAGS) > > -LDFLAGS += -Bstatic -T $(obj)u-boot.lds $(PLATFORM_LDFLAGS) > +LDFLAGS += $(PLATFORM_LDFLAGS) > + > +LDFLAGS_u-boot += -Bstatic -T $(obj)u-boot.lds $(PLATFORM_LDFLAGS) > ifneq ($(CONFIG_SYS_TEXT_BASE),) > -LDFLAGS += -Ttext $(CONFIG_SYS_TEXT_BASE) > +LDFLAGS_u-boot += -Ttext $(CONFIG_SYS_TEXT_BASE) > endif > > # Location of a usable BFD library, where we define "usable" as > > and this does not make any changes of PLATFORM_LDFLAGS into LDFLAGS > or vice versa. > But PLATFORM_LDFLAGS has been changed in $(CPUDIR)/config.mk. You can see in commit 8aba9dc: +LDFLAGS += $(PLATFORM_LDFLAGS) And later in this config.mk, @@ -259,7 +261,7 @@ $(obj)%.s: %.c # If the list of objects to link is empty, just create an empty built-in.o cmd_link_o_target = $(if $(strip $1),\ - $(LD) -r -o $@ $1 ,\ + $(LD) $(LDFLAGS) -r -o $@ $1,\ rm -f $@; $(AR) rcs $@ ) LDFLAGS is added in cmd_link_o_target which made changes to build nand_spl. Haiying --- a/arch/powerpc/config.mk +++ b/arch/powerpc/config.mk @@ -24,10 +24,10 @@ CROSS_COMPILE ?= ppc_8xx- STANDALONE_LOAD_ADDR = 0x40000 - +LDFLAGS_u-boot = --gc-sections PLATFORM_RELFLAGS += -mrelocatable -ffunction-sections -fdata-sections PLATFORM_CPPFLAGS += -DCONFIG_PPC -D__powerpc__ -PLATFORM_LDFLAGS += -n --gc-sections +PLATFORM_LDFLAGS += -n Here, --gc-sections is set only for LDFLAGS_u-boot, the PLATFORM_LDFLAGS does have --gc-sections, So in toplevel config.mk: