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=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,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 05E27C433E0 for ; Thu, 25 Feb 2021 20:18:12 +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 A99B664F17 for ; Thu, 25 Feb 2021 20:18:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A99B664F17 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.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=ikTSL5Wfzh319Km/zB+tTsbuDPl6iSr9Hp10NeqEa/Q=; b=stXC+SrTUrPHx7Df+RCdA9Rsd oNp7QDQVp1nB4TgqSMrSWS1VANdP9oK+1yZeV5wPYQaT6A/BKdeGsFXzR6yp805w+Btbjad7maO0C UDaN1Dr3qIFarnSkVLQOpiSFUOARfjlNcxBQzeZwU/bPpacHGgkMc3j0KjXjRdkJk/hOjPZ+i/VCG ZLRWTnnJO54fng1gUXuY52NSDqtlSBCPWt91bSWBi/Kybn192yaTI3ZttOJ8o6ENw8TQ3VDwcTXgq LdJ2g6v4LhArhhEfHIu4LJChNdvrM6nAKBEd0HNIoA8HDiVWzp8p9Pr8AQHnCR3vmXfgAbT6Q6pX6 gA3IQDDpQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lFN43-00076g-LV; Thu, 25 Feb 2021 20:16:47 +0000 Received: from mail-pg1-x531.google.com ([2607:f8b0:4864:20::531]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1lFN40-000769-8d for linux-arm-kernel@lists.infradead.org; Thu, 25 Feb 2021 20:16:45 +0000 Received: by mail-pg1-x531.google.com with SMTP id p21so4542461pgl.12 for ; Thu, 25 Feb 2021 12:16:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=mr0qfRB0Ik/agsf3L0HG3xZ8g9VBKc2G+9roJzfPeiY=; b=euraqYIpl64XJWU+m2Fw7Fyq+kDa7eJRiurKUHe2oMGf4JZeSakNYjP5Zg9jvV2Y7i dJiYfNpaLC8ukwM3GczFJRylLgC4twIIVyuMxLgJYzja/cJ+/0R5UQPG7WddojrljFxZ EmncsucyA2xWo3DbkTZiRg0sSr53Zfo49Yiwk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=mr0qfRB0Ik/agsf3L0HG3xZ8g9VBKc2G+9roJzfPeiY=; b=Y9e2NlqM+kDTCAFZFcQjwkw4QpuMMbM1wcSl352Az3LsRLig+QR8MTJr/VeVNuRvzv n8mVq9XQjurJfaWakoIy60K+Ocr+LJOxgCgX3MdBMGlHh3eyijpuASOntCDayxN/M7B6 rHbsv7VCCvbCpeve2G/aKqrgwLGI7tjiZf/90z/dxKMTq+1R2ly2xMhO7Z/SLmvAr1A4 vtkN6hl29hTfDucTVQCiZFlmLMtKfbCJqWq2btiHYPqPtBxTdVao3874IB8cueGCsnc1 e/09h9O91jiIxaMvTZBMcChm/3yVr6HZvGccWYB3aGALTdxDURK1Ugtx8V3cvV9PI3HL CRTA== X-Gm-Message-State: AOAM530g9QlBDTCYwYoitGzhWauq+YCigZKM2kDXS+gX9xO/WD//rM6s h3ub10vAh6AjiBnurkscFeFCpg== X-Google-Smtp-Source: ABdhPJzu0QIjDXTR7OQR9Z1qCNxRIOUORSgg7eUBcP4OkAwlJhANLNn18mAIXKIhEeF1cPgAQ3sF1w== X-Received: by 2002:a62:187:0:b029:1da:e323:a96b with SMTP id 129-20020a6201870000b02901dae323a96bmr5028766pfb.28.1614284201699; Thu, 25 Feb 2021 12:16:41 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id h3sm6888983pgm.67.2021.02.25.12.16.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Feb 2021 12:16:41 -0800 (PST) Date: Thu, 25 Feb 2021 12:16:40 -0800 From: Kees Cook To: Arnd Bergmann Subject: Re: [PATCH] [RFC] arm64: enable HAVE_LD_DEAD_CODE_DATA_ELIMINATION Message-ID: <202102251216.935EFD7F@keescook> References: <20210225112122.2198845-1-arnd@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210225112122.2198845-1-arnd@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210225_151644_338116_5E07E631 X-CRM114-Status: GOOD ( 19.89 ) 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 , Ionela Voinescu , Geert Uytterhoeven , Arnd Bergmann , Catalin Marinas , Nick Desaulniers , linux-kernel@vger.kernel.org, Kristina Martsenko , Ard Biesheuvel , Nathan Chancellor , clang-built-linux@googlegroups.com, Mark Brown , Andrew Scull , Marc Zyngier , Vincenzo Frascino , Will Deacon , David Brazdil , linux-arm-kernel@lists.infradead.org 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 Thu, Feb 25, 2021 at 12:20:56PM +0100, Arnd Bergmann wrote: > From: Arnd Bergmann > > When looking at kernel size optimizations, I found that arm64 > does not currently support HAVE_LD_DEAD_CODE_DATA_ELIMINATION, > which enables the --gc-sections flag to the linker. > > I see that for a defconfig build with llvm, there are some > notable improvements from enabling this, in particular when > combined with the recently added CONFIG_LTO_CLANG_THIN > and CONFIG_TRIM_UNUSED_KSYMS: > > text data bss dec hex filename > 16570322 10998617 506468 28075407 1ac658f defconfig/vmlinux > 16318793 10569913 506468 27395174 1a20466 trim_defconfig/vmlinux > 16281234 10984848 504291 27770373 1a7be05 gc_defconfig/vmlinux > 16029705 10556880 504355 27090940 19d5ffc gc+trim_defconfig/vmlinux > 17040142 11102945 504196 28647283 1b51f73 thinlto_defconfig/vmlinux > 16788613 10663201 504196 27956010 1aa932a thinlto+trim_defconfig/vmlinux > 16347062 11043384 502499 27892945 1a99cd1 gc+thinlto_defconfig/vmlinux > 15759453 10532792 502395 26794640 198da90 gc+thinlto+trim_defconfig/vmlinux > > I needed a small change to the linker script to get clean randconfig > builds, but I have not done any meaningful boot testing on it to > see if it works. If there are no regressions, I wonder whether this > should be autmatically done for LTO builds, given that it improves > both kernel size and compile speed. > > Link: https://lore.kernel.org/lkml/CAK8P3a05VZ9hSKRzVTxTn+1nf9E+gqebJWTj6N23nfm+ELHt9A@mail.gmail.com/ > Signed-off-by: Arnd Bergmann Reviewed-by: Kees Cook -- Kees Cook _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel