Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp892644ybb; Fri, 10 Apr 2020 12:14:16 -0700 (PDT) X-Google-Smtp-Source: APiQypI/1r2uWEJm4cDcj8YyDhwZ6z4+Q9rl0Y6GxM8MaREyKxamGBADdh6s3ovP/yX473yGifCz X-Received: by 2002:a05:620a:1019:: with SMTP id z25mr5538983qkj.479.1586546056084; Fri, 10 Apr 2020 12:14:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586546056; cv=none; d=google.com; s=arc-20160816; b=a93qjkWjqGM46/IeQkS+/4uJDZ7TivIdIE28aD/V1OTSoE6gTKtFBodVpr3GGTRAj2 GSIEF8ciSQZYI92uNY1YBNyIjd8O+u9o22Fs8UKaYzJEKlYiRCisiHhEvO8EI+KaOJ0M NkqQ1uU2htYEKBvFMSPiry8w/0987mGPj9Vt1Sjalnr+mHCaj6sV1TNKJoge7KR1aekx esi/ERExkC/VVxk1iby3NXWfeMJlZ4zgBEkt6Jop0CTEBiOYV0sx7voRov+JxHRSWtgU YovDBXVQ+VakEE7YNJeJQTD73Y2c3JqvKywRrpp6cEgqmyY6zn8kX58xCQwqI1AK5D7Q izHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=3NQtoOnuEyxQY/FXT5lwephyBfBpFPfFqIghUX3xTuc=; b=XxQ7jNVcYAU7nhQSLyVCoK/DN5IPd402j/uVJ0QX3o9DNdq9NM5A4npl18OjQKfo67 ETcpCsGnw4zoxdDRPfcwXOs2DSLQlLc/pgRbgURejd+0ckfhXdgfQBMy0pvTOo28Myzy uVbUMAaKyeui2ZJE5xAHWC1887bAoQdHILPFHbN34NkyeEK9H8Ax19BbgRV1ajCD0uhT tBf129Ot5O5HHp+n+v7C711j8kU0v9M/lkbOmypV4fc9bDlNLwmEUYqc5qDeb4z3cVTt 0t8255BPAAaRtuf0uq//2Wc5mwSNi7aQ6hgpcgr4DxbpQBKD+oNpkr4bvVZ5n4to+SpD 7JbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=H+d2DRuC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m6si1575244qtn.211.2020.04.10.12.14.00; Fri, 10 Apr 2020 12:14:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=H+d2DRuC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726735AbgDJTMb (ORCPT + 99 others); Fri, 10 Apr 2020 15:12:31 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:40461 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726142AbgDJTMa (ORCPT ); Fri, 10 Apr 2020 15:12:30 -0400 Received: by mail-pg1-f195.google.com with SMTP id c5so1347934pgi.7 for ; Fri, 10 Apr 2020 12:12:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=3NQtoOnuEyxQY/FXT5lwephyBfBpFPfFqIghUX3xTuc=; b=H+d2DRuC5uWXZpX/3zSYsDctHQDJdl5XvbQUIahyvyhCvUUEkAOZTLvlJ4MdVDrAxJ hwuXLFDFu7au0oPsmF5ZRM75oMAQU1ziYWJgIrhJWjMCwpSVsn/3bbrd/Xht7H+tzGfu JSsZQPO5URTEHKm1Js91otw06j96spA1T+3VsF9z5KowXxZBRi3OlhMqrqBuV1NL7X6G 4bcXp1zOJXStN1i2UjAa8JKmChnosagW0ChvFARU5XsgMh2iWKltXwXx8rIvBW+KLcMs fcmISbQSCWu3nbMYK9BPqBLB8dqMaDfgCMmXbc1eUhE+8t8Do9oyLyeHCc1HAzDmC6Ty Uzjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=3NQtoOnuEyxQY/FXT5lwephyBfBpFPfFqIghUX3xTuc=; b=kX45+HBtSQrSCG4TPd09DZMiykEos0o4PiWh6OeXFQsz8XwQHVmLj9uNL8LM3QTLte AIScZvxackMsb+iNXKSRl8t4XPW87ECjW3xufti9QzZGh9G2qBt6Kexy2lP6ask/71EX XnIcci2ma1U3mZekQx6B40J5bAbMWF+M9lYscz606StrJ53PEEEeEuds6QOPdmNhdhGu bqciYjP0osYw8TVpndk/Wx1VASV/JV3lZVug+tOhpINvW6QFXgcqK3PG2bMIuwsEtsLB PPTG5QNzknPgyvT7eYYKAwxQ+MkjL3djPVKB5aYhnCKqSOmgYvbewsvjzmX9CoqU2Jrj hYEA== X-Gm-Message-State: AGi0PuYIchJmiR5VG5REirxTKFKJHYMCofDsHo9fN7f/3vPuUCx8yf/0 isAiXmbKT6Xfivb/DZcgcS9BubBj9kYXJhGVlGS00Q== X-Received: by 2002:a63:6604:: with SMTP id a4mr5543148pgc.381.1586545949327; Fri, 10 Apr 2020 12:12:29 -0700 (PDT) MIME-Version: 1.0 References: <20200325231250.99205-1-ndesaulniers@google.com> <20200403222458.GA49554@ubuntu-m2-xlarge-x86> <20200404004020.jilng63qqyccbgke@google.com> In-Reply-To: <20200404004020.jilng63qqyccbgke@google.com> From: Nick Desaulniers Date: Fri, 10 Apr 2020 12:12:18 -0700 Message-ID: Subject: Re: [PATCH] elfnote: mark all .note sections SHF_ALLOC To: Thomas Gleixner , Andrew Morton Cc: Nathan Chancellor , clang-built-linux , Ilie Halip , Vincenzo Frascino , LKML , Fangrui Song Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org (bumping for review) On Fri, Apr 3, 2020 at 5:40 PM Fangrui Song wrote: > > On 2020-04-03, Nathan Chancellor wrote: > >On Fri, Apr 03, 2020 at 03:13:34PM -0700, 'Nick Desaulniers' via Clang Built Linux wrote: > >> dropping Jeremy; I got bounceback from the email address. Ping for review? > >> > >> On Wed, Mar 25, 2020 at 4:13 PM Nick Desaulniers > >> wrote: > >> > > >> > 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 > >> > > >> > Link: https://github.com/ClangBuiltLinux/linux/issues/913 > >> > Cc: Jeremy Fitzhardinge > >> > Debugged-by: Ilie Halip > >> > Signed-off-by: Nick Desaulniers > > > >Reviewed-by: Nathan Chancellor > > I asked on binutils@sourceware.org whether GNU as is willing to change. > https://sourceware.org/pipermail/binutils/2020-March/109997.html > I'll also ping that thread. > > > Reviewed-by: Fangrui Song > > >> > --- > >> > Ilie has further treewide cleanups: > >> > https://github.com/ihalip/linux/commits/elfnote > >> > This patch is the simplest to move us forwards. > >> > > >> > 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 594d4e78654f..69b136e4dd2b 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 > >> > > >> > -- -- Thanks, ~Nick Desaulniers