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=-2.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=no 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 7D856C433DF for ; Wed, 24 Jun 2020 15:28:40 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 472C62078A for ; Wed, 24 Jun 2020 15:28:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="qEFUZepC"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="r3bJkm2M" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 472C62078A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=3M1bqK7fBOCr15BHJclOAzwikWI0XZCYdZ99RO5eu7A=; b=qEFUZepCYfkANVqE68dvwSPTG 65OtEs5fAEzbhlqNHvwBm0qxbOQGepC/awLxK6tr6i+62xUbBhGsl+goJDB0EJFjhWsW2YEvgJgAI iRm3JJZf0+zE5lfFzshPLy+LgLB/Y8OUM86d4jCeB1eYXYaNa+/Z0SCuAgDGjExWhzH/5/hJKXVCQ NY+itopBCq38AZwiXY588Pa91QvERqpWpTogSj/BlK8D6+8FOpjJVn5acdvPffgGvs18w5E9F2E70 K4pqyW3KzYPuyYJWSl1KopTWJGcFAg67ZGDN8nfZ/4hd1AWItnGZ5EshRp9BBACVH8Nq+Kv4Q4Hig eilPYha7w==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jo7If-0006qQ-2b; Wed, 24 Jun 2020 15:26:57 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jo7Ib-0006na-UO for linux-arm-kernel@lists.infradead.org; Wed, 24 Jun 2020 15:26:54 +0000 Received: from willie-the-truck (236.31.169.217.in-addr.arpa [217.169.31.236]) (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 C1DC420723; Wed, 24 Jun 2020 15:26:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593012413; bh=kbsPqR41mDQFRVRa/Xnpp1Pv9SDbHGBQli339a9qb5g=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=r3bJkm2MXiop59E/l6uaJdpBwnsGC+S1xUHZEXGDiL9v5WJjP6SMvcWpkPkWKQwDR hIEtVuLG9LyErnHjnp7nb3rWM4L4oiqJF0/Vnan8sFUoo2M+2SQcdbSXcCA6n/7TaZ OJwgw+Tte6/JzW6hAJvlS1k70DYSB7MB0dJPcdU0= Date: Wed, 24 Jun 2020 16:26:46 +0100 From: Will Deacon To: Dave Martin Subject: Re: [PATCH v3 3/9] efi/libstub: Remove .note.gnu.property Message-ID: <20200624152646.GA6768@willie-the-truck> References: <20200624014940.1204448-1-keescook@chromium.org> <20200624014940.1204448-4-keescook@chromium.org> <20200624033142.cinvg6rbg252j46d@google.com> <202006232143.66828CD3@keescook> <20200624104356.GA6134@willie-the-truck> <20200624112647.GC6134@willie-the-truck> <20200624134854.GF25945@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200624134854.GF25945@arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , linux-efi , Catalin Marinas , Arvind Sankar , Thomas Gleixner , linux-arch , Fangrui Song , Masahiro Yamada , X86 ML , Russell King , Ard Biesheuvel , clang-built-linux , Ingo Molnar , Borislav Petkov , Kees Cook , Arnd Bergmann , Nathan Chancellor , Peter Collingbourne , Linux ARM , Nick Desaulniers , Linux Kernel Mailing List , James Morse Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Jun 24, 2020 at 02:48:55PM +0100, Dave Martin wrote: > On Wed, Jun 24, 2020 at 12:26:47PM +0100, Will Deacon wrote: > > On Wed, Jun 24, 2020 at 12:46:32PM +0200, Ard Biesheuvel wrote: > > > On Wed, 24 Jun 2020 at 12:44, Will Deacon wrote: > > > > For the kernel Image, how do we remove these sections? The objcopy flags > > > > in arch/arm64/boot/Makefile look both insufficient and out of date. My > > > > vmlinux ends up with both a ".notes" and a ".init.note.gnu.property" > > > > segment. > > > > > > The latter is the fault of the libstub make rules, that prepend .init > > > to all section names. > > > > Hmm. I tried adding -mbranch-protection=none to arm64 cflags for the stub, > > but I still see this note in vmlinux. It looks like it comes in via the > > stub copy of lib-ctype.o, but I don't know why that would force the > > note. The cflags look ok to me [1] and I confirmed that the note is > > being generated by the compiler. > > > > > I'm not sure if there is a point to having PAC and/or BTI in the EFI > > > stub, given that it runs under the control of the firmware, with its > > > memory mappings and PAC configuration etc. > > > > Agreed, I just can't figure out how to get rid of the note. > > Because this section is generated by the linker itself I think you might > have to send it to /DISCARD/ in the link, or strip it explicitly after > linking. Right, but why is the linker generating that section in the first place? I'm compiling with -mbranch-protection=none and all the other objects linked into the stub do not have the section. I wonder if it's because lib/ctype.c doesn't have any executable code... Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel