LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Mathieu Malaterre <malat@debian.org>
To: Christophe Leroy <christophe.leroy@c-s.fr>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Paul Mackerras <paulus@samba.org>,
	Michael Ellerman <mpe@ellerman.id.au>,
	linuxppc-dev <linuxppc-dev@lists.ozlabs.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] powerpc: Allow selection of CONFIG_LD_DEAD_CODE_DATA_ELIMINATION
Date: Tue, 17 Apr 2018 18:45:27 +0200	[thread overview]
Message-ID: <CA+7wUszKbPKu86jSprEBJsxJOmyAc42x5S4XmPce_RFXTsHTfQ@mail.gmail.com> (raw)
In-Reply-To: <20180417104909.22D416C07D@po15720vm.idsi0.si.c-s.fr>

On Tue, Apr 17, 2018 at 12:49 PM, Christophe Leroy
<christophe.leroy@c-s.fr> wrote:
> This option does dead code and data elimination with the linker by
> compiling with -ffunction-sections -fdata-sections and linking with
> --gc-sections.
>
> By selecting this option on mpc885_ads_defconfig,
> vmlinux LOAD segment size gets reduced by 10%
>
> Program Header before the patch:
>     LOAD off    0x00010000 vaddr 0xc0000000 paddr 0x00000000 align 2**16
>          filesz 0x0036eda4 memsz 0x0038de04 flags rwx
>
> Program Header after the patch:
>     LOAD off    0x00010000 vaddr 0xc0000000 paddr 0x00000000 align 2**16
>          filesz 0x00316da4 memsz 0x00334268 flags rwx
>
> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
> ---
>  arch/powerpc/Kconfig | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
> index 8fe4353be5e3..e1fac49cf465 100644
> --- a/arch/powerpc/Kconfig
> +++ b/arch/powerpc/Kconfig
> @@ -888,6 +888,14 @@ config PPC_MEM_KEYS
>
>           If unsure, say y.
>
> +config PPC_UNUSED_ELIMINATION
> +       bool "Eliminate unused functions and data from vmlinux"
> +       default n
> +       select LD_DEAD_CODE_DATA_ELIMINATION
> +       help
> +         Select this to do dead code and data elimination with the linker
> +         by compiling with -ffunction-sections -fdata-sections and linking
> +         with --gc-sections.
>  endmenu
>

Just for reference, I cannot boot my Mac Mini G4 anymore (yaboot). The
messages I can see (prom_init) are:

---
done
copying OF device tree...
Building dt strings...
Building dt structure...
Device tree strings 0x01100000 -> 0x01100e02
Device tree struct   0x01101000 -> 0x01109000
Quiescing Open Firmware ...
Booting Linux via __start() @ 0x00140000 ...
_
---



>  config ISA_DMA_API
> --
> 2.13.3
>

  reply	other threads:[~2018-04-17 16:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-17 10:49 [PATCH] powerpc: Allow selection of CONFIG_LD_DEAD_CODE_DATA_ELIMINATION Christophe Leroy
2018-04-17 16:45 ` Mathieu Malaterre [this message]
2018-04-17 16:49   ` Christophe LEROY
2018-04-17 17:10     ` Mathieu Malaterre
2018-04-18  6:34       ` Christophe LEROY
2018-04-18  8:36         ` Mathieu Malaterre
2018-04-18 13:11           ` Christophe LEROY
2018-04-19  5:10             ` Nicholas Piggin
2018-04-18 15:13           ` Michael Ellerman
2018-04-24 18:48             ` Mathieu Malaterre

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CA+7wUszKbPKu86jSprEBJsxJOmyAc42x5S4XmPce_RFXTsHTfQ@mail.gmail.com \
    --to=malat@debian.org \
    --cc=benh@kernel.crashing.org \
    --cc=christophe.leroy@c-s.fr \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox