[U-Boot] patch for gc-sections

Peter Tyser ptyser at xes-inc.com
Wed Nov 3 21:38:25 CET 2010


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 <ptyser at xes-inc.com>
> 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



More information about the U-Boot mailing list