From patchwork Fri Mar 4 05:40:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Pitre X-Patchwork-Id: 63508 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp284823lbc; Thu, 3 Mar 2016 21:56:46 -0800 (PST) X-Received: by 10.66.187.36 with SMTP id fp4mr9385676pac.47.1457071002954; Thu, 03 Mar 2016 21:56:42 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y66si3402335pfi.193.2016.03.03.21.56.42; Thu, 03 Mar 2016 21:56:42 -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 S1758395AbcCDF4g (ORCPT + 30 others); Fri, 4 Mar 2016 00:56:36 -0500 Received: from alt32.smtp-out.videotron.ca ([24.53.0.21]:18428 "EHLO alt32.smtp-out.videotron.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751481AbcCDFz6 (ORCPT ); Fri, 4 Mar 2016 00:55:58 -0500 X-Greylist: delayed 900 seconds by postgrey-1.27 at vger.kernel.org; Fri, 04 Mar 2016 00:55:57 EST Received: from yoda.home ([96.23.157.65]) by Videotron with SMTP id biTvahkb8HvYObiTwaObon; Fri, 04 Mar 2016 00:40:57 -0500 X-Authority-Analysis: v=2.1 cv=ePuz9Cd1 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 053C22DA064B; Fri, 4 Mar 2016 00:40:55 -0500 (EST) From: Nicolas Pitre To: Michal Marek Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v5 8/8] kconfig option for TRIM_UNUSED_KSYMS Date: Fri, 4 Mar 2016 00:40:50 -0500 Message-Id: <1457070050-1564-9-git-send-email-nicolas.pitre@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1457070050-1564-1-git-send-email-nicolas.pitre@linaro.org> References: <1457070050-1564-1-git-send-email-nicolas.pitre@linaro.org> X-CMAE-Envelope: MS4wfEMikUT+FYchGIwPJfeLjX09cF5oGSeba6mnWZY5BWHF4LnqUbEjMAZp+vu2ACyZ7Z+TUuRcuYKFeAMedA3/hXnvMfUwq6kYosxl5t6K8bY3eVR/I+7r 2XveLjz0N0pZ8vCz53P7QtEK0ToYGJ8SVXAsvXr8peDZLWADR6eoxhOO7Zpk0Q33VSb2oboq5vmC6/8KNV2BGOypw9paYzPpbR86GGmSSk7WOgElxdS4qaKb uwHUyhYQGTKDv4WYXxXIeQ== 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