From patchwork Sun Sep 23 17:15:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Schwierzeck X-Patchwork-Id: 973742 X-Patchwork-Delegate: daniel.schwierzeck@googlemail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="kwnRDZhe"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 42JDXD6kVFz9sCD for ; Mon, 24 Sep 2018 03:16:44 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 98979C21E3A; Sun, 23 Sep 2018 17:15:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 1DB97C21E77; Sun, 23 Sep 2018 17:15:26 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 5F153C21DF8; Sun, 23 Sep 2018 17:15:24 +0000 (UTC) Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by lists.denx.de (Postfix) with ESMTPS id 01479C21C57 for ; Sun, 23 Sep 2018 17:15:24 +0000 (UTC) Received: by mail-wr1-f67.google.com with SMTP id u12-v6so17375418wrr.4 for ; Sun, 23 Sep 2018 10:15:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=SXO6xJnTVmN/sI05aLStq6K5ZgqJRCgfQ10X/MKmv1Q=; b=kwnRDZheLyMI3MBZ8KnU/ZmLAWx/zPe+huGewv6+4ChTBUHw70hIv44cBxfRlVgvDR 4/pUyQ6rrKS+ZL1N0wiksPxZr7LiXJwOY0gVTTV3sB1vC6sS8W4659HN5+Vaq2WAot8X K8UdBk+NkLOcdhoz05/xbX8RzmSZIGOL/OESEPTUmODiyvyRpUpHCfNIEuBlras97En6 qvQJ9AADGJqzF0g4jVNN8vNy7Fokwgyzu5s1WDSG8qAu5xRSwH8YhUG4H7nXXwdI5jSi AXpxXHYSszUuB3awNvwmmDM1MF5LDUbGbYDR9M+BEc2Rr1Ek01MYbCLryZAgWrEjpXAg +U6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=SXO6xJnTVmN/sI05aLStq6K5ZgqJRCgfQ10X/MKmv1Q=; b=pszFMTkZCzq1jE0Hk6lphieQI1b+gatuxZc+/Bdyzo/JTIazX+4598U9QQt/SGYWsM znoA8EFlClYUPvPrvVihNK+50G/6SOTDB89/0GhpdVV7P0EynNi0AeFKm0Gf5YDY8GJM YUOFeS60/xRo/zzt4ziEwy9p55R91qDJ53otp2f8ZM/v8jaD1IeJWiWof216LCr1BVtv 6rn1IkP/eiMe4+wCgEibKJN8jAn0TGPWuR8V+9WMmnwos+grimSgl+dApRM1L6czS7Po Y32xzO2SLykIzM6WZZwuoBdxVDVeu3wheIOLdQ+1oii7x6CZzOjM+ok9i39zTd0/w5jT Pe7w== X-Gm-Message-State: ABuFfohifAv0wbJXhQISShzeYBVAkf9/o6D3m0TyY0hAQqmYJHgILDnk m7YjIIlDmqwpqLOb+Us3wHI0AA13 X-Google-Smtp-Source: ACcGV62Ty2lnrEpAUU1+dBGgzuduFJ7nN6XOJ6u0tr++/84CNiOoNUQrwXMak36k1hkZi6LtH+Xvng== X-Received: by 2002:adf:fd47:: with SMTP id h7-v6mr5842221wrs.280.1537722923396; Sun, 23 Sep 2018 10:15:23 -0700 (PDT) Received: from workstation.lan.schwierd.dedyn.io (p549C750E.dip0.t-ipconnect.de. [84.156.117.14]) by smtp.gmail.com with ESMTPSA id j191-v6sm12223679wmb.37.2018.09.23.10.15.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 23 Sep 2018 10:15:22 -0700 (PDT) From: Daniel Schwierzeck To: u-boot@lists.denx.de Date: Sun, 23 Sep 2018 19:15:15 +0200 Message-Id: <20180923171517.21363-2-daniel.schwierzeck@gmail.com> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180923171517.21363-1-daniel.schwierzeck@gmail.com> References: <20180923171517.21363-1-daniel.schwierzeck@gmail.com> MIME-Version: 1.0 Cc: Tom Rini , Macpaul Lin Subject: [U-Boot] [PATCH 1/3] Kbuild: add LDFLAGS_STANDALONE X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Introduce a new Makefile variable for passing LDFLAGS to standalone programs. Currently the variable CONFIG_STANDALONE_LOAD_ADDR is misued on some archs to pass a specific linker script. Signed-off-by: Daniel Schwierzeck Reviewed-by: Tom Rini Reviewed-by: Rick Chen --- arch/mips/cpu/mips32/config.mk | 4 ++-- arch/mips/cpu/mips64/config.mk | 4 ++-- arch/nds32/config.mk | 4 ++-- arch/riscv/config.mk | 4 ++-- arch/sh/config.mk | 2 +- config.mk | 2 ++ examples/standalone/Makefile | 4 +++- 7 files changed, 14 insertions(+), 10 deletions(-) diff --git a/arch/mips/cpu/mips32/config.mk b/arch/mips/cpu/mips32/config.mk index a0247596f5..662e4f8fc8 100644 --- a/arch/mips/cpu/mips32/config.mk +++ b/arch/mips/cpu/mips32/config.mk @@ -3,5 +3,5 @@ # (C) Copyright 2003 # Wolfgang Denk, DENX Software Engineering, -CONFIG_STANDALONE_LOAD_ADDR ?= 0x80200000 \ - -T $(srctree)/examples/standalone/mips.lds +CONFIG_STANDALONE_LOAD_ADDR ?= 0x80200000 +LDFLAGS_STANDALONE += -T $(srctree)/examples/standalone/mips.lds diff --git a/arch/mips/cpu/mips64/config.mk b/arch/mips/cpu/mips64/config.mk index cd96bbcce9..6a53976b5c 100644 --- a/arch/mips/cpu/mips64/config.mk +++ b/arch/mips/cpu/mips64/config.mk @@ -3,5 +3,5 @@ # (C) Copyright 2003 # Wolfgang Denk, DENX Software Engineering, -CONFIG_STANDALONE_LOAD_ADDR ?= 0xffffffff80200000 \ - -T $(srctree)/examples/standalone/mips64.lds +CONFIG_STANDALONE_LOAD_ADDR ?= 0xffffffff80200000 +LDFLAGS_STANDALONE += -T $(srctree)/examples/standalone/mips64.lds diff --git a/arch/nds32/config.mk b/arch/nds32/config.mk index cb3d8b35b5..0a93fd428d 100644 --- a/arch/nds32/config.mk +++ b/arch/nds32/config.mk @@ -12,8 +12,8 @@ ifeq ($(CROSS_COMPILE),) CROSS_COMPILE := nds32le-linux- endif -CONFIG_STANDALONE_LOAD_ADDR = 0x300000 \ - -T $(srctree)/examples/standalone/nds32.lds +CONFIG_STANDALONE_LOAD_ADDR = 0x300000 +LDFLAGS_STANDALONE += -T $(srctree)/examples/standalone/nds32.lds PLATFORM_RELFLAGS += -fno-strict-aliasing -fno-common -mrelax PLATFORM_RELFLAGS += -gdwarf-2 diff --git a/arch/riscv/config.mk b/arch/riscv/config.mk index 219e66683d..d0b7e8e88b 100644 --- a/arch/riscv/config.mk +++ b/arch/riscv/config.mk @@ -27,8 +27,8 @@ PLATFORM_LDFLAGS += -m $(64bit-emul) EFI_LDS := elf_riscv64_efi.lds endif -CONFIG_STANDALONE_LOAD_ADDR = 0x00000000 \ - -T $(srctree)/examples/standalone/riscv.lds +CONFIG_STANDALONE_LOAD_ADDR = 0x00000000 +LDFLAGS_STANDALONE += -T $(srctree)/examples/standalone/riscv.lds PLATFORM_CPPFLAGS += -ffixed-gp -fpic PLATFORM_RELFLAGS += -fno-strict-aliasing -fno-common -gdwarf-2 -ffunction-sections diff --git a/arch/sh/config.mk b/arch/sh/config.mk index 92abee17ad..6ef44638ab 100644 --- a/arch/sh/config.mk +++ b/arch/sh/config.mk @@ -9,7 +9,7 @@ endif CONFIG_STANDALONE_LOAD_ADDR ?= 0x8C000000 ifeq ($(CPU),sh2) -CONFIG_STANDALONE_LOAD_ADDR += -EB +LDFLAGS_STANDALONE += -EB endif PLATFORM_CPPFLAGS += -DCONFIG_SH -D__SH__ diff --git a/config.mk b/config.mk index b4e4618982..caf0dd9b81 100644 --- a/config.mk +++ b/config.mk @@ -15,6 +15,7 @@ PLATFORM_CPPFLAGS := PLATFORM_LDFLAGS := LDFLAGS := LDFLAGS_FINAL := +LDFLAGS_STANDALONE := OBJCOPYFLAGS := # clear VENDOR for tcsh VENDOR := @@ -75,4 +76,5 @@ LDFLAGS_FINAL += -Bstatic export PLATFORM_CPPFLAGS export RELFLAGS export LDFLAGS_FINAL +export LDFLAGS_STANDALONE export CONFIG_STANDALONE_LOAD_ADDR diff --git a/examples/standalone/Makefile b/examples/standalone/Makefile index 09364d84a0..abe1bf1883 100644 --- a/examples/standalone/Makefile +++ b/examples/standalone/Makefile @@ -45,6 +45,8 @@ endif # source file. ccflags-y += $(call cc-option,-fno-toplevel-reorder) +LDFLAGS_STANDALONE += -Ttext $(CONFIG_STANDALONE_LOAD_ADDR) + ######################################################################### quiet_cmd_link_lib = LD $@ @@ -54,7 +56,7 @@ $(LIB): $(LIBOBJS) FORCE $(call if_changed,link_lib) quiet_cmd_link_elf = LD $@ - cmd_link_elf = $(LD) $(LDFLAGS) -g -Ttext $(CONFIG_STANDALONE_LOAD_ADDR) \ + cmd_link_elf = $(LD) $(LDFLAGS) $(LDFLAGS_STANDALONE) -g \ -o $@ -e $(SYM_PREFIX)$(@F) $< $(LIB) $(PLATFORM_LIBGCC) $(ELF): $(obj)/%: $(obj)/%.o $(LIB) FORCE From patchwork Sun Sep 23 17:15:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Schwierzeck X-Patchwork-Id: 973743 X-Patchwork-Delegate: daniel.schwierzeck@googlemail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="K4gVzZWc"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 42JDYN3R8Bz9sCD for ; Mon, 24 Sep 2018 03:17:44 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 29B47C21EC5; Sun, 23 Sep 2018 17:16:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id DC0C7C21E0F; Sun, 23 Sep 2018 17:15:36 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 1FB63C21E9F; Sun, 23 Sep 2018 17:15:29 +0000 (UTC) Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by lists.denx.de (Postfix) with ESMTPS id CCE6CC21E3A for ; Sun, 23 Sep 2018 17:15:25 +0000 (UTC) Received: by mail-wr1-f66.google.com with SMTP id z3-v6so5563954wrr.13 for ; Sun, 23 Sep 2018 10:15:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=TZR3aAPxdCME5aZmC64ZnmSGwd7aUQjbbDxfxIc7vHk=; b=K4gVzZWcua2cGj4kl4CBy3iSwW8RzO2TWTW+2827C7vjmpQpbWw2F2JpIvUDO+zQ41 6KmCuGogxx77Th/uHqxnUoQdYd2p5Q9VdhSXuKXntIqO/r5zSQ/FpEfwpbXlJzSln3tu OXprP+43VD89mPO1YbyOEeePBw3KVyIOEEXPhIMPOoBK+eXZc0Q6yRMCLRcuTH6NSUJm ueuOGmexejHP7d8qblOrajkX8u/o/2XX5+rfqiGOGpcyZGvBhtOgA0qD3/KPOuCGHHEq xia67RqK331V/2QH/ntxWZYwJlw1XPAY9oBh0acFjWBTRsZZrciQpJw/ziMe3IzPgnbQ K6+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=TZR3aAPxdCME5aZmC64ZnmSGwd7aUQjbbDxfxIc7vHk=; b=KZGP86pVenTcuNi/O15xE9we2f45+2NlvgLGYSH/8yjZ7+N2a5/r8sdHmc/KMjAnFw Fkdm+dP10FoUJxA/89rf+dduJSDxVUoW24C91FxwXsZMkCpXxaBzPqnCMw9E9gbnsoGp /Br48qWZhWq2gl4ooSoedEqcDYPphrN1zEc9M85OsCIT1GIjc61oEaMUUWL9ZZqemomj OVWLQt3nZN/7zOQhHW7ILS/baUg6X4QQH7262FYcC2veKun2kcRhvbKHkXr5dMOuqtFP XFrshpztZfuy+J0EkyK1n/ACfjm8uECW/h/2jUKJqFEYqGOrAIKddHB07EKn91nSkh60 p14g== X-Gm-Message-State: ABuFfogCs685EhaPBtAd8Fr9VzArrtzZAmPSvZfQGYKtOdkj70o342mD qMSapxsYb0SIpXOjLNbzILYVFdPi X-Google-Smtp-Source: ACcGV63loJELUtkvjZ3nyeAXoLtyUai0J2B3E4Jk/sGGUUptyaNNcw8+VpiaqJNpGWYFRmPr/NrssA== X-Received: by 2002:adf:9031:: with SMTP id h46-v6mr5506087wrh.248.1537722925293; Sun, 23 Sep 2018 10:15:25 -0700 (PDT) Received: from workstation.lan.schwierd.dedyn.io (p549C750E.dip0.t-ipconnect.de. [84.156.117.14]) by smtp.gmail.com with ESMTPSA id j191-v6sm12223679wmb.37.2018.09.23.10.15.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 23 Sep 2018 10:15:23 -0700 (PDT) From: Daniel Schwierzeck To: u-boot@lists.denx.de Date: Sun, 23 Sep 2018 19:15:16 +0200 Message-Id: <20180923171517.21363-3-daniel.schwierzeck@gmail.com> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180923171517.21363-1-daniel.schwierzeck@gmail.com> References: <20180923171517.21363-1-daniel.schwierzeck@gmail.com> MIME-Version: 1.0 Cc: Tom Rini Subject: [U-Boot] [PATCH 2/3] Kbuild: standalone: do not ignore platform-specific OBJCOPYFLAGS X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Currently the OBJCOPYFLAGS are cleared when assigning "-O srec" or "-O binary" for standalone programs. All flags set by arch-specific Makefiles are lost. This is bad if an arch demands arch-specific flags for the objcopy step. Signed-off-by: Daniel Schwierzeck Reviewed-by: Tom Rini --- examples/standalone/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/standalone/Makefile b/examples/standalone/Makefile index abe1bf1883..f01816f24f 100644 --- a/examples/standalone/Makefile +++ b/examples/standalone/Makefile @@ -62,11 +62,11 @@ quiet_cmd_link_elf = LD $@ $(ELF): $(obj)/%: $(obj)/%.o $(LIB) FORCE $(call if_changed,link_elf) -$(obj)/%.srec: OBJCOPYFLAGS := -O srec +$(obj)/%.srec: OBJCOPYFLAGS += -O srec $(obj)/%.srec: $(obj)/% FORCE $(call if_changed,objcopy) -$(obj)/%.bin: OBJCOPYFLAGS := -O binary +$(obj)/%.bin: OBJCOPYFLAGS += -O binary $(obj)/%.bin: $(obj)/% FORCE $(call if_changed,objcopy) From patchwork Sun Sep 23 17:15:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Schwierzeck X-Patchwork-Id: 973741 X-Patchwork-Delegate: daniel.schwierzeck@googlemail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="SJDFG+7y"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 42JDX75FJtz9s9G for ; Mon, 24 Sep 2018 03:16:39 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 72D55C21DF8; Sun, 23 Sep 2018 17:16:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 1B1A5C21EBD; Sun, 23 Sep 2018 17:15:36 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id B0959C21E39; Sun, 23 Sep 2018 17:15:31 +0000 (UTC) Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) by lists.denx.de (Postfix) with ESMTPS id 282A8C21E79 for ; Sun, 23 Sep 2018 17:15:27 +0000 (UTC) Received: by mail-wr1-f52.google.com with SMTP id n11-v6so6172177wro.0 for ; Sun, 23 Sep 2018 10:15:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=I1ZmjtD+GHHuVQRazNzC5LV4ZrMdKRjdDwPxnp+C76I=; b=SJDFG+7yFhHutOD07H8TlhFw6zVe8n4vQz0c7mG0PxwUPfgqyyHY2Cj/mqWopOg5i9 Vq5Tbd2fC8EmLghD9JcALK7riZq2iwqDByBnz1OBzz+e2NIEy2V/ORUJX0fkaW6+at3I xZ3vVzduXEKi+8eXoId2/qDNSrqPxESeDF1DDGFbFpTZS3jbTni9OUiJquX1yDrQDLJL CID3skurr8DIu0qwo04auNmzj3iWPbktz2aPvoF4Tur75nqmpcJ5PC/mrejaA6zfqoKR tOSta5LIA02mH4T/KSjL+8Pqg/V4AQlGT5T9b4oCgJne4tTy3ZXDq7u8kyqBxpphv9fY 2daQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=I1ZmjtD+GHHuVQRazNzC5LV4ZrMdKRjdDwPxnp+C76I=; b=rnJQkBLw9qidLLa/1aB+KO59L6LR+eDgdUCUl0U7KsxJFBJjjOM1WKD6T5sxJEsFRg 8+IiTIBucUdnFYxgwsaMrFmQa3A04cWwsUvKY79N37NdsgFmtajsLExyNM7OCorf+QNL k3mRMimJKA00MkOJJcHZjdf2WXXYXC79AYOVUmUBlrcI42ZkMQFHZWhEQ0BuOvXtiXKu EcH4z02QS514Q5xEuWlU7F9qZp/AW0IGegs8C9V5jf6cZSoaBIRcklBRhN66mJ5+Allh M9z7jplB6EWyw45LM1FQEdM0YBRDRcs2aL9Q+LZbToLUy2xMExbAj9356SgO+xeGFL5K HDXQ== X-Gm-Message-State: ABuFfoi5uFP865BnI4Eladwzil3yZl9u9oBXrZPbcRHSq2UF1+wtTyQa GDz0RC3BIW7M/ZO0mV+rdgAfdfgb X-Google-Smtp-Source: ACcGV63nULKtCeJG81yrwl2x3iurYrAjxErBsOYz7rLjdkoR7l5UyUcMoRVDvf80o09YOj9lal9k6A== X-Received: by 2002:adf:e711:: with SMTP id c17-v6mr5533133wrm.143.1537722926653; Sun, 23 Sep 2018 10:15:26 -0700 (PDT) Received: from workstation.lan.schwierd.dedyn.io (p549C750E.dip0.t-ipconnect.de. [84.156.117.14]) by smtp.gmail.com with ESMTPSA id j191-v6sm12223679wmb.37.2018.09.23.10.15.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 23 Sep 2018 10:15:25 -0700 (PDT) From: Daniel Schwierzeck To: u-boot@lists.denx.de Date: Sun, 23 Sep 2018 19:15:17 +0200 Message-Id: <20180923171517.21363-4-daniel.schwierzeck@gmail.com> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180923171517.21363-1-daniel.schwierzeck@gmail.com> References: <20180923171517.21363-1-daniel.schwierzeck@gmail.com> MIME-Version: 1.0 Cc: Tom Rini Subject: [U-Boot] [PATCH 3/3] MIPS: fix linking of standalone programs X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Use the global MIPS specific u-boot.lds for linking standalone programs instead of the outdated ones in examples/standalone/. Also pass --gc-sections in LDFLAGS_STANDALONE to optimize the size of standalone programs. Finally remove the deprecated config.mk files in arch/mips/cpu/mips[32,64]/. Signed-off-by: Daniel Schwierzeck --- arch/mips/config.mk | 5 ++++ arch/mips/cpu/mips32/config.mk | 7 ------ arch/mips/cpu/mips64/config.mk | 7 ------ examples/standalone/mips.lds | 42 ---------------------------------- examples/standalone/mips64.lds | 42 ---------------------------------- 5 files changed, 5 insertions(+), 98 deletions(-) delete mode 100644 arch/mips/cpu/mips32/config.mk delete mode 100644 arch/mips/cpu/mips64/config.mk delete mode 100644 examples/standalone/mips.lds delete mode 100644 examples/standalone/mips64.lds diff --git a/arch/mips/config.mk b/arch/mips/config.mk index 8aa45fc45c..1ae8bf7b71 100644 --- a/arch/mips/config.mk +++ b/arch/mips/config.mk @@ -25,12 +25,14 @@ ifdef CONFIG_32BIT PLATFORM_CPPFLAGS += -mabi=32 PLATFORM_LDFLAGS += -m $(32bit-emul) OBJCOPYFLAGS += -O $(32bit-bfd) +CONFIG_STANDALONE_LOAD_ADDR ?= 0x80200000 endif ifdef CONFIG_64BIT PLATFORM_CPPFLAGS += -mabi=64 PLATFORM_LDFLAGS += -m$(64bit-emul) OBJCOPYFLAGS += -O $(64bit-bfd) +CONFIG_STANDALONE_LOAD_ADDR ?= 0xffffffff80200000 endif PLATFORM_CPPFLAGS += -D__MIPS__ @@ -65,3 +67,6 @@ PLATFORM_LDFLAGS += -G 0 -static -n -nostdlib PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections LDFLAGS_FINAL += --gc-sections OBJCOPYFLAGS += -j .text -j .rodata -j .data -j .u_boot_list + +LDFLAGS_STANDALONE += -T $(srctree)/arch/mips/cpu/u-boot.lds +LDFLAGS_STANDALONE += --gc-sections diff --git a/arch/mips/cpu/mips32/config.mk b/arch/mips/cpu/mips32/config.mk deleted file mode 100644 index 662e4f8fc8..0000000000 --- a/arch/mips/cpu/mips32/config.mk +++ /dev/null @@ -1,7 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0+ -# -# (C) Copyright 2003 -# Wolfgang Denk, DENX Software Engineering, - -CONFIG_STANDALONE_LOAD_ADDR ?= 0x80200000 -LDFLAGS_STANDALONE += -T $(srctree)/examples/standalone/mips.lds diff --git a/arch/mips/cpu/mips64/config.mk b/arch/mips/cpu/mips64/config.mk deleted file mode 100644 index 6a53976b5c..0000000000 --- a/arch/mips/cpu/mips64/config.mk +++ /dev/null @@ -1,7 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0+ -# -# (C) Copyright 2003 -# Wolfgang Denk, DENX Software Engineering, - -CONFIG_STANDALONE_LOAD_ADDR ?= 0xffffffff80200000 -LDFLAGS_STANDALONE += -T $(srctree)/examples/standalone/mips64.lds diff --git a/examples/standalone/mips.lds b/examples/standalone/mips.lds deleted file mode 100644 index 163d6efefd..0000000000 --- a/examples/standalone/mips.lds +++ /dev/null @@ -1,42 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0+ */ -/* - * (C) Copyright 2003 - * Wolfgang Denk Engineering, - */ - -/* -OUTPUT_FORMAT("elf32-bigmips", "elf32-bigmips", "elf32-bigmips") -*/ -OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", "elf32-tradlittlemips") -OUTPUT_ARCH(mips) -SECTIONS -{ - .text : - { - *(.text*) - } - - . = ALIGN(4); - .rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) } - - . = ALIGN(4); - .data : { *(.data*) } - - . = .; - _gp = ALIGN(16) + 0x7ff0; - - .got : { - __got_start = .; - *(.got) - __got_end = .; - } - - .sdata : { *(.sdata*) } - - . = ALIGN(4); - __bss_start = .; - .sbss (NOLOAD) : { *(.sbss*) } - .bss (NOLOAD) : { *(.bss*) . = ALIGN(4); } - - _end = .; -} diff --git a/examples/standalone/mips64.lds b/examples/standalone/mips64.lds deleted file mode 100644 index d67396ab71..0000000000 --- a/examples/standalone/mips64.lds +++ /dev/null @@ -1,42 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0+ */ -/* - * (C) Copyright 2003 - * Wolfgang Denk Engineering, - */ - -/* -OUTPUT_FORMAT("elf32-bigmips", "elf32-bigmips", "elf32-bigmips") -*/ -OUTPUT_FORMAT("elf64-tradbigmips", "elf64-tradbigmips", "elf64-tradlittlemips") -OUTPUT_ARCH(mips) -SECTIONS -{ - .text : - { - *(.text*) - } - - . = ALIGN(4); - .rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) } - - . = ALIGN(4); - .data : { *(.data*) } - - . = .; - _gp = ALIGN(16) + 0x7ff0; - - .got : { - __got_start = .; - *(.got) - __got_end = .; - } - - .sdata : { *(.sdata*) } - - . = ALIGN(4); - __bss_start = .; - .sbss (NOLOAD) : { *(.sbss*) } - .bss (NOLOAD) : { *(.bss*) . = ALIGN(4); } - - _end = .; -}