Received: by 10.192.165.156 with SMTP id m28csp269161imm; Tue, 17 Apr 2018 09:51:21 -0700 (PDT) X-Google-Smtp-Source: AIpwx49eSahRrqU5XcVP/YxamOraGMKtCPIZPIbAB5oQnFX/XNTzwLio7kILCy3Vhdo3XJb/pLEq X-Received: by 10.99.104.200 with SMTP id d191mr2320902pgc.7.1523983881402; Tue, 17 Apr 2018 09:51:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523983881; cv=none; d=google.com; s=arc-20160816; b=X07+8aSSqiyWweOJpvqxwY6TVRXMPvYKs5bsBEXkojqJWUX/x4SncloXxNYit8jkM6 3TwIK0fKWAJ6krlIIqacOy9phvv4YBgDu8hc1Ts/bc/4BGKRGa1eJwRC8DemzweNqi09 P0qv5oqWnys6aWOa4jNpB4ZpgHZ+XntZm5H0sNJh1MBsT/rAakl8+Dyq78aNfeCeb/2y VVAKeDy+vJRT2GcB9/8feTkzIgAPHW5LwEbiOQKZSGjSmLBCagjksoc1y7qQUSk9Htz2 BRoLtPC+xg7HZ3RO7eIfeSC8fNgRpxrmwIbSIauEQkMZoA6DGU/ih3CapnUH5asR/f2V lHAQ== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=WJ5GYtIlAemq2cZP6zppw1CpAqQvg9kWhvvEM+OO2qM=; b=qTxLsFCebbid1wffs3U6VDVeC5yv/R2HSv3u70G38GF5esaIzTKCj2hzhQvJbyldVi Ysoz7Z2Bw1BywRzjWMxb0ItoQyCjRmqT3LJ02geQ1wDgmzQcfyVv9/L3V4pK9e2vC3Ff fnYAT7LaIygy4KTr5+3q9EQ2MYWF6SdJg5ECAs5lZVIhp0hmDu4tFCrQ96hVzSpZdGj5 R4ytST0nSalHRtib4LnEDKkkNxnyl2ChmQhLLQstC4fwqp3zxeATU0VfBMb0agdmfi8Q Zg8mHmS0dZskcjuYjyuHac2yHHoIb8/EbEG9xY/U5En8MB4qavAuDS7nDSjBqJZjs1H6 6zrA== ARC-Authentication-Results: i=1; mx.google.com; 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 a63si13392513pfc.131.2018.04.17.09.51.07; Tue, 17 Apr 2018 09:51:21 -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; 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 S1754685AbeDQQtr (ORCPT + 99 others); Tue, 17 Apr 2018 12:49:47 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:63091 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754473AbeDQQtp (ORCPT ); Tue, 17 Apr 2018 12:49:45 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 40QWSH5lYqz9txcN; Tue, 17 Apr 2018 18:49:35 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id C-g5PjdU4UYg; Tue, 17 Apr 2018 18:49:35 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 40QWSH5Cghz9txcH; Tue, 17 Apr 2018 18:49:35 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 9B9548B94C; Tue, 17 Apr 2018 18:49:44 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id 3cFiiveC1UuK; Tue, 17 Apr 2018 18:49:44 +0200 (CEST) Received: from PO15451 (unknown [192.168.232.3]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 3C9388B93C; Tue, 17 Apr 2018 18:49:44 +0200 (CEST) Subject: Re: [PATCH] powerpc: Allow selection of CONFIG_LD_DEAD_CODE_DATA_ELIMINATION To: Mathieu Malaterre Cc: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , linuxppc-dev , LKML References: <20180417104909.22D416C07D@po15720vm.idsi0.si.c-s.fr> From: Christophe LEROY Message-ID: Date: Tue, 17 Apr 2018 18:49:44 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 17/04/2018 à 18:45, Mathieu Malaterre a écrit : > 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 ? Can you provide the generated System.map with and without that option active ? 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 >>