From patchwork Mon Feb 29 03:48:11 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Pitre X-Patchwork-Id: 63166 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp1022283lbc; Sun, 28 Feb 2016 19:48:37 -0800 (PST) X-Received: by 10.98.14.2 with SMTP id w2mr976040pfi.35.1456717716253; Sun, 28 Feb 2016 19:48:36 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c10si1120327pat.170.2016.02.28.19.48.35; Sun, 28 Feb 2016 19:48:36 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756269AbcB2Dsa (ORCPT + 30 others); Sun, 28 Feb 2016 22:48:30 -0500 Received: from relais.videotron.ca ([24.201.245.36]:26877 "EHLO relais.videotron.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755154AbcB2Ds0 (ORCPT ); Sun, 28 Feb 2016 22:48:26 -0500 Content-transfer-encoding: 7BIT Received: from yoda.home ([96.23.157.65]) by VL-VM-MR002.ip.videotron.ca (Oracle Communications Messaging Exchange Server 7u4-22.01 64bit (built Apr 21 2011)) with ESMTP id <0O3A000QSIKLMG90@VL-VM-MR002.ip.videotron.ca>; Sun, 28 Feb 2016 22:48:21 -0500 (EST) Received: from xanadu.home (xanadu.home [192.168.2.2]) by yoda.home (Postfix) with ESMTP id 538342DA01EF; Sun, 28 Feb 2016 22:48:21 -0500 (EST) From: Nicolas Pitre To: Michal Marek Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 8/8] kconfig option for TRIM_UNUSED_KSYMS Date: Sun, 28 Feb 2016 22:48:11 -0500 Message-id: <1456717691-28298-9-git-send-email-nicolas.pitre@linaro.org> X-Mailer: git-send-email 2.5.0 In-reply-to: <1456717691-28298-1-git-send-email-nicolas.pitre@linaro.org> References: <1456717691-28298-1-git-send-email-nicolas.pitre@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The config option to enable it all. Signed-off-by: Nicolas Pitre Acked-by: Rusty Russell --- init/Kconfig | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) -- 2.5.0 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