From patchwork Mon Dec 27 07:00:24 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nobuhiro Iwamatsu X-Patchwork-Id: 76758 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 68C3FB70EA for ; Mon, 27 Dec 2010 17:57:45 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1B8B2280A8; Mon, 27 Dec 2010 07:57:43 +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 sbx3NiK0J2b3; Mon, 27 Dec 2010 07:57:42 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 013362809C; Mon, 27 Dec 2010 07:57:41 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1CA9C2809C for ; Mon, 27 Dec 2010 07:57:39 +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 EJZWdsGcozLV for ; Mon, 27 Dec 2010 07:57:37 +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 mail-px0-f172.google.com (mail-px0-f172.google.com [209.85.212.172]) by theia.denx.de (Postfix) with ESMTP id 0632628099 for ; Mon, 27 Dec 2010 07:57:34 +0100 (CET) Received: by pxi6 with SMTP id 6so1936683pxi.3 for ; Sun, 26 Dec 2010 22:57:33 -0800 (PST) Received: by 10.142.169.17 with SMTP id r17mr6477362wfe.158.1293433053744; Sun, 26 Dec 2010 22:57:33 -0800 (PST) Received: from chimagu (49.14.32.202.bf.2iij.net [202.32.14.49]) by mx.google.com with ESMTPS id w22sm17246428wfd.19.2010.12.26.22.57.32 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 26 Dec 2010 22:57:33 -0800 (PST) Received: from iwamatsu by chimagu with local (Exim 4.72) (envelope-from ) id 1PX74D-0004WC-9q; Mon, 27 Dec 2010 16:00:25 +0900 From: Nobuhiro Iwamatsu To: u-boot@lists.denx.de Date: Mon, 27 Dec 2010 16:00:24 +0900 Message-Id: <1293433224-17341-1-git-send-email-iwamatsu@nigauri.org> X-Mailer: git-send-email 1.7.2.3 Subject: [U-Boot] [PATCH] Add LDFLAGS-u-boot variable and move some linker option to this 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: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de This move linker option used by the last of u-boot in LDFLAGS_u-boot variable. And the option to use in ld uses LDFLAGS variable. Signed-off-by: Nobuhiro Iwamatsu --- Makefile | 2 +- arch/blackfin/config.mk | 3 ++- arch/i386/config.mk | 3 ++- arch/nios2/config.mk | 2 +- arch/powerpc/config.mk | 4 ++-- arch/sh/config.mk | 2 +- arch/sh/cpu/sh2/config.mk | 4 +++- config.mk | 8 +++++--- 8 files changed, 17 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index 9055028..d6884ea 100644 --- a/Makefile +++ b/Makefile @@ -369,7 +369,7 @@ $(obj)u-boot.dis: $(obj)u-boot GEN_UBOOT = \ UNDEF_SYM=`$(OBJDUMP) -x $(LIBBOARD) $(LIBS) | \ sed -n -e 's/.*\($(SYM_PREFIX)__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`;\ - cd $(LNDIR) && $(LD) $(LDFLAGS) $$UNDEF_SYM $(__OBJS) \ + cd $(LNDIR) && $(LD) $(LDFLAGS) $(LDFLAGS_$(@F)) $$UNDEF_SYM $(__OBJS) \ --start-group $(__LIBS) --end-group $(PLATFORM_LIBS) \ -Map u-boot.map -o u-boot $(obj)u-boot: depend \ diff --git a/arch/blackfin/config.mk b/arch/blackfin/config.mk index ab117ca..0cba294 100644 --- a/arch/blackfin/config.mk +++ b/arch/blackfin/config.mk @@ -30,7 +30,8 @@ CONFIG_BFIN_BOOT_MODE := $(strip $(subst ",,$(CONFIG_BFIN_BOOT_MODE))) PLATFORM_RELFLAGS += -ffixed-P3 -fomit-frame-pointer -mno-fdpic PLATFORM_CPPFLAGS += -DCONFIG_BLACKFIN -LDFLAGS += --gc-sections -m elf32bfin +LDFLAGS_u-boot += --gc-sections +LDFLAGS += -m elf32bfin PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections PLATFORM_CPPFLAGS += -DBFIN_CPU='"$(CONFIG_BFIN_CPU)"' diff --git a/arch/i386/config.mk b/arch/i386/config.mk index 8743f1a..2da1666 100644 --- a/arch/i386/config.mk +++ b/arch/i386/config.mk @@ -35,5 +35,6 @@ PLATFORM_CPPFLAGS += $(call cc-option, -fno-stack-protector) PLATFORM_CPPFLAGS += $(call cc-option, -mpreferred-stack-boundary=2) PLATFORM_CPPFLAGS += -DCONFIG_I386 -D__I386__ -LDFLAGS += --cref --gc-sections +LDFLAGS += --cref +LDFLAGS_u-boot += --gc-sections PLATFORM_RELFLAGS += -ffunction-sections diff --git a/arch/nios2/config.mk b/arch/nios2/config.mk index aba96b3..fa93180 100644 --- a/arch/nios2/config.mk +++ b/arch/nios2/config.mk @@ -31,5 +31,5 @@ PLATFORM_CPPFLAGS += -G0 LDSCRIPT ?= $(SRCTREE)/$(CPUDIR)/u-boot.lds -LDFLAGS += --gc-sections +LDFLAGS_u-boot += --gc-sections PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections diff --git a/arch/powerpc/config.mk b/arch/powerpc/config.mk index 2912604..64191c7 100644 --- 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 ifdef CONFIG_SYS_LDSCRIPT # need to strip off double quotes diff --git a/arch/sh/config.mk b/arch/sh/config.mk index 415c949..4ef85e3 100644 --- a/arch/sh/config.mk +++ b/arch/sh/config.mk @@ -30,5 +30,5 @@ endif PLATFORM_CPPFLAGS += -DCONFIG_SH -D__SH__ PLATFORM_LDFLAGS += -e $(CONFIG_SYS_TEXT_BASE) --defsym reloc_dst=$(CONFIG_SYS_TEXT_BASE) - +LDFLAGS_u-boot = --gc-sections LDSCRIPT := $(SRCTREE)/$(CPUDIR)/u-boot.lds diff --git a/arch/sh/cpu/sh2/config.mk b/arch/sh/cpu/sh2/config.mk index 52d5a0f..f2d40aa 100644 --- a/arch/sh/cpu/sh2/config.mk +++ b/arch/sh/cpu/sh2/config.mk @@ -21,6 +21,8 @@ # MA 02111-1307 USA # # +ENDIANNESS += -EB + PLATFORM_CPPFLAGS += -m3e -mb PLATFORM_RELFLAGS += -ffixed-r13 -PLATFORM_LDFLAGS += -EB +PLATFORM_LDFLAGS += $(ENDIANNESS) diff --git a/config.mk b/config.mk index c6d6f7b..1666a48 100644 --- a/config.mk +++ b/config.mk @@ -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 @@ -262,7 +264,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 $@ ) #########################################################################