From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Tyser Date: Wed, 03 Nov 2010 15:38:25 -0500 Subject: [U-Boot] patch for gc-sections In-Reply-To: <1288811250.1820.96.camel@haiying-laptop> References: <1288811250.1820.96.camel@haiying-laptop> Message-ID: <1288816705.8967.1571.camel@petert> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Wed, 2010-11-03 at 15:07 -0400, Haiying Wang wrote: > Peter, > > Do you have any idea on why your commit: > " > commit fbe53f59bd40b3b1ab66dc98859e26589d64d1b7 > Author: Peter Tyser > Date: Wed Sep 29 14:05:56 2010 -0500 > > 85xx: Use gc-sections to reduce image size I'd guess none of the functions in the SPL binary are referenced in the linker script or linker command line, so the linker thinks none of them are necessary and removes them. Can you try the following patch: diff --git a/arch/powerpc/cpu/mpc85xx/u-boot-nand_spl.lds b/arch/powerpc/cpu/mpc85xx/u-boot-nand_spl.lds index 7d9cee9..53d33ee 100644 --- a/arch/powerpc/cpu/mpc85xx/u-boot-nand_spl.lds +++ b/arch/powerpc/cpu/mpc85xx/u-boot-nand_spl.lds @@ -54,7 +54,7 @@ SECTIONS __init_end = .; .resetvec ADDR(.text) + 0xffc : { - *(.resetvec) + KEEP(*(.resetvec)) } = 0xffff __bss_start = .; I did a quick compile test, and it seemed to work, as well as stripped out a few unused functions. Best, Peter