Received: by 2002:a25:1104:0:0:0:0:0 with SMTP id 4csp497102ybr; Fri, 22 May 2020 11:32:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxnLDf3LejbddPDGXxQEbzgBsmeslukUSnSvfUKA9oSySFfxTsAuIPJe2XyIR5FhpTsWhV2 X-Received: by 2002:a17:906:8283:: with SMTP id h3mr10170088ejx.415.1590172335315; Fri, 22 May 2020 11:32:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590172335; cv=none; d=google.com; s=arc-20160816; b=tdqitO6JhpESa8y/VcP8oqT+W5LGVpUql4nb/yb/wST7XQPEFHdpWsl/gw0txanOc8 W713TvTig7mt6/aWAkzGck+HKthf2xNyHUxyLGfTPowsL6pIFRZ4YarWvVs0Qe4vrwTt wZUYELLCHLGXs8pxGQeRJ5e3+jelYJkVG9Y5G+OArCbdsO5U64uD01hXU2uVTYXC9j5S cNr+vpoojRK4wUSh2uEfziotWmsuWKrqjaKqoB1+lG2LvVPx8m5f8pqaknSpi419916t slAdv5EK5XHivOLscqA+lRNWx63UjZ/raT3XVJOBBmH+8Wr2bW7knj0aP/3MC17IzinO zpng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :robot-unsubscribe:robot-id:message-id:mime-version:references :in-reply-to:cc:subject:to:reply-to:from:date; bh=9CjThWYrx3xVqPW+3BlVDZu/wnLCrth5XhnyvSQlibc=; b=utmAHktZ5f5l8SzmZ10ePGTSGm+oClWd3tFYg9LnsDRseQVVywvOXFEpwFBNQy87i6 cIeNWafqQ/Ba9w4VSkivqDElklljYELzHmWUi4GAEoTke6NT8soUyoVXtgw3oc+sJEzA xYDCaaoVsYoq3MEuqZmujbAQ6ZLdk+mybWKrLcxPT+dXCEx6eahzARjVfqFHiir4ohXq RV0AgNJNBuv/hUWSVOvlZJ9HmBerDnn2V5vltPYfftLBD95vxljcE6c39mM/bnudX9Jx AgV+RPI2fNlMYHUUOqUjadVJFPDiuj6xMnuPnwWdgl+lyydabr3lBHYbrqH0QY6xDvE+ cOmQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o24si5003188ejb.672.2020.05.22.11.31.52; Fri, 22 May 2020 11:32:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730930AbgEVSaW (ORCPT + 99 others); Fri, 22 May 2020 14:30:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35024 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730824AbgEVSaU (ORCPT ); Fri, 22 May 2020 14:30:20 -0400 Received: from Galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A08D5C061A0E; Fri, 22 May 2020 11:30:20 -0700 (PDT) Received: from [5.158.153.53] (helo=tip-bot2.lab.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1jcCQy-0002kr-Kl; Fri, 22 May 2020 20:30:16 +0200 Received: from [127.0.1.1] (localhost [IPv6:::1]) by tip-bot2.lab.linutronix.de (Postfix) with ESMTP id 3E7FD1C0095; Fri, 22 May 2020 20:30:16 +0200 (CEST) Date: Fri, 22 May 2020 18:30:16 -0000 From: "tip-bot2 for Arvind Sankar" Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: efi/urgent] x86/boot: Mark global variables as static Cc: Mike Lothian , Arvind Sankar , Ard Biesheuvel , x86 , LKML In-Reply-To: <20200511225849.1311869-1-nivedita@alum.mit.edu> References: <20200511225849.1311869-1-nivedita@alum.mit.edu> MIME-Version: 1.0 Message-ID: <159017221614.17951.9790248963724097639.tip-bot2@tip-bot2> X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the efi/urgent branch of tip: Commit-ID: e78d334a5470ead861590ec83158f3b17bd6c807 Gitweb: https://git.kernel.org/tip/e78d334a5470ead861590ec83158f3b17bd6c807 Author: Arvind Sankar AuthorDate: Mon, 11 May 2020 18:58:49 -04:00 Committer: Ard Biesheuvel CommitterDate: Thu, 14 May 2020 11:11:20 +02:00 x86/boot: Mark global variables as static Mike Lothian reports that after commit 964124a97b97 ("efi/x86: Remove extra headroom for setup block") gcc 10.1.0 fails with HOSTCC arch/x86/boot/tools/build /usr/lib/gcc/x86_64-pc-linux-gnu/10.1.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: linker defined: multiple definition of '_end' /usr/lib/gcc/x86_64-pc-linux-gnu/10.1.0/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/ccEkW0jM.o: previous definition here collect2: error: ld returned 1 exit status make[1]: *** [scripts/Makefile.host:103: arch/x86/boot/tools/build] Error 1 make: *** [arch/x86/Makefile:303: bzImage] Error 2 The issue is with the _end variable that was added, to hold the end of the compressed kernel from zoffsets.h (ZO__end). The name clashes with the linker-defined _end symbol that indicates the end of the build program itself. Even when there is no compile-time error, this causes build to use memory past the end of its .bss section. To solve this, mark _end as static, and for symmetry, mark the rest of the variables that keep track of symbols from the compressed kernel as static as well. Fixes: 964124a97b97 ("efi/x86: Remove extra headroom for setup block") Reported-by: Mike Lothian Tested-by: Mike Lothian Signed-off-by: Arvind Sankar Link: https://lore.kernel.org/r/20200511225849.1311869-1-nivedita@alum.mit.edu Signed-off-by: Ard Biesheuvel --- arch/x86/boot/tools/build.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/arch/x86/boot/tools/build.c b/arch/x86/boot/tools/build.c index 8f8c8e3..c8b8c1a 100644 --- a/arch/x86/boot/tools/build.c +++ b/arch/x86/boot/tools/build.c @@ -59,14 +59,14 @@ u8 buf[SETUP_SECT_MAX*512]; #define PECOFF_COMPAT_RESERVE 0x0 #endif -unsigned long efi32_stub_entry; -unsigned long efi64_stub_entry; -unsigned long efi_pe_entry; -unsigned long efi32_pe_entry; -unsigned long kernel_info; -unsigned long startup_64; -unsigned long _ehead; -unsigned long _end; +static unsigned long efi32_stub_entry; +static unsigned long efi64_stub_entry; +static unsigned long efi_pe_entry; +static unsigned long efi32_pe_entry; +static unsigned long kernel_info; +static unsigned long startup_64; +static unsigned long _ehead; +static unsigned long _end; /*----------------------------------------------------------------------*/