From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg0-f67.google.com ([74.125.83.67]:34144 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750898AbeEBMYp (ORCPT ); Wed, 2 May 2018 08:24:45 -0400 Date: Wed, 2 May 2018 22:24:30 +1000 From: Nicholas Piggin Subject: Re: [PATCH 4/4] powerpc: Allow LD_DEAD_CODE_DATA_ELIMINATION to be selected Message-ID: <20180502222430.2a1cced4@roar.ozlabs.ibm.com> In-Reply-To: References: <20180420073414.23169-1-npiggin@gmail.com> <20180420073414.23169-5-npiggin@gmail.com> <20180420204104.6e22b136@roar.ozlabs.ibm.com> <20180421124838.5facd0f7@roar.ozlabs.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kbuild-owner@vger.kernel.org List-ID: To: Mathieu Malaterre Cc: linuxppc-dev , linux-arch@vger.kernel.org, Nicolas Pitre , linux-kbuild@vger.kernel.org On Wed, 2 May 2018 11:17:52 +0200 Mathieu Malaterre wrote: > Nick, > > On Sat, Apr 21, 2018 at 4:48 AM, Nicholas Piggin wrote: > > On Fri, 20 Apr 2018 22:08:27 +0200 > > Mathieu Malaterre wrote: > > > >> On Fri, Apr 20, 2018 at 12:41 PM, Nicholas Piggin wrote: > >> > On Fri, 20 Apr 2018 12:00:49 +0200 > >> > Mathieu Malaterre wrote: > >> > > >> >> On Fri, Apr 20, 2018 at 9:34 AM, Nicholas Piggin wrote: > >> >> > This requires further changes to linker script to KEEP some tables > >> >> > and wildcard compiler generated sections into the right place. This > >> >> > includes pp32 modifications from Christophe Leroy. > >> >> > > >> >> > When compiling powernv_defconfig with this option: > >> >> > > >> >> > text data bss dec filename > >> >> > 11827621 4810490 1341080 17979191 vmlinux > >> >> > 11752437 4598858 1338776 17690071 vmlinux.dcde > >> >> > > >> >> > Resulting kernel is almost 400kB smaller (and still boots). > >> >> > > >> >> > [ppc32 numbers here] > >> >> > >> >> ^^^ > >> >> > >> >> Do you want somebody else to provide those numbers ? > >> > > >> > If you have a booting kernel, yes some more numbers would be good. > >> > >> I've used /boot/config-4.15.0-2-powerpc from my current debian > >> package. Rebuild master with and without option, boot ok, load/unload > >> module ok. > >> > >> $ size nick/vmlinux.with* > >> text data bss dec hex filename > >> 7386425 2364370 1425432 11176227 aa8923 nick/vmlinux.with > >> 7461457 2475122 1428064 11364643 ad6923 nick/vmlinux.without > >> > >> This is not clear why with option the size of kernel is slightly bigger: > >> > >> $ du -sk nick/vmlinux.with* > >> 124488 nick/vmlinux.with > >> 124004 nick/vmlinux.without > > > > Not sure. readelf -S vmlinux may show something. > > > > To really get lots of detail, you can add to the top level Makefile: > > > > LDFLAGS_vmlinux += -M > > Here is what I did: > > $ git diff > diff --git a/Makefile b/Makefile > index 619a85ad716b..1a2e3d142a59 100644 > --- a/Makefile > +++ b/Makefile > @@ -4,6 +4,7 @@ PATCHLEVEL = 17 > SUBLEVEL = 0 > EXTRAVERSION = -rc3 > NAME = Fearless Coyote > +LDFLAGS_vmlinux += -M That'll get overwritten further down. Put it down with another line that starts with LDFLAGS_vmlinux += Thanks, Nick From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicholas Piggin Subject: Re: [PATCH 4/4] powerpc: Allow LD_DEAD_CODE_DATA_ELIMINATION to be selected Date: Wed, 2 May 2018 22:24:30 +1000 Message-ID: <20180502222430.2a1cced4@roar.ozlabs.ibm.com> References: <20180420073414.23169-1-npiggin@gmail.com> <20180420073414.23169-5-npiggin@gmail.com> <20180420204104.6e22b136@roar.ozlabs.ibm.com> <20180421124838.5facd0f7@roar.ozlabs.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linuxppc-dev-bounces+glppe-linuxppc-embedded-2=m.gmane.org@lists.ozlabs.org Sender: "Linuxppc-dev" To: Mathieu Malaterre Cc: linux-arch@vger.kernel.org, linux-kbuild@vger.kernel.org, linuxppc-dev , Nicolas Pitre List-Id: linux-arch.vger.kernel.org On Wed, 2 May 2018 11:17:52 +0200 Mathieu Malaterre wrote: > Nick, > > On Sat, Apr 21, 2018 at 4:48 AM, Nicholas Piggin wrote: > > On Fri, 20 Apr 2018 22:08:27 +0200 > > Mathieu Malaterre wrote: > > > >> On Fri, Apr 20, 2018 at 12:41 PM, Nicholas Piggin wrote: > >> > On Fri, 20 Apr 2018 12:00:49 +0200 > >> > Mathieu Malaterre wrote: > >> > > >> >> On Fri, Apr 20, 2018 at 9:34 AM, Nicholas Piggin wrote: > >> >> > This requires further changes to linker script to KEEP some tables > >> >> > and wildcard compiler generated sections into the right place. This > >> >> > includes pp32 modifications from Christophe Leroy. > >> >> > > >> >> > When compiling powernv_defconfig with this option: > >> >> > > >> >> > text data bss dec filename > >> >> > 11827621 4810490 1341080 17979191 vmlinux > >> >> > 11752437 4598858 1338776 17690071 vmlinux.dcde > >> >> > > >> >> > Resulting kernel is almost 400kB smaller (and still boots). > >> >> > > >> >> > [ppc32 numbers here] > >> >> > >> >> ^^^ > >> >> > >> >> Do you want somebody else to provide those numbers ? > >> > > >> > If you have a booting kernel, yes some more numbers would be good. > >> > >> I've used /boot/config-4.15.0-2-powerpc from my current debian > >> package. Rebuild master with and without option, boot ok, load/unload > >> module ok. > >> > >> $ size nick/vmlinux.with* > >> text data bss dec hex filename > >> 7386425 2364370 1425432 11176227 aa8923 nick/vmlinux.with > >> 7461457 2475122 1428064 11364643 ad6923 nick/vmlinux.without > >> > >> This is not clear why with option the size of kernel is slightly bigger: > >> > >> $ du -sk nick/vmlinux.with* > >> 124488 nick/vmlinux.with > >> 124004 nick/vmlinux.without > > > > Not sure. readelf -S vmlinux may show something. > > > > To really get lots of detail, you can add to the top level Makefile: > > > > LDFLAGS_vmlinux += -M > > Here is what I did: > > $ git diff > diff --git a/Makefile b/Makefile > index 619a85ad716b..1a2e3d142a59 100644 > --- a/Makefile > +++ b/Makefile > @@ -4,6 +4,7 @@ PATCHLEVEL = 17 > SUBLEVEL = 0 > EXTRAVERSION = -rc3 > NAME = Fearless Coyote > +LDFLAGS_vmlinux += -M That'll get overwritten further down. Put it down with another line that starts with LDFLAGS_vmlinux += Thanks, Nick