Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751927AbdGLRlB (ORCPT ); Wed, 12 Jul 2017 13:41:01 -0400 Received: from pb-smtp1.pobox.com ([64.147.108.70]:53863 "EHLO sasl.smtp.pobox.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750869AbdGLRk7 (ORCPT ); Wed, 12 Jul 2017 13:40:59 -0400 X-Greylist: delayed 363 seconds by postgrey-1.27 at vger.kernel.org; Wed, 12 Jul 2017 13:40:59 EDT Date: Wed, 12 Jul 2017 13:34:46 -0400 (EDT) From: Nicolas Pitre To: Andi Kleen cc: npiggin@gmail.com, linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org Subject: Re: [RFC PATCH] x86: enable dead code and data elimination (LTO) In-Reply-To: <87a849aaa3.fsf@firstfloor.org> Message-ID: References: <20170709031333.29443-1-npiggin@gmail.com> <20170709090551.bm2c55ctt3togim7@gmail.com> <20170710121329.77dd3364@roar.ozlabs.ibm.com> <87a849aaa3.fsf@firstfloor.org> User-Agent: Alpine 2.20 (LFD 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Pobox-Relay-ID: 66A3C094-6728-11E7-996E-EFB41968708C-78420484!pb-smtp1.pobox.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 914 Lines: 26 On Wed, 12 Jul 2017, Andi Kleen wrote: > Nicholas Piggin writes: > >> > >> I think we should aim for gc-sections to be used by default and have LTO > >> as a possible option only. > > > > I agree after it starts getting implemented and debugged by small > > system users, we could make it default in the interest of sharing > > testing and reducing combinations. > > From what i understand the main drawback in the past was > is that various linker versions become very slow with thousands of > sections. > > So it may cost you built time. For a special small build it's probably > ok, but you wouldn't want to make it default. > > Also usually it's only useful without modules because if you > use modules EXPORT_SYMBOL pulls in a lot of unused functions. I created CONFIG_TRIM_UNUSED_KSYMS mainly to avoid that issue. It is highly effective with either gc-sections and LTO. Nicolas