From: Scott Wood Date: Tue, 22 Feb 2011 14:47:12 -0600 Subject: [U-Boot] [PATCH v2] Introduce a new linker flag LDFLAGS_FINAL In-Reply-To: <1298405857-12642-1-git-send-email-Haiying.Wang@freescale.com> References: <1298405857-12642-1-git-send-email-Haiying.Wang@freescale.com> Message-ID: <20110222144712.07c85176@schlenkerla> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Tue, 22 Feb 2011 15:17:37 -0500 wrote: > diff --git a/config.mk b/config.mk > index 5147c35..caa6221 100644 > --- a/config.mk > +++ b/config.mk > @@ -205,8 +205,9 @@ endif > AFLAGS := $(AFLAGS_DEBUG) -D__ASSEMBLY__ $(CPPFLAGS) > > LDFLAGS += $(PLATFORM_LDFLAGS) > +LDFLAGS_FINAL += -Bstatic $(LDFLAGS) > > -LDFLAGS_u-boot += -Bstatic -T $(obj)u-boot.lds $(PLATFORM_LDFLAGS) > +LDFLAGS_u-boot += -T $(obj)u-boot.lds $(LDFLAGS_FINAL) > ifneq ($(CONFIG_SYS_TEXT_BASE),) > LDFLAGS_u-boot += -Ttext $(CONFIG_SYS_TEXT_BASE) > endif As Mike Frysinger pointed out, LDFLAGS is already used in addition to LDFLAGS_u-boot. So we may want to have LDFLAGS_FINAL not include LDFLAGS: LDFLAGS += -Bstatic LDFLAGS_u-boot += -T $(obj)u-boot.lds $(LDFLAGS_FINAL) and then... > diff --git a/nand_spl/board/freescale/mpc8536ds/Makefile b/nand_spl/board/freescale/mpc8536ds/Makefile > index 9c9d63e..c71a35a 100644 > --- a/nand_spl/board/freescale/mpc8536ds/Makefile > +++ b/nand_spl/board/freescale/mpc8536ds/Makefile > @@ -30,7 +30,7 @@ PAD_TO := 0xfff01000 > include $(TOPDIR)/config.mk > > LDSCRIPT= $(TOPDIR)/$(CPUDIR)/u-boot-nand_spl.lds > -LDFLAGS = -Bstatic -T $(LDSCRIPT) -Ttext $(CONFIG_SYS_TEXT_BASE_SPL) $(PLATFORM_LDFLAGS) > +LDFLAGS := -T $(LDSCRIPT) -Ttext $(CONFIG_SYS_TEXT_BASE_SPL) $(LDFLAGS_FINAL) > AFLAGS += -DCONFIG_NAND_SPL > CFLAGS += -DCONFIG_NAND_SPL LDFLAGS := -T $(LDSCRIPT) -Ttext $(CONFIG_SYS_TEXT_BASE_SPL) \ $(LDFLAGS) $(LDFLAGS_FINAL) The only functional difference should be that we're no longer repeating certain flags in the main u-boot link. -Scott