Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1116427ybb; Wed, 25 Mar 2020 16:14:10 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuAx9bbwc1KqUzf8qjyVuw4poVGq8v+V0+4dTfiJfFHPRSyHQGDfLnFB18Gll+wfUEw3ZY3 X-Received: by 2002:a9d:6957:: with SMTP id p23mr4142826oto.299.1585178050770; Wed, 25 Mar 2020 16:14:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585178050; cv=none; d=google.com; s=arc-20160816; b=hsmzMrobUovbJlzcZzU2Th9KX0YyIZ6OQcLQ8EJ9xgaJZsvLkMJFKDHN1stSDwCAHR Y9ekZk/NvCDmOA9j4Kra91Tzyc4PtIw/uTsHGEXig0NIfZze9Hym3znyC9SRd/sshlo6 NgL1KMT/u7G5qyH3A9b7eD68uThli26ONueqgNtgfZecGl3JRrX8B901pUX+kzMThygs V9BEZ7qJ9OmfnieswNmL+eMQIsikw1aTZF+5brU7oKPz2L0bIvTaQXS2yAO30ZFKisBy mHhIHJ1JcrMGPNYFjpaJS+LgVwSULds+0r8Pao2Wp1Hw8dRiS+VYkh+hUAAiemFEGjZu oaCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:from:subject:mime-version :message-id:date:dkim-signature; bh=vYzRHAXTkQE8ShgnDZUpxP00w9EinAhnVmiKvXd/foI=; b=a41WKVlPJtjlbc56qPBxHYbIMDRykrCix+ClbvLdWleA4mnsFadGAVTjuoXFfs/QU5 6n1Lwr3RXxKNHCkB5nHBfWB6fEsuxx9A0SP+fbB35vWPyUU2HBevNtWbYozxIy27AgDo 0yowHRcsZde8RoEXCmiDBTBFF/hO5g7+Pe4c9SU81WvPswhcoaYyYzYFmFJJ9q43YuCf RpSoxRVUh/+wtdI6Rx+aq57KnL4Mq6iyR8mhBdwNt+hDamt0MTT4+Pkbv01bVXyUEyjK OwSqASahEctyhr8JzCCh/QjOVcNW+4a7EpKDVbIYKsFRaekTf9nN2S/H1qvL4xgq3+44 OXyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=q2FsSrJX; 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 y1si238196oti.52.2020.03.25.16.13.58; Wed, 25 Mar 2020 16:14:10 -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=q2FsSrJX; 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 S1727487AbgCYXNI (ORCPT + 99 others); Wed, 25 Mar 2020 19:13:08 -0400 Received: from mail-pj1-f73.google.com ([209.85.216.73]:43239 "EHLO mail-pj1-f73.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727389AbgCYXNI (ORCPT ); Wed, 25 Mar 2020 19:13:08 -0400 Received: by mail-pj1-f73.google.com with SMTP id i3so2824966pjx.8 for ; Wed, 25 Mar 2020 16:13:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=vYzRHAXTkQE8ShgnDZUpxP00w9EinAhnVmiKvXd/foI=; b=q2FsSrJXDpqfuBS5dk6JPgdvo0wd0sVkpC7LXX+qsUsfnNJ31JRkXM2KcjWClSiSDV L3qSepNYPIqEMhy1N2aXKWeTXTbTiMYqZP15NN/ToHeMNdq/EGjGsDhoqViMxgiyE5m2 xi+mX6gv+HaH28YiBTn59+rf4mF9HPFknk+hQ2nlozFrjj4dV8faD9Y/HnyUXszL+Ijr w9QkxblWDiMYzeAJwR18JvjgLcgsYhrtODqZTERNRgeAqwZwXEWE0e0uqoBBOeiK7BNy 3zihojs5+alZtFAu2ly/VfSb3cl2FCljwn0rkQH+Ue445Z7kl922+aYK1iPlvqxsq+EL vNrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=vYzRHAXTkQE8ShgnDZUpxP00w9EinAhnVmiKvXd/foI=; b=o2iq++BA/FAKzCaQNZAuMR+ZE9+dsk5X+WhctfYXZJFi/ScYdY6BoDrNkW0jScGd85 C7pU0dozsvLSCwfhZigAhdNaq4Ng3rcxjY5OxmDPZyDf/AWasLe7U1TZu4wdQOxoPLDj PWaZr2BobweuMYdpNljnquhrlvQC0lpnoMRKK4W9dk6evy31pv166Aa7Jbv2rPflVlKO gHmglOLByC2hAKe7W1GQ7zQFrmtedgFxt94lL9FfPDZG+N/6O32z4yQ20Vbjz2Efy51Q b7fkQq/yn4vuctZadyblnc0liQ918NaaKfu6gjqcV2U3H3kEch5UvrU+HTc5WuvWQPqu jhHw== X-Gm-Message-State: ANhLgQ0CFl0iW3LZQQ+ItiDD0EPlKp/CO8zShPnUBNwuQnaIfI0JKXp1 QVlARWkELfLKx7dUlgRXJ+atouiJ2NQSL+D7sFA= X-Received: by 2002:a17:90b:124a:: with SMTP id gx10mr6250888pjb.117.1585177985586; Wed, 25 Mar 2020 16:13:05 -0700 (PDT) Date: Wed, 25 Mar 2020 16:12:49 -0700 Message-Id: <20200325231250.99205-1-ndesaulniers@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.26.0.rc2.310.g2932bb562d-goog Subject: [PATCH] elfnote: mark all .note sections SHF_ALLOC From: Nick Desaulniers To: Thomas Gleixner , Andrew Morton Cc: clang-built-linux@googlegroups.com, Nick Desaulniers , Jeremy Fitzhardinge , Ilie Halip , Vincenzo Frascino , linux-kernel@vger.kernel.org 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 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 --- 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 -- 2.26.0.rc2.310.g2932bb562d-goog