Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3029757imu; Mon, 19 Nov 2018 09:34:45 -0800 (PST) X-Google-Smtp-Source: AJdET5e/CXwtPEqulLOqX/zecOEmgdlNjDIKxXpOgG7qm2MfO1mq5DSKVi8QWVc1rsdUQuIdX0Q+ X-Received: by 2002:a63:7c13:: with SMTP id x19mr20678750pgc.45.1542648885683; Mon, 19 Nov 2018 09:34:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542648885; cv=none; d=google.com; s=arc-20160816; b=WUUrI4cNlX0rchIBDyXIEnkCjTuLyYK9PCXNxmVUT8EA4nrh0Wf1us4vLRwpVZ4Bks QJ8fRBsOYBTwq3tUe4Bhp1nsibDZcuvSM3+WVj4bRMQEnEr4qoMgfXerICMdPVjlwiq2 r1VYcT6ZcuIsVek3L0Tg/gn6FaXdQ1JGJ3HbBgX9xgI16BkTn22IBCUPr+wUHEeh5l87 FknboeUtuMOB0JrVf2xKYDg6hWi1/qUC/z5OSKURBMFxZ7sati4o1Y3SrH5llQxhOv0n t0R0OprmeJwZs9tRLxB8myEdmeVRiq0tmf3sbKZCOeBH74i0UUGw/aDxE+R1Wx1oJeBz Vpgw== 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:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=1bzRLLIQ2X1jIM/m5mO6O1b5a6rHBlkEbukxSMIMddQ=; b=lJQ/+jxzqr1+Cd3cUwAYCbYtqXlK8TyXwv07YbfixiNpHvRfqkq2kqamw7Fp+cKNxc Pb/YcALicqhgthC+QUdxwf/tHmbOZuxMuVAzpZijkw0CjoyFJT5Of0aj0EyZXxnYfBwy ia+CdZejFItRA+bAuLTL/CLbM5KWb2siz1Xq5vKOkX8Cukhza2GG7jNF5zlatYUzXzB9 0dp3E9DBd4YlhujSaMpuatMa4dZkE2gkfoXl/EkTjX5rAAoWz7k507UpPRBXZw1Vzc4e JvlcKq99bTSf0hC86f9hvJmWWWcPURMesHKz4UXGPLdDaxziQ4Tv4rMav14NF5njEyTD cKgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=EFznkIf+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a26si35509497pgl.282.2018.11.19.09.34.23; Mon, 19 Nov 2018 09:34:45 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=EFznkIf+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2403881AbeKTDRx (ORCPT + 99 others); Mon, 19 Nov 2018 22:17:53 -0500 Received: from mail.kernel.org ([198.145.29.99]:56458 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390798AbeKTDRv (ORCPT ); Mon, 19 Nov 2018 22:17:51 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 582EF21104; Mon, 19 Nov 2018 16:53:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1542646417; bh=UKUX/fJw9ePzWMPgIUy2sMq21tYpgZLJ0vM+p4d0uy8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EFznkIf+Asn3lvmgFmkhJGBVSKviYpEyN6SCMfkmw0I5n1aZ+5eImtfwB01Jp9A/7 SvAtZIyeFHY0CcmD4queK00JxJJrLFJhsL+C7hcSf+TgZJMlqlBayU+48OSsi8VwpU IPOf26lFZEr0j5GGAyezmCke54X4tqxhEwtJWsAQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Joel Stanley , Nick Desaulniers , Michael Ellerman , Sasha Levin Subject: [PATCH 4.9 08/83] powerpc/boot: Ensure _zimage_start is a weak symbol Date: Mon, 19 Nov 2018 17:28:34 +0100 Message-Id: <20181119162613.616220652@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181119162612.046511542@linuxfoundation.org> References: <20181119162612.046511542@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Joel Stanley [ Upstream commit ee9d21b3b3583712029a0db65a4b7c081d08d3b3 ] When building with clang crt0's _zimage_start is not marked weak, which breaks the build when linking the kernel image: $ objdump -t arch/powerpc/boot/crt0.o |grep _zimage_start$ 0000000000000058 g .text 0000000000000000 _zimage_start ld: arch/powerpc/boot/wrapper.a(crt0.o): in function '_zimage_start': (.text+0x58): multiple definition of '_zimage_start'; arch/powerpc/boot/pseries-head.o:(.text+0x0): first defined here Clang requires the .weak directive to appear after the symbol is declared. The binutils manual says: This directive sets the weak attribute on the comma separated list of symbol names. If the symbols do not already exist, they will be created. So it appears this is different with clang. The only reference I could see for this was an OpenBSD mailing list post[1]. Changing it to be after the declaration fixes building with Clang, and still works with GCC. $ objdump -t arch/powerpc/boot/crt0.o |grep _zimage_start$ 0000000000000058 w .text 0000000000000000 _zimage_start Reported to clang as https://bugs.llvm.org/show_bug.cgi?id=38921 [1] https://groups.google.com/forum/#!topic/fa.openbsd.tech/PAgKKen2YCY Signed-off-by: Joel Stanley Reviewed-by: Nick Desaulniers Signed-off-by: Michael Ellerman Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- arch/powerpc/boot/crt0.S | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/arch/powerpc/boot/crt0.S +++ b/arch/powerpc/boot/crt0.S @@ -47,8 +47,10 @@ p_end: .long _end p_pstack: .long _platform_stack_top #endif - .weak _zimage_start .globl _zimage_start + /* Clang appears to require the .weak directive to be after the symbol + * is defined. See https://bugs.llvm.org/show_bug.cgi?id=38921 */ + .weak _zimage_start _zimage_start: .globl _zimage_start_lib _zimage_start_lib: