diff mbox

[6/6] kconfig option for TRIM_UNUSED_EXPSYMS

Message ID 1454963315-20468-7-git-send-email-nicolas.pitre@linaro.org (mailing list archive)
State New, archived
Headers show

Commit Message

Nicolas Pitre Feb. 8, 2016, 8:28 p.m. UTC
The config option to enable it all.

Signed-off-by: Nicolas Pitre <nico@linaro.org>
---
 init/Kconfig | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

Comments

Rusty Russell Feb. 9, 2016, 2:34 a.m. UTC | #1
Nicolas Pitre <nicolas.pitre@linaro.org> writes:
> The config option to enable it all.
>
> Signed-off-by: Nicolas Pitre <nico@linaro.org>

Nice series!  In case you need it, here's my Ack.  Despite the overlap
with modules, it's all build trickery, so best via Sam's tree.

Acked-by: Rusty Russell <rusty@rustcorp.com.au>

Thanks,
Rusty.
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Nicolas Pitre Feb. 9, 2016, 4:30 a.m. UTC | #2
On Tue, 9 Feb 2016, Rusty Russell wrote:

> Nicolas Pitre <nicolas.pitre@linaro.org> writes:
> > The config option to enable it all.
> >
> > Signed-off-by: Nicolas Pitre <nico@linaro.org>
> 
> Nice series!  In case you need it, here's my Ack.  Despite the overlap
> with modules, it's all build trickery, so best via Sam's tree.
> 
> Acked-by: Rusty Russell <rusty@rustcorp.com.au>

Thanks


Nicolas
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Sam Ravnborg Feb. 9, 2016, 11:46 a.m. UTC | #3
> 
> so best via Sam's tree.
That was some years ago ;-)

	Sam
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Christoph Hellwig Feb. 9, 2016, 1:28 p.m. UTC | #4
On Mon, Feb 08, 2016 at 03:28:35PM -0500, Nicolas Pitre wrote:
> The config option to enable it all.

Just enable it by default..
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Austin S. Hemmelgarn Feb. 9, 2016, 1:37 p.m. UTC | #5
On 2016-02-09 08:28, Christoph Hellwig wrote:
> On Mon, Feb 08, 2016 at 03:28:35PM -0500, Nicolas Pitre wrote:
>> The config option to enable it all.
>
> Just enable it by default..
>
I doubt we care too much about third party modules, but enabling this by 
default will likely cause at least some of them to stop working.  At the 
very least, we need the config option, even if it's enabled by default.
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Nicolas Pitre Feb. 9, 2016, 5:04 p.m. UTC | #6
On Tue, 9 Feb 2016, Christoph Hellwig wrote:

> On Mon, Feb 08, 2016 at 03:28:35PM -0500, Nicolas Pitre wrote:
> > The config option to enable it all.
> 
> Just enable it by default..

:-)

Viro took the opposite view with this patch:

http://lkml.org/lkml/2016/2/3/1068

where he's ensuring that no exports are dropped, even if obviously 
they're not used (otherwise some complaints would have come about).  So 
I'm not sure if having this turned on by default is a good thing.

But I don't mind being convinced otherwise.


Nicolas
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Rusty Russell Feb. 9, 2016, 11:30 p.m. UTC | #7
Nicolas Pitre <nicolas.pitre@linaro.org> writes:
> On Tue, 9 Feb 2016, Christoph Hellwig wrote:
>
>> On Mon, Feb 08, 2016 at 03:28:35PM -0500, Nicolas Pitre wrote:
>> > The config option to enable it all.
>> 
>> Just enable it by default..
>
> :-)
>
> Viro took the opposite view with this patch:
>
> http://lkml.org/lkml/2016/2/3/1068
>
> where he's ensuring that no exports are dropped, even if obviously 
> they're not used (otherwise some complaints would have come about).  So 
> I'm not sure if having this turned on by default is a good thing.
>
> But I don't mind being convinced otherwise.

People do build out-of-tree modules.  Dropping support for that would
simplify our lives, but seems fairly controversial :)

Cheers,
Rusty.
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/init/Kconfig b/init/Kconfig
index 22320804fb..893c4979a9 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -1990,6 +1990,22 @@  config MODULE_COMPRESS_XZ
 
 endchoice
 
+config TRIM_UNUSED_EXPSYMS
+	bool "Trim unused exported 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