From patchwork Tue Jun 16 15:33:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 188075 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp3790799ilo; Tue, 16 Jun 2020 09:15:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxnFJ94Mwcug4lGrcFUu3YsC6t5ZKCuaNE4EL7c6vtB8m6XYwr25yiO3gXmERkLqEGqDQWO X-Received: by 2002:aa7:c607:: with SMTP id h7mr3371646edq.214.1592324100785; Tue, 16 Jun 2020 09:15:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592324100; cv=none; d=google.com; s=arc-20160816; b=PQ6zbx15xSVNb2zg8VIv7CYqeHuPwp4F8zjctJ6SfSWVsrb8L08Mj5LcMcGrK0Y1Oz f6mpAiIuL7g/UFSYrJsHq3xn4P/R2OB95m2gKPU2lHX35NDSsv7Ray0gYnTv9TUGpCeg mB1iGBE4Hr447j95o9Y45DK2FuYJlKGUuBIlIYv0TUbqxGFRKEPbsn+YjfKXDt0YhS58 5zbSN8sjwqajj/6rxqEu+ckvz1WsqgCS5jeK7C/MJfbwRPM0fBC3llpT6qcjh1MERjwm L8SHMgrtX2lIm2h0NbsSkCGyQFI2GG94UUmynuFviGSqoTc1T98S94rpddvhKMe+fhGP JQnA== 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=gS49+NCUQuIHxyS8xBWVOmGyIKEdCCEH5E6q2Sdmc+3/DY5s+YaCbG/HkCreHlxtgC KfWmtEKC8XE2Jw8jVpG7ORIFUibheUup5Z4VZAqMktcAoa3/dLHtdcpvKWFPap7jXqY2 /OYHhnRC7yRsxFW3Si2qDoOBiK+78zs+B2KI3f0gjMI1eXdPAwi7KPlK+8MdBd5fNxc/ QDs4iFKumdGWihqx5FbFyST5AMlj9Q+z6KdFaCnDZdSun0iGaQOCKRpxvY9utFuBNrRD QsObQZ00lZspU8y7j4qrtgeHp3Y3pHdqNU3l7N2Kr9PsCyVXjGx+LMNr/DvjL1YcHLB2 uXQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QbPCuNTj; 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 i7si11549003edb.116.2020.06.16.09.15.00; Tue, 16 Jun 2020 09:15:00 -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=QbPCuNTj; 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 S1731637AbgFPPmO (ORCPT + 15 others); Tue, 16 Jun 2020 11:42:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:58614 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730841AbgFPPmM (ORCPT ); Tue, 16 Jun 2020 11:42: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 CCB7620C56; Tue, 16 Jun 2020 15:42:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592322131; bh=cR0PP+/MQZYLqQf3bbJfXoLuvhvnjpmt6Okx0cKiyf4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QbPCuNTjTKXeLfeu1BTUxcJ6lmUCPX+MbTxIEpZBmeC+uJ/l9YQRo4q6cpZbNX8P8 CsyxaxTlMemE4G5/ZwDT6G+BK/dYpKwhuzXs80WlZvvlJ81VR9iKr7JpmC8aOl4ryq Wy38PXCkejE9jm9JTqYZFXnd66/qy6upXojHIbuY= 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.7 013/163] elfnote: mark all .note sections SHF_ALLOC Date: Tue, 16 Jun 2020 17:33:07 +0200 Message-Id: <20200616153107.510290511@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200616153106.849127260@linuxfoundation.org> References: <20200616153106.849127260@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