Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp9002ybt; Tue, 23 Jun 2020 13:53:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx6EMKobsnnFTb2ycDCHaZeKXEGEGXaRxq/4ppJTNgEF96R6kT1BR+9Lv7V4BdBhkT8mkOJ X-Received: by 2002:a05:6402:22ca:: with SMTP id dm10mr23263082edb.115.1592945632134; Tue, 23 Jun 2020 13:53:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592945632; cv=none; d=google.com; s=arc-20160816; b=weOJY/lXYnao5TsaWbJq5usHCYU1SlvVX9mtslFqhl4SQzQGrGBxaLy/+AZTgUIDbQ 0NpjNFvINZ8/rwiqhjpUWt4lbvlLHKPNBNB2+0+qHk1j71kfVF/9RIqqRMj2TfoHU0Oq cORq6MAi4DwC0ROmj+yN1VIMpxCiv8wYTASKnHETbcswifIEOIjLzW35cQ2qnFz4alm0 uQtBGxAtS7g5oNWM4HHAo0hCcpOejvB4d8rgPyOQc4uR4GjAgt+7Ptv46N9KyPZTmuz8 evVfltiwIzTnmg0j/o/Px2CkuEsLZoTC6wMy4hKJAQh0DeBHOmvKSqqpq5h5fp1Nqu+O omow== 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=aGJ+93fLuOam5+ZSdjmhhD8LjXp8TyiQ3HuQYwG+/YBTMuJdUfNjmOXIqhjYGvQjcA uaKBlbjBjZg13P7up4bkZ8U1QUStYIecEYqFoJBWFWEXcDL1CH6PqoZOADGwU2AulW8H XlBN6lFEzRF1DRrqr7ATmjNtbxXF3ef+bDDZBP9H5DMOOuBmu9PzVmd2b90I5lT7Nbe5 PLySN9Gkp3jx/HRiO9zixZvI3f75k7rNtH71fUXWDW2NxGTFGYstB7VImKshxJR5U1Y2 cpfOfwrFsQ2CVD2w7rnwo6rc73ZMYW7ogaGBsbhuTJED/ft/yCM4dX9/WSmUEC6s7uqn 1iYg== 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 linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 lh24si11663244ejb.700.2020.06.23.13.53.28; Tue, 23 Jun 2020 13:53:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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 linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392701AbgFWUri (ORCPT + 99 others); Tue, 23 Jun 2020 16:47:38 -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 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 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(-) 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 -- 2.25.1