From patchwork Tue Mar 29 20:44:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Pitre X-Patchwork-Id: 64628 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp2236181lbc; Tue, 29 Mar 2016 13:47:49 -0700 (PDT) X-Received: by 10.98.43.7 with SMTP id r7mr1903225pfr.24.1459284469469; Tue, 29 Mar 2016 13:47:49 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g78si744481pfd.130.2016.03.29.13.47.49; Tue, 29 Mar 2016 13:47:49 -0700 (PDT) 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; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932600AbcC2Urq (ORCPT + 29 others); Tue, 29 Mar 2016 16:47:46 -0400 Received: from alt32.smtp-out.videotron.ca ([24.53.0.21]:15270 "EHLO alt32.smtp-out.videotron.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754352AbcC2UpL (ORCPT ); Tue, 29 Mar 2016 16:45:11 -0400 Received: from yoda.home ([96.23.157.65]) by Videotron with SMTP id l0VhaiGssHvYOl0ViaPxkK; Tue, 29 Mar 2016 16:45:10 -0400 X-Authority-Analysis: v=2.1 cv=c6sLOUJl 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 9F9952DA05EC; Tue, 29 Mar 2016 16:45:08 -0400 (EDT) From: Nicolas Pitre To: Michal Marek Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v7 8/8] kconfig option for TRIM_UNUSED_KSYMS Date: Tue, 29 Mar 2016 16:44:42 -0400 Message-Id: <1459284282-6676-9-git-send-email-nicolas.pitre@linaro.org> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1459284282-6676-1-git-send-email-nicolas.pitre@linaro.org> References: <1459284282-6676-1-git-send-email-nicolas.pitre@linaro.org> X-CMAE-Envelope: MS4wfOJ0QmFNhVJBBF04sM8t5exCcgxOwNt8VcEDgMSfeQWUuFSORxFn6y5bYATsaCaMs75hNIcapimtvXPLUt/w7ZndayPaiCQb7BkKwWCUWkw9YrEyCU7+ uz32UYa1uQoCSekp3lS3Ffdpywg6JbKryPcthrnxYiO/m1rXWyPX+yjNL6EGtilaD7aCkRqt/1Z4DA+9zDUI2tfP13pNfCnrH5n3X2y8aUSxI7HviAnJSd2D ck+citmtTsbJziJcRqhFGQ== 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.5 diff --git a/init/Kconfig b/init/Kconfig index e0d2616243..29d74d3f80 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -2012,6 +2012,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