From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A2D90C433DF for ; Thu, 4 Jun 2020 23:50:52 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5B6C22087D for ; Thu, 4 Jun 2020 23:50:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="sXdCoxTK" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5B6C22087D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id F3514280059; Thu, 4 Jun 2020 19:50:51 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EBE00280005; Thu, 4 Jun 2020 19:50:51 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DB125280059; Thu, 4 Jun 2020 19:50:51 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0127.hostedemail.com [216.40.44.127]) by kanga.kvack.org (Postfix) with ESMTP id BFD77280005 for ; Thu, 4 Jun 2020 19:50:51 -0400 (EDT) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 8517F181AC9BF for ; Thu, 4 Jun 2020 23:50:51 +0000 (UTC) X-FDA: 76893177102.09.snake43_581669526d9b Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin09.hostedemail.com (Postfix) with ESMTP id 6C161180AD801 for ; Thu, 4 Jun 2020 23:50:51 +0000 (UTC) X-HE-Tag: snake43_581669526d9b X-Filterd-Recvd-Size: 3424 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf39.hostedemail.com (Postfix) with ESMTP for ; Thu, 4 Jun 2020 23:50:51 +0000 (UTC) Received: from localhost.localdomain (c-73-231-172-41.hsd1.ca.comcast.net [73.231.172.41]) (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 02054206DC; Thu, 4 Jun 2020 23:50:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591314650; bh=nbBTuiOzYlBjuyEKDz08sI0PlexoPCv0YWJw6Cez8Mw=; h=Date:From:To:Subject:In-Reply-To:From; b=sXdCoxTK/cEL4tyc5sxRdNNgDc6CSubfirjxegc4hLBaPjlWTq9wlqv5yDBAhsfY5 IEodizFrAPJdhgIvd2Fljd8RO+A/QpXkgU/qW2FrlHQmchTX0aOObcwkJQH3JzUih7 MSkQ3FnicAE9YJkjpIhOPRo/IxPUkE4Zb2k22OL8= Date: Thu, 04 Jun 2020 16:50:49 -0700 From: Andrew Morton To: akpm@linux-foundation.org, ilie.halip@gmail.com, jeremy@goop.org, linux-mm@kvack.org, maskray@google.com, mm-commits@vger.kernel.org, natechancellor@gmail.com, ndesaulniers@google.com, tglx@linutronix.de, torvalds@linux-foundation.org, vincenzo.frascino@arm.com Subject: [patch 088/127] elfnote: mark all .note sections SHF_ALLOC Message-ID: <20200604235049.-Sz-NmZC3%akpm@linux-foundation.org> In-Reply-To: <20200604164523.e15f3177f4b69dcb4f2534a1@linux-foundation.org> User-Agent: s-nail v14.8.16 X-Rspamd-Queue-Id: 6C161180AD801 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam03 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Nick Desaulniers Subject: elfnote: mark all .note sections SHF_ALLOC 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 Link: http://lkml.kernel.org/r/20200325231250.99205-1-ndesaulniers@google.com Signed-off-by: Nick Desaulniers Debugged-by: Ilie Halip Reviewed-by: Nathan Chancellor Reviewed-by: Fangrui Song Cc: Jeremy Fitzhardinge Cc: Thomas Gleixner Cc: Vincenzo Frascino Signed-off-by: Andrew Morton --- include/linux/elfnote.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/include/linux/elfnote.h~elfnote-mark-all-note-sections-shf_alloc +++ a/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 _