From patchwork Tue Jun 16 15:33:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 188079 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp3795510ilo; Tue, 16 Jun 2020 09:20:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwXvA6V8/VVDljuURPA40tzPMY3+9ttQEuvUrDf2UX03n/S4wAbuopKfqocD5XJ/Bv5GSr8 X-Received: by 2002:a17:906:1d1a:: with SMTP id n26mr3362845ejh.351.1592324427702; Tue, 16 Jun 2020 09:20:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592324427; cv=none; d=google.com; s=arc-20160816; b=WYGEsOvr3hXUmSoL1vY+PGAJoJXjtYa35XtdMxBCwCJBqrZVpM4i6prd8p/IzGMnrr n2JoOhnUq7YLGDJzRcgP50T07NB9B5X7vIX4AAtIYlhpnwJTZN0ijdBqfz6CVccsBmIm Xe18ZxSNL44xWqAywIrQTrEtrYUg4BDv7m3Ry1HelWGyUTmHRKvCrfG/wO/lq5OmcC1A sO7dsg33YDWWvBmKS0P6BWRUj4aQ0WgTGCnCclgjGBe18LO70iwn7ck+UoAllG4/5M1f Piki3tjk6zGm13D/PUQ4qM4Ak25yfGzBmuLUizLrVjexxRtoql1Kco5aa7BQZIvVUuxu w3RQ== 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=aQczp/29oQ9UXI0CDVue/xwFjm6mBcsDQIgwTuQqZJuxkQkWUFbmChQKuYcLIoa2xc Dc3jClbhHO2yJkWyuyIIdi8NpR1Oj4yBlzYpWcfctCE2QNQIeF4/qJwYOqyrOGV5uMqL TuOGxZsyKhAa/XTdpeF7YiJFvEmRvlWq8tqiOwrSkEJN3sQVcELUhJDGDMwDin8V0lFS yaDq2T94oYqoVRn5mkWfEemFSgE5nIawYUw97UgsWh7TLNlefISruvFw2KVClcoQ4WLs m+mlsSE7nwJg6SsBg97A1idmcNYQpq0bXSk5aoAjY5AkOUmmEmIu1BRWIWpQ35tlehnc uOAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=gjC737vE; 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 ch8si12737906ejb.345.2020.06.16.09.20.27; Tue, 16 Jun 2020 09:20:27 -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=gjC737vE; 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 S1729983AbgFPPgb (ORCPT + 15 others); Tue, 16 Jun 2020 11:36:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:47162 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729969AbgFPPg3 (ORCPT ); Tue, 16 Jun 2020 11:36:29 -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 4268C20C09; Tue, 16 Jun 2020 15:36:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592321787; bh=cR0PP+/MQZYLqQf3bbJfXoLuvhvnjpmt6Okx0cKiyf4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gjC737vEpAvDXMFIOwBZg2zpv/bpxLkrF12fjXrrIOu32Wi6g+ieCQYAMWQGjx+Nv 81zY6sHp6W5reoidUtv+UUfIFJC5cMclZKC0BPBZzdclo9xocdpylAmwtlczUVCvB6 IgstLisMGV20AVU/IP5EBzo/tPbAhuxCkZ5rCNFs= 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.4 008/134] elfnote: mark all .note sections SHF_ALLOC Date: Tue, 16 Jun 2020 17:33:12 +0200 Message-Id: <20200616153101.080422549@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200616153100.633279950@linuxfoundation.org> References: <20200616153100.633279950@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