From patchwork Mon Mar 14 02:42:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Pitre X-Patchwork-Id: 8575311 Return-Path: X-Original-To: patchwork-linux-kbuild@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5F4C0C0554 for ; Mon, 14 Mar 2016 02:44:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 89D8320452 for ; Mon, 14 Mar 2016 02:44:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8B37B2045E for ; Mon, 14 Mar 2016 02:44:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754500AbcCNCoE (ORCPT ); Sun, 13 Mar 2016 22:44:04 -0400 Received: from alt13.smtp-out.videotron.ca ([135.19.0.26]:48439 "EHLO alt12.smtp-out.videotron.ca" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754526AbcCNCnE (ORCPT ); Sun, 13 Mar 2016 22:43:04 -0400 Received: from yoda.home ([96.23.157.65]) by Videotron with SMTP id fITGaidFifvQhfITHa11XJ; Sun, 13 Mar 2016 22:43:03 -0400 X-Authority-Analysis: v=2.1 cv=A8XMR/iG c=1 sm=1 tr=0 a=keA3yYpnlypCNW5BNWqu+w==:117 a=keA3yYpnlypCNW5BNWqu+w==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=7OsogOcEt9IA:10 a=KKAkSRfTAAAA:8 a=Tty9oNO6AAAA:8 a=qpnXI1VyeLZMcYZUtIsA:9 Received: from xanadu.home (xanadu.home [192.168.2.2]) by yoda.home (Postfix) with ESMTP id 9CA9B2DA064B; Sun, 13 Mar 2016 22:43:01 -0400 (EDT) From: Nicolas Pitre To: Michal Marek Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v6 8/8] kconfig option for TRIM_UNUSED_KSYMS Date: Sun, 13 Mar 2016 22:42:16 -0400 Message-Id: <1457923336-2732-9-git-send-email-nicolas.pitre@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1457923336-2732-1-git-send-email-nicolas.pitre@linaro.org> References: <1457923336-2732-1-git-send-email-nicolas.pitre@linaro.org> X-CMAE-Envelope: MS4wfCNojANkGpz7SohISY1dwmaQGQb+DpA92tM7dSPSDXgUeybDHFdJDwauM2I4y531eng0dpF3RtwLJBvcemn3XMq0v+bx3afbU+FXyWJc2/oEW3oAm+mH EhowRBntg9rV+E0BY5qYvdBtgTQYpZJDKsHaPADJAZ3r1F3Rp7TxwDU8xi/q5TVvESMIpTtHdDpV3E3Eo9xqfmaVPPyMquI+b1QN2Nmtr7ia980GpSgeGkUo 868+Akyp6nqvd7VuAgQLKA== Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The config option to enable it all. Signed-off-by: Nicolas Pitre Acked-by: Rusty Russell --- init/Kconfig | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/init/Kconfig b/init/Kconfig index 22320804fb..e6f666331b 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -1990,6 +1990,22 @@ config MODULE_COMPRESS_XZ endchoice +config TRIM_UNUSED_KSYMS + bool "Trim unused exported kernel symbols" + depends on MODULES && !UNUSED_SYMBOLS + help + The kernel and some modules make many symbols available for + other modules to use via EXPORT_SYMBOL() and variants. Depending + on the set of modules being selected in your kernel configuration, + many of those exported symbols might never be used. + + This option allows for unused exported symbols to be dropped from + the build. In turn, this provides the compiler more opportunities + (especially when using LTO) for optimizing the code and reducing + binary size. This might have some security advantages as well. + + If unsure say N. + endif # MODULES config MODULES_TREE_LOOKUP