Received: by 10.192.165.156 with SMTP id m28csp266729imm; Tue, 17 Apr 2018 09:48:33 -0700 (PDT) X-Google-Smtp-Source: AIpwx49oMQmeUDAgXKjgdLZf29PmnwBIBOUNNZfXf/NqBAVlom75sk4ci/05FeyouZ7enJii8/+o X-Received: by 2002:a17:902:227:: with SMTP id 36-v6mr2764582plc.134.1523983713865; Tue, 17 Apr 2018 09:48:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523983713; cv=none; d=google.com; s=arc-20160816; b=LY0iaQnqLvgMVCsTyMwk4DEf5t0biGofs/JKQSPeixDjrTpsA80HeudtvToymhM/G1 eNziza7rHlRCsLdtd+Ci13K8CGo3a+aB2FJSZoLkzcHx74va8SBt5BHhCtlHuzCiELG4 3I0e/D0YVkEBPydeEma1AenNzQofpT2f+nB/pZgUD0M7/jSLX9Zk1rjsTnEqL/U+6dX1 0AWfgDbl1W+qh/efGiBBvfHlhT4gleP+WXWpih7Ak5s7H5iOj0A3EDzvP272vs+Cflt+ MsC7QtAx2PAAGIRucxlPM3143l+OCoIL8HG3Kpkx71StYJPkXYQNp0ok1k8YOb8plijM 2bJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=+HiVcq8FVsmyFEdxXSz7dbRYs8WywX2wZcJ6kpni5Sw=; b=gbTzDgz/MxvaXJQdnrk7xRwz3rxmdwQrZY9z8d7Fmu/S1v7SWQa/EdK3E3ZZ6yZY8O YqwRwpzz1R8VEOYOVMSAoVQ7LjMp1wYo4lF/R9ldAUuC+4+buVMAUb5eT+T6iU+16dqp ZQecYYluV2RCPyI1QUuYlbUq3YDoSC+UBr5cmKzi6W+qCGJPLLTHSl3JTx0Ibfoe4G5P Rmb0njG1nhDlhsLBpCj18kwwQkkPXStledJwL8eDtUGBhuW8gfbeJCpj6G+45tYxG3ww ll059YpJG2U+djuO0MgeGeEVmjg0YgyxthuVNQbE1NkD/KBFAl3/rE2IbVZUaWx19tN7 MpMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=uAWbJCXd; 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 d19si11979777pgn.650.2018.04.17.09.48.19; Tue, 17 Apr 2018 09:48:33 -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=uAWbJCXd; 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 S1754473AbeDQQpv (ORCPT + 99 others); Tue, 17 Apr 2018 12:45:51 -0400 Received: from mail-ot0-f196.google.com ([74.125.82.196]:39986 "EHLO mail-ot0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753318AbeDQQpt (ORCPT ); Tue, 17 Apr 2018 12:45:49 -0400 Received: by mail-ot0-f196.google.com with SMTP id h8-v6so11034452otj.7 for ; Tue, 17 Apr 2018 09:45:48 -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; bh=+HiVcq8FVsmyFEdxXSz7dbRYs8WywX2wZcJ6kpni5Sw=; b=uAWbJCXd4crGlBmg9wGMIiwjheock5k2haAMzrFYbavJAekUe4J6m3G4dF+mqjCA4y BzNf4awpFDpMYgvFcwhX02JT4mu87vHtmsaxblfzMFahbeVflzXtL2JofBc+HEYFIc8R iMdlpI7dV9cdF71IclsBYA7xFvb9sjx8a1tgXHKIJi0dQm3jk97lK7Hbt+C4vhSfMTSg /6+xT2QU9fdKTMWQVBFbEny9MnPzbwAFXpi3x3afVW1depIInc1zPWD50nVucY/1c0w3 aJycnUb8vG9/PusIAInLtVaZG2GGh/OGcxrtCeOXxb57iFKST6vv9lb7r7LBfhzyLy+i HI4g== 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; bh=+HiVcq8FVsmyFEdxXSz7dbRYs8WywX2wZcJ6kpni5Sw=; b=BnzqHf0ymKzjYEHHmfrZ4xv26BbWfzin/9cVj+MZ4W/6VlKKZBtWdRg5D1u78wtRti pGlA5t9wBXWyCeIneMgdOoe8fWFlVN7RNcZfS6+QuPih+BACYhjSAq/V+1DCd/Hm7rv9 PJFwc5WjggwAhVjSxd1smobfn5DUzK+g9hMzKxNbwrNX9aDl1QfltkmDRTEljX6vs5F9 U+/STU791OwmFfO5vU7uv/89CgHDESj/pZ1z0LgaBqBlc/Dopy/lJbC71+/+bV//yUqn I893xefhsnpIUQxajdv+AQzGbnMCbaQNe1oZ8OWg4mADl0IcLRYlUYqK8yGHQBfYpWMz BnEg== X-Gm-Message-State: ALQs6tDgDCPs+ynkcpEdIERy1XsNzCMtEtjDAn4DgTvrww3fIcUZtZK+ /J3VVaETM9FLIcjEfqisxR4r7TZ49iN3UK6j5xk= X-Received: by 2002:a9d:3436:: with SMTP id v51-v6mr1789793otb.322.1523983548154; Tue, 17 Apr 2018 09:45:48 -0700 (PDT) MIME-Version: 1.0 Received: by 10.138.3.76 with HTTP; Tue, 17 Apr 2018 09:45:27 -0700 (PDT) In-Reply-To: <20180417104909.22D416C07D@po15720vm.idsi0.si.c-s.fr> References: <20180417104909.22D416C07D@po15720vm.idsi0.si.c-s.fr> From: Mathieu Malaterre Date: Tue, 17 Apr 2018 18:45:27 +0200 X-Google-Sender-Auth: R-MYTtgZuwIb_-QuZRIbhteEMOo 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" 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 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: --- 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 >