diff mbox

[U-Boot,1/2] powerpc/85xx: Fix lds for nand build

Message ID 1289417556-30633-1-git-send-email-Haiying.Wang@freescale.com
State Accepted
Commit 36ae6a8e70ed05c267d4db7224c4ff45146b808e
Delegated to: Kumar Gala
Headers show

Commit Message

Haiying Wang Nov. 10, 2010, 7:32 p.m. UTC
From: Haiying Wang <Haiying.Wang@freescale.com>

Fix u-boot-nand.lds and u-boot-nand_spl.lds according to:

Author: Peter Tyser <ptyser@xes-inc.com>
Date:   Wed Sep 29 14:05:56 2010 -0500
commit fbe53f59bd40b3b1ab66dc98859e26589d64d1b7
    85xx: Use gc-sections to reduce image size

Signed-off-by: Haiying Wang <Haiying.Wang@freescale.com>
---
 arch/powerpc/cpu/mpc85xx/u-boot-nand.lds     |   49 +++++---------------------
 arch/powerpc/cpu/mpc85xx/u-boot-nand_spl.lds |   12 +++---
 2 files changed, 15 insertions(+), 46 deletions(-)

Comments

Kumar Gala Nov. 11, 2010, 6:45 a.m. UTC | #1
On Nov 10, 2010, at 1:32 PM, <Haiying.Wang@freescale.com> <Haiying.Wang@freescale.com> wrote:

> From: Haiying Wang <Haiying.Wang@freescale.com>
> 
> Fix u-boot-nand.lds and u-boot-nand_spl.lds according to:
> 
> Author: Peter Tyser <ptyser@xes-inc.com>
> Date:   Wed Sep 29 14:05:56 2010 -0500
> commit fbe53f59bd40b3b1ab66dc98859e26589d64d1b7
>    85xx: Use gc-sections to reduce image size
> 
> Signed-off-by: Haiying Wang <Haiying.Wang@freescale.com>
> ---
> arch/powerpc/cpu/mpc85xx/u-boot-nand.lds     |   49 +++++---------------------
> arch/powerpc/cpu/mpc85xx/u-boot-nand_spl.lds |   12 +++---
> 2 files changed, 15 insertions(+), 46 deletions(-)

applied to 85xx

- k
diff mbox

Patch

diff --git a/arch/powerpc/cpu/mpc85xx/u-boot-nand.lds b/arch/powerpc/cpu/mpc85xx/u-boot-nand.lds
index 5fd3e6c..fa2088b 100644
--- a/arch/powerpc/cpu/mpc85xx/u-boot-nand.lds
+++ b/arch/powerpc/cpu/mpc85xx/u-boot-nand.lds
@@ -34,42 +34,16 @@  SECTIONS
   /* Read-only sections, merged into text segment: */
   . = + SIZEOF_HEADERS;
   .interp : { *(.interp) }
-  .hash          : { *(.hash)		}
-  .dynsym        : { *(.dynsym)		}
-  .dynstr        : { *(.dynstr)		}
-  .rel.text      : { *(.rel.text)		}
-  .rela.text     : { *(.rela.text)	}
-  .rel.data      : { *(.rel.data)		}
-  .rela.data     : { *(.rela.data)	}
-  .rel.rodata    : { *(.rel.rodata)	}
-  .rela.rodata   : { *(.rela.rodata)	}
-  .rel.got       : { *(.rel.got)		}
-  .rela.got      : { *(.rela.got)		}
-  .rel.ctors     : { *(.rel.ctors)	}
-  .rela.ctors    : { *(.rela.ctors)	}
-  .rel.dtors     : { *(.rel.dtors)	}
-  .rela.dtors    : { *(.rela.dtors)	}
-  .rel.bss       : { *(.rel.bss)		}
-  .rela.bss      : { *(.rela.bss)		}
-  .rel.plt       : { *(.rel.plt)		}
-  .rela.plt      : { *(.rela.plt)		}
-  .init          : { *(.init)	}
-  .plt : { *(.plt) }
   .text      :
   {
-    *(.text)
-    *(.got1)
+    *(.text*)
    } :text
     _etext = .;
     PROVIDE (etext = .);
     .rodata    :
    {
-    *(.eh_frame)
     *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
   } :text
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
 
   /* Read-write section, merged into data segment: */
   . = (. + 0x00FF) & 0xFFFFFF00;
@@ -77,23 +51,19 @@  SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    *(.got)
+    KEEP(*(.got))
     _GOT2_TABLE_ = .;
-    *(.got2)
+    KEEP(*(.got2))
     _FIXUP_TABLE_ = .;
-    *(.fixup)
+    KEEP(*(.fixup))
   }
   __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
   __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
 
   .data    :
   {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
+    *(.data*)
+    *(.sdata*)
   }
   _edata  =  .;
   PROVIDE (edata = .);
@@ -117,7 +87,7 @@  SECTIONS
 
   .bootpg ADDR(.text) - 0x1000 :
   {
-    arch/powerpc/cpu/mpc85xx/start.o	(.bootpg)
+    arch/powerpc/cpu/mpc85xx/start.o	KEEP(*(.bootpg))
   } :text = 0xffff
 
   . = ADDR(.text) + 0x80000;
@@ -125,9 +95,8 @@  SECTIONS
   __bss_start = .;
   .bss (NOLOAD)       :
   {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
+   *(.sbss*)
+   *(.bss*)
    *(COMMON)
   } :bss
 
diff --git a/arch/powerpc/cpu/mpc85xx/u-boot-nand_spl.lds b/arch/powerpc/cpu/mpc85xx/u-boot-nand_spl.lds
index 7d9cee9..b10e0f9 100644
--- a/arch/powerpc/cpu/mpc85xx/u-boot-nand_spl.lds
+++ b/arch/powerpc/cpu/mpc85xx/u-boot-nand_spl.lds
@@ -28,15 +28,15 @@  SECTIONS
 {
 	. = 0xfff00000;
 	.text : {
-		*(.text)
+		*(.text*)
 	}
 	_etext = .;
 
 	.reloc : {
 		_GOT2_TABLE_ = .;
-		*(.got2)
+		KEEP(*(.got2))
 		_FIXUP_TABLE_ = .;
-		*(.fixup)
+		KEEP(*(.fixup))
 	}
 	__got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
 	__fixup_entries = (. - _FIXUP_TABLE_) >> 2;
@@ -54,13 +54,13 @@  SECTIONS
 	__init_end = .;
 
 	.resetvec ADDR(.text) + 0xffc : {
-		*(.resetvec)
+		KEEP(*(.resetvec))
 	} = 0xffff
 
 	__bss_start = .;
 	.bss : {
-		*(.sbss)
-		*(.bss)
+		*(.sbss*)
+		*(.bss*)
 	}
 	_end = .;
 }