Received: by 10.192.165.156 with SMTP id m28csp293455imm; Tue, 17 Apr 2018 10:12:37 -0700 (PDT) X-Google-Smtp-Source: AIpwx49hrAppNOySuytNUZRBCcxFAaPk05ffkVUa+jnCHklnA+kGIih5RBBdQGcR+m7slid2I0DI X-Received: by 2002:a17:902:57d8:: with SMTP id g24-v6mr2517546plj.337.1523985157164; Tue, 17 Apr 2018 10:12:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523985157; cv=none; d=google.com; s=arc-20160816; b=jV1HsPOlBzJulQenW0t9TOvLsPmkaAcLjKG4Sw2t1cOfs44mHVe7eER9aNldP1rGcI PQ+Nt8NIzfNfPVryMPP6pk8p44IWfp0abT+Y4EOrcE8BRvtAna77dwTVYN3Vv/4WZbQ0 pCjDSII2FNFqW0bgqsKOdzM4Ddb+RyoDCBZ0Nw37/9ZKqo2yITLw7ryXdjZxqyAfMF9W zX2vBH8cbLhapy5DqfGvCNA9bv8HzkQxmMFNHp0WdrEQvEwe/TRW9/U72jC9+k3XL3YM bno2upVwvTko8mBdHJNJ/jQY+WDduteBVMZyRCdHxjqMWbOBi2aAGlub0aZ9UBqIZqWj yU6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:references:in-reply-to:mime-version :dkim-signature:arc-authentication-results; bh=q1Gf2iy1FKNcB4ZSZGUjFRgu4If1wQgQ8j8jVfLA7k0=; b=UHOt1u/SbuWYdHqrC8H0NaZ8YxRj5GUXfQmi5ziTkZgRvJ9YpuG9leOpARNkbxs/rk HqcoPZHoyIhGQ24QNb4mEJMXO0QotxbwXuZ+7Gi1O8NzC4TD8b4uBTFgNNbSb3fZo6oD vqMLpSuSopKkJbt8wxRm8GYpPB7f0ecKWBMHdOkNLXRtzuD68KAOn9v61GxZXU/68Vd4 UJp52lwcdmpx7PaYk6I2JFiv3ijIkyLcliFv2bULmnG2WHHdZs9puQooDT1ZkqRSkoN0 57zCuoDHJDt9vOuLTkRDcipKVjQ9xOW+15iADKGp4xVisrFMtA/msKzLFTwMdMItC2NN 7acA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=G42q3Rz8; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y72si13204471pfi.46.2018.04.17.10.12.23; Tue, 17 Apr 2018 10:12:37 -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; dkim=fail header.i=@gmail.com header.s=20161025 header.b=G42q3Rz8; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753262AbeDQRLL (ORCPT + 99 others); Tue, 17 Apr 2018 13:11:11 -0400 Received: from mail-ot0-f196.google.com ([74.125.82.196]:36292 "EHLO mail-ot0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753315AbeDQRLI (ORCPT ); Tue, 17 Apr 2018 13:11:08 -0400 Received: by mail-ot0-f196.google.com with SMTP id p2-v6so5379118otf.3 for ; Tue, 17 Apr 2018 10:11:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-transfer-encoding; bh=q1Gf2iy1FKNcB4ZSZGUjFRgu4If1wQgQ8j8jVfLA7k0=; b=G42q3Rz8NO5hyrqsSfTtp+9NHWROWMO2vT1lZ5U3/fvMG591zD66513durktjyYy7A tJ8wRtiIKzoiOUC3Ak2kRwI2atcCx2++T1NoVriacj1fkWMFj6C9kv6X3buBoOUmVCj/ WWgBX/5mYsloy8UDiZTMoha+kddwqseIavCtTM0cRrfGWPcDKgU8Z20s5tXsjN5mIMX0 huirg9Rk/Do/efEJn83UmUYhBiE932n45I9DvzckkqTyrg23mqd3R0MBAmLGznVKpkWN hBN2EK0Eqj4s07Z5/R+5AGcxNn49VevuePhpCCZPZk9BiIzs4IPYSJf6e0q8jmrQajhZ n4jQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-transfer-encoding; bh=q1Gf2iy1FKNcB4ZSZGUjFRgu4If1wQgQ8j8jVfLA7k0=; b=k9z91tYYL15ee52FAp0qS5QAJYSoIMDQsPuQ49H+lZSQnspPEAg+fU231I2MQFl2XC acoL+TxyJgg3ztnpi3MLQRNXniQ3hYjYM41LK5pVRd2QZnWODj8df2fVI2h4ouY2ZgUT FzEPvm8yGggcD3wzRF+X+0qUMiw0b5T2+UowaQiJ8AL0MVxEWhbmalmAlGpYr3uZ4ynv sU4kbpv9J98i/F5PIJSCMtdIZS+zBDNiZeWB6sUclOpWTjwJribI/gXEun2qsbChU4H4 7qMWIZrGBuAfRzZAXPbQ+DQ+hRWKTuFcEZ0sOLOBAO7WRJ8VNGXcB8TA2UDOFsH/77ZX P2cA== X-Gm-Message-State: ALQs6tAm4RFboSgbXdXxBTBUGuzBMxJQmzqO4TLqU52oF249VzL/MXdq HvqIO6pBOfpdWljUumf9LeycKUlaIcqjtHooPjc= X-Received: by 2002:a9d:2d0:: with SMTP id 74-v6mr1659908otl.39.1523985067347; Tue, 17 Apr 2018 10:11:07 -0700 (PDT) MIME-Version: 1.0 Received: by 10.138.3.76 with HTTP; Tue, 17 Apr 2018 10:10:46 -0700 (PDT) In-Reply-To: References: <20180417104909.22D416C07D@po15720vm.idsi0.si.c-s.fr> From: Mathieu Malaterre Date: Tue, 17 Apr 2018 19:10:46 +0200 X-Google-Sender-Auth: 1J8fIKkVVYqquUz15DeA2EBX8GA Message-ID: Subject: Re: [PATCH] powerpc: Allow selection of CONFIG_LD_DEAD_CODE_DATA_ELIMINATION To: Christophe LEROY Cc: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , linuxppc-dev , LKML Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 17, 2018 at 6:49 PM, Christophe LEROY wrote: > > > Le 17/04/2018 =C3=A0 18:45, Mathieu Malaterre a =C3=A9crit : >> >> On Tue, Apr 17, 2018 at 12:49 PM, Christophe Leroy >> 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 >>> --- >>> 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: > > > Which version of GCC do you use ? $ powerpc-linux-gnu-gcc --version powerpc-linux-gnu-gcc (Debian 6.3.0-18) 6.3.0 20170516 Copyright (C) 2016 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. this is simply coming from: $ apt-cache policy crossbuild-essential-powerpc crossbuild-essential-powerpc: Installed: 12.3 Candidate: 12.3 Version table: *** 12.3 500 500 http://ftp.fr.debian.org/debian stretch/main amd64 Packages 500 http://ftp.fr.debian.org/debian stretch/main i386 Packages 100 /var/lib/dpkg/status > Can you provide the generated System.map with and without that option act= ive > ? $ du -sh g4/System.map.* 1.7M g4/System.map.with 1.8M g4/System.map.without Will send them by private emails. > Thanks > Christophe > > >> >> --- >> 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 >>> >