From patchwork Tue Jun 23 19:57:45 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: 191580 Delivered-To: patch@linaro.org Received: by 2002:a54:3249:0:0:0:0:0 with SMTP id g9csp1351827ecs; Tue, 23 Jun 2020 14:00:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwN+8ZAZpqx4nfrsGVGt7jcr6Ra35XjTHIRfP6Qivplmms8b+WFg8yhltbvIGvx1ddpoX22 X-Received: by 2002:a05:6402:17ce:: with SMTP id s14mr23461670edy.53.1592946024780; Tue, 23 Jun 2020 14:00:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592946024; cv=none; d=google.com; s=arc-20160816; b=oFhZvem0XlDI6ODO4/+QOiWk2kSSD3ta2Ft2SC66fv9Ik/yNmc/Fzfa/H1hUx2ZziX i33SuuuuZHKk0IK8uC95udPuYYcPbeT/gxufuXDwWTj21cMMYI6J8F0XNJUgydlf2Guv HcxZVgxaJ7IKOKtOQaCJiS/Mar6pX5zjPe+cCxQXyjK17lmqNB4OIWmSAHDWDIJum+Da OS+tAKGxUOIp9/cVyMMd112wGpdEynynmlDrwfHYkbzAX2i4mKW+F32fIzI3xqSSEO+6 b9JBqJtFNXivLhtBZB7nmXsYmWMkO3IQVuKDs7ZLyb6j4h3b5uWPLwvhyTaqnmTK192H if4g== 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=PM4ExYg6oHdvfDbmQ2d/t2hTgahIPYBXVRDpZNPlQGF5CO5UkGahn1hz2EkOYh4zTm +c2wUGFGJ5U/Twedh8kTzRU2Y7eS/9Gsunt+3ewcmPHg9bbDgGMLADXOKi6b8PplBpU6 R+ZuXg3+LoA76Qdgt2Cdm/Uz8sx23zgJwIfdZFOaqBgs7GhiK7QPfSpmMuq2hHuY6dB9 HL/2jy0kmM3lETgg/pfZPUutRij8NoGDsrCKai/SitLsl9En9oBZLVvsMTJcKL9khztA f+DXwFu+ho4UBP50OtosvgZLDqGOYDf33d7ts7NHEohtRGmixBehJ/XqplNusSdDUfc0 +gTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=OLbgc8Zh; 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 mb2si11438958ejb.710.2020.06.23.14.00.24; Tue, 23 Jun 2020 14:00:24 -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=OLbgc8Zh; 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 S2403939AbgFWVAX (ORCPT + 15 others); Tue, 23 Jun 2020 17:00:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:36232 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392205AbgFWUkR (ORCPT ); Tue, 23 Jun 2020 16:40:17 -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 515A72053B; Tue, 23 Jun 2020 20:40:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592944816; bh=bZRuB5p9TGNz39dnIgVBa1C/bdUKLOcWkOgS+V9w8xM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OLbgc8ZhPGw+C2z4HpdUxLuodbksXnDc6P0oDqbHxYPSMxk9ra3q3DyW9LmQRmrRz y51+GhaOAZAd1lgIoeSGz76h8XlFr85gg6NZ1yXcl4bIIW5iDkBfJOBGvjV3I3RCcJ Ywff87Wy1O8FEqfUanMNfYO64ikaD9ZbF1W71gis= 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.19 137/206] elfnote: mark all .note sections SHF_ALLOC Date: Tue, 23 Jun 2020 21:57:45 +0200 Message-Id: <20200623195323.728281701@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200623195316.864547658@linuxfoundation.org> References: <20200623195316.864547658@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