From patchwork Tue Jun 23 19:59:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 191570 Delivered-To: patch@linaro.org Received: by 2002:a54:3249:0:0:0:0:0 with SMTP id g9csp1344361ecs; Tue, 23 Jun 2020 13:47:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy/0vOLKR4MY+ncTwptGrcWWQVwUHiqXMHXPiZDlQjDAfOJndVbgumASe7Ih+HavHFUAHhr X-Received: by 2002:a17:906:cc58:: with SMTP id mm24mr23389660ejb.134.1592945253076; Tue, 23 Jun 2020 13:47:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592945253; cv=none; d=google.com; s=arc-20160816; b=zpY3OZfvsCexSqigcRr5A8VLP8ohs/prCWxysFPOgeVMm4TqunMxaIG8RBQIjvosn5 syf4hBD3m/Gyx++Q6zy5bZ5CpAQ2f0PnBGIPTcjTbR0M0+sJBVIa3FfHORnX8pU2CFf5 oNg49I7+pC0rYuKImyo7LR1Cp1z0/IvZvlHyDYxBf28wIa4YdcbSVL0SiEyPP+0omoJe 46c6IgMFl05Q1QylRNvfy63oGYQOB5bf7PxQMuLS0Nr9k3fovZKHI5AqSRbCHBy6aiF7 AnWnYAkr70CkgrC9TuB7E6Xv68r0WxIYOOwFo218eJbmiR9+5glazsKcmlkqhKvPZvma HOzw== 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=5gy4Bt0eklBYPkNbZZ2lWYJoMxfd72+QBF/9su09okE=; b=c546clj5h/CHUuATxc1evmS3tMORLCw1FHZhtwuoTtCfuHqOrmyX4e/fCHVHCJy3/H P0lBMQFdSuGsfqkWi++bUv2nqjQUuHVKNmVkRB0cWgGUjwOQs5dFWvclloJq9rpHaWaB xXpovmuVBJWVEAgIefUQs7tBfTs670UdmD7zQGThHOaM3eo78LBHCRR3QIK3XuguGXX8 /DcBWhAuU5SFmj8aLrALJwRD0snDQxelfmHP4nZZSk7RLLPLZfQ2EcKJN/htzUK+u3iI CCxbbn0gZmB3OoOrxAoY8pQuT+ZbL24/oQRanr7p+DoKLvAUDO/xtYtvtndStetIb7ou voIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=kivFn7Kp; 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 si29si11480977ejb.40.2020.06.23.13.47.32; Tue, 23 Jun 2020 13:47:33 -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=kivFn7Kp; 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 S2392697AbgFWUr2 (ORCPT + 15 others); Tue, 23 Jun 2020 16:47:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:45870 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392687AbgFWUr1 (ORCPT ); Tue, 23 Jun 2020 16:47:27 -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 D3E6F21789; Tue, 23 Jun 2020 20:47:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592945247; bh=bZRuB5p9TGNz39dnIgVBa1C/bdUKLOcWkOgS+V9w8xM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kivFn7Kprtd9FS4u+Chu3y1gxHKMl2X0HUgqkABZ5iU+LwfHRQkkv8oxgEgfKK8SU GvyKlZfrbFRYoMygWn4RFGia1dxCpBA2dcsNCe8/GiYEGiJsTZV/oP+/9dupq0fA4G dEIrtBn2ystjGy++gsKcZJJP46cTO5f6ZW2XIvyg= 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 , Sasha Levin , Ilie Halip Subject: [PATCH 4.14 095/136] elfnote: mark all .note sections SHF_ALLOC Date: Tue, 23 Jun 2020 21:59:11 +0200 Message-Id: <20200623195308.445223780@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200623195303.601828702@linuxfoundation.org> References: <20200623195303.601828702@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 [ Upstream commit 51da9dfb7f20911ae4e79e9b412a9c2d4c373d4b ] 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 Signed-off-by: Sasha Levin --- include/linux/elfnote.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.25.1 diff --git a/include/linux/elfnote.h b/include/linux/elfnote.h index f236f5b931b2a..7fdd7f355b529 100644 --- 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