From patchwork Thu Dec 8 03:22:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Stanley X-Patchwork-Id: 87189 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp647380qgi; Wed, 7 Dec 2016 19:23:19 -0800 (PST) X-Received: by 10.28.158.147 with SMTP id h141mr34928wme.59.1481167399203; Wed, 07 Dec 2016 19:23:19 -0800 (PST) Return-Path: Received: from theia.denx.de (theia.denx.de. [85.214.87.163]) by mx.google.com with ESMTP id 15si11329765wml.145.2016.12.07.19.23.18; Wed, 07 Dec 2016 19:23:19 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 85.214.87.163 as permitted sender) client-ip=85.214.87.163; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 85.214.87.163 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C9D33B384F; Thu, 8 Dec 2016 04:23:17 +0100 (CET) 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 FkBnuDVLINfl; Thu, 8 Dec 2016 04:23:17 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A51D0B3847; Thu, 8 Dec 2016 04:23:16 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 93342B3847 for ; Thu, 8 Dec 2016 04:23:12 +0100 (CET) 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 Y8hbsad2DqJQ for ; Thu, 8 Dec 2016 04:23:12 +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-pg0-f68.google.com (mail-pg0-f68.google.com [74.125.83.68]) by theia.denx.de (Postfix) with ESMTPS id 0BE1BB3846 for ; Thu, 8 Dec 2016 04:23:08 +0100 (CET) Received: by mail-pg0-f68.google.com with SMTP id p66so25386928pga.2 for ; Wed, 07 Dec 2016 19:23:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id; bh=Sx6pJ0ipooN/lx6Y7svTah+lNuAPEhb5sov1dZpTt1s=; b=G5aUW/ws/ufUufuw+VtmT/iUeHZwd786LmSw0hUnYQY43Vwek1fQQLM90zu1J6fmKb kVfXuQHGDpj+W+WY4FwlVZb6+4ApMoVEdhi9Y6SVVEW3+ShlQXzKVD4nX4t9TWopKhwA p8OWgJ7k99YoQ9jvtyzAMqQOPguC4/uTTDz4lv5Cylt9d8fbu1xCzVcfEAP+StE8MvJ4 S563xreR50SQXER/7j8WFpVW1rWXGxDXdrHxMFGRc/NKDrmBv4yHSguKB3pWBUi7GYiY STZxSS2b/GkteHHRkrxiTv91b6HZSGrMBFZc87QaVvVrY1P3ADk+cpWzlTfzbfYbHutX 4r5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=Sx6pJ0ipooN/lx6Y7svTah+lNuAPEhb5sov1dZpTt1s=; b=efJdb6jHPA1dSKbDrUjnD6FR4XDKgCe52sSYK6guToVat4BIwnWynFKFt0c8yLAyH9 0edvAk6fYCOJApMzJWqieM2kuSJaCfzh3Vqb1+Fw9VrLKV8DlrTJnz5FhO8RGvOVM0+3 dGCu8uEWPug+1ZUcSmXX5l85QqKyEBHif9SbTK1Z4rIBuyyTvrDuuBkMkR3ySGxVgJSo t9GikpgdzOmvVWlOfu7xJc8tsr4aE9kPEqfLwLCWopgNrh9iQbistWd1jSB3IiI7rFWm 7rfKRYj2JSsptpUO0reRhb7BEN1e0jqeaRw7jfZXAW6JI9Cu1SEtlaOUPNKiXAzLVo7A O7wQ== X-Gm-Message-State: AKaTC02+wdXxh9DjwjdGC9L9ZETdfZ3pHKxr8T2zBDmkFaCTWyVbI9n1jQYJdmVfGQCWQA== X-Received: by 10.84.170.195 with SMTP id j61mr154696505plb.13.1481167387133; Wed, 07 Dec 2016 19:23:07 -0800 (PST) Received: from aurora.jms.id.au (bh02i525f01.au.ibm.com. [202.81.18.30]) by smtp.gmail.com with ESMTPSA id f14sm45763850pfk.5.2016.12.07.19.23.01 (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 07 Dec 2016 19:23:06 -0800 (PST) Received: by aurora.jms.id.au (sSMTP sendmail emulation); Thu, 08 Dec 2016 14:22:57 +1100 From: Joel Stanley To: u-boot@lists.denx.de, sjg@chromium.org Date: Thu, 8 Dec 2016 14:22:51 +1100 Message-Id: <20161208032251.8774-1-joel@jms.id.au> X-Mailer: git-send-email 2.11.0 Cc: raltherr@google.com, npiggin@gmail.com, amodra@gmail.com Subject: [U-Boot] [PATCH] Makefile: Fix linking with modern binutils X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Since Binutils 1a9ccd70f9a7[1] u-boot will not link targets that set CONFIG_SYS_TEXT_BASE=0 with the following error: LD u-boot arm-linux-gnueabi-ld.bfd: u-boot: Not enough room for program headers, try linking with -N arm-linux-gnueabi-ld.bfd: final link failed: Bad value The issue can reproduced the bad binutils and the rock2_defconfig target. This issue was also encountered by the powerpc kernel[2], with the fix being to pass --no-dynamic-linker for linkers newer than 2.26 when this flag was introduced. While version 2.26 and 2.27 will not show this error, we are technically creating invalid ELF files without this option. Ubuntu Zesty's Binutils 2.27.51.20161202 hits this error. [1] https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=1a9ccd70f9a7 [2] https://git.kernel.org/cgit/linux/kernel/git/powerpc/linux.git/commit/?h=next&id=ff45000fcb56b5b0f1a14a865d3541746d838a0a Signed-off-by: Joel Stanley --- Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) -- 2.11.0 _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot Reviewed-by: Simon Glass diff --git a/Makefile b/Makefile index dfed58bec661..0bfd57d81646 100644 --- a/Makefile +++ b/Makefile @@ -792,7 +792,11 @@ ifneq ($(CONFIG_BUILD_TARGET),) ALL-y += $(CONFIG_BUILD_TARGET:"%"=%) endif -LDFLAGS_u-boot += $(LDFLAGS_FINAL) +# Avoid Not enough room for program headers on binutils 2.28 onwards. +# Flag was introduced in 2.26 +LDFLAGS_u-boot += $(LDFLAGS_FINAL) \ + $(call ld-ifversion, -ge, 22600000, --no-dynamic-linker) + ifneq ($(CONFIG_SYS_TEXT_BASE),) LDFLAGS_u-boot += -Ttext $(CONFIG_SYS_TEXT_BASE) endif