From patchwork Tue Jun 16 15:33:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 188068 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp3781606ilo; Tue, 16 Jun 2020 09:05:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzUtsnwxxVln8NxSYVj2p1QxCefS4dISwFxqka2H9xZ0WV2KSP78fvMXekbsl7uxbHIDs29 X-Received: by 2002:a50:ee18:: with SMTP id g24mr3327305eds.370.1592323510853; Tue, 16 Jun 2020 09:05:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592323510; cv=none; d=google.com; s=arc-20160816; b=vphSxxHgf0hpEDVC3G9sb0s4jo75XNz/QwxdiQ0Ujy57AgyFpQvq5rSyHn6t9bf/XP 95LVdhFIznbTbLLbp9Xsd9IRuQ0U4CQzcWyqLjs9H963IGBKIbPE0q6n4d3AghygiDD1 GBd43o2HZnQ/DKBWUobqjNrKvrVcwG1Ce5KIkwmlUlWvEniXYf99KecLcFyBB9Ejhinj hANz23JXzlfyeCzlBHTfJW4F4+9gCa3EqwXeMCzg8IPZPu18mbOJt3FLoDBPW+g7uveH EDDOs1W7d5ZFQg7tlEoMu5eM7veBjmCAwESDM/jEz9sJmdlJ2a/ZYoWLL5WR+yHBggU8 fPMw== 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=2qrLc9FoqsdOIMbAp1SaQZkyBt8GTM29JZMXogiUaX8=; b=QRSzGhRJuLwA3RQNJ1S9y888lDDpqNY2k26/eWTJ69NjOPUhwwFUY+jtZwZ1KODjPG 9ejw6alEp4S6v8sqfVvhj1XbF8bzGWbGKpMAVfT8ci4d4+mVIKWSDimX2MRXuc8dF3w2 CzqCQOST6tQTcnyM+HinNAvqhKXiuFGdt0liP8GEeFhqXiMXDgIBG84hPduI0jHctiul dmyuVzyeV1AjDlXsss4EIk1/d8pFe9SkqRN0IeSHNki7UcLbfvqG5+7Z8weJUTfs1Ll9 kL8/VtTtwfhTuRrZq0Qp5cnTBaHwZNaUBUYvJcSsLaH8MTY2Ip6fxXX3wJalWHRT+DG9 82Kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ugzR4CCo; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-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 qw12si11025562ejb.492.2020.06.16.09.05.10; Tue, 16 Jun 2020 09:05:10 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ugzR4CCo; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729794AbgFPQFJ (ORCPT + 15 others); Tue, 16 Jun 2020 12:05:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:44044 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732473AbgFPPtM (ORCPT ); Tue, 16 Jun 2020 11:49:12 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.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 C2F1F2071A; Tue, 16 Jun 2020 15:49:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592322552; bh=cR0PP+/MQZYLqQf3bbJfXoLuvhvnjpmt6Okx0cKiyf4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ugzR4CCo6RiDW7hayB/yjARNCvFGaFMe8YkxepG4xMJGHEyWq8KiKIxER1s335Iy/ mpuxje/ygGgOdt8pPBpkompgBZnpdOl0OPQrZlWphe0b8l65MFRYoAwN6u6Vt4/fdQ KBFHQvS2o1oNCh1/ABqhskzS2NzKdmv/c5itCu1E= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nick Desaulniers , Andrew Morton , Nathan Chancellor , Fangrui Song , Jeremy Fitzhardinge , Thomas Gleixner , Vincenzo Frascino , Linus Torvalds , Jian Cai , Ilie Halip Subject: [PATCH 5.6 013/161] elfnote: mark all .note sections SHF_ALLOC Date: Tue, 16 Jun 2020 17:33:23 +0200 Message-Id: <20200616153107.043647293@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200616153106.402291280@linuxfoundation.org> References: <20200616153106.402291280@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Nick Desaulniers commit 51da9dfb7f20911ae4e79e9b412a9c2d4c373d4b upstream. ELFNOTE_START allows callers to specify flags for .pushsection assembler directives. All callsites but ELF_NOTE use "a" for SHF_ALLOC. For vdso's that explicitly use ELF_NOTE_START and BUILD_SALT, the same section is specified twice after preprocessing, once with "a" flag, once without. Example: .pushsection .note.Linux, "a", @note ; .pushsection .note.Linux, "", @note ; While GNU as allows this ordering, it warns for the opposite ordering, making these directives position dependent. We'd prefer not to precisely match this behavior in Clang's integrated assembler. Instead, the non __ASSEMBLY__ definition of ELF_NOTE uses __attribute__((section(".note.Linux"))) which is created with SHF_ALLOC, so let's make the __ASSEMBLY__ definition of ELF_NOTE consistent with C and just always use "a" flag. This allows Clang to assemble a working mainline (5.6) kernel via: $ make CC=clang AS=clang Signed-off-by: Nick Desaulniers Signed-off-by: Andrew Morton Reviewed-by: Nathan Chancellor Reviewed-by: Fangrui Song Cc: Jeremy Fitzhardinge Cc: Thomas Gleixner Cc: Vincenzo Frascino Link: https://github.com/ClangBuiltLinux/linux/issues/913 Link: http://lkml.kernel.org/r/20200325231250.99205-1-ndesaulniers@google.com Debugged-by: Ilie Halip Signed-off-by: Linus Torvalds Cc: Jian Cai Signed-off-by: Greg Kroah-Hartman --- include/linux/elfnote.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/include/linux/elfnote.h +++ b/include/linux/elfnote.h @@ -54,7 +54,7 @@ .popsection ; #define ELFNOTE(name, type, desc) \ - ELFNOTE_START(name, type, "") \ + ELFNOTE_START(name, type, "a") \ desc ; \ ELFNOTE_END