[U-Boot] [PATCH 15/25 V4] 83xx: Cleanup for partial linking and --gc-sections

Kim Phillips kim.phillips at freescale.com
Sun Nov 28 16:11:46 CET 2010


From: Wolfgang Denk <wd at denx.de>

Signed-off-by: Wolfgang Denk <wd at denx.de>
Cc: Haiying Wang <r54964 at freescale.com>
Signed-off-by: Kim Phillips <kim.phillips at freescale.com>
---
Changes since V2:
	- fixed nand_spl/*/u-boot.lds as pointed out by Haiying

Changes since V3:
	- included the simpc8313 board

 arch/powerpc/cpu/mpc83xx/u-boot.lds             |   53 ++++------------------
 nand_spl/board/freescale/mpc8313erdb/u-boot.lds |    7 ++-
 nand_spl/board/freescale/mpc8315erdb/u-boot.lds |    7 ++-
 nand_spl/board/sheldon/simpc8313/u-boot.lds     |    9 ++--
 4 files changed, 23 insertions(+), 53 deletions(-)

diff --git a/arch/powerpc/cpu/mpc83xx/u-boot.lds b/arch/powerpc/cpu/mpc83xx/u-boot.lds
index 0b74a13..81a7ace 100644
--- a/arch/powerpc/cpu/mpc83xx/u-boot.lds
+++ b/arch/powerpc/cpu/mpc83xx/u-boot.lds
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2006
+ * (C) Copyright 2006-2010
  * Wolfgang Denk, DENX Software Engineering, wd at denx.de.
  *
  * See file CREDITS for list of people who contributed to this
@@ -25,41 +25,13 @@ OUTPUT_ARCH(powerpc)
 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      :
   {
-    arch/powerpc/cpu/mpc83xx/start.o	(.text)
-    *(.text)
-    *(.got1)
+    arch/powerpc/cpu/mpc83xx/start.o	(.text*)
+    *(.text*)
     . = ALIGN(16);
-    *(.eh_frame)
     *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
   }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
 
   /* Read-write section, merged into data segment: */
   . = (. + 0x0FFF) & 0xFFFFF000;
@@ -67,23 +39,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 = .);
@@ -109,9 +77,8 @@ SECTIONS
   __bss_start = .;
   .bss (NOLOAD)       :
   {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
+   *(.bss*)
+   *(.sbss*)
    *(COMMON)
    . = ALIGN(4);
   }
diff --git a/nand_spl/board/freescale/mpc8313erdb/u-boot.lds b/nand_spl/board/freescale/mpc8313erdb/u-boot.lds
index ad82589..138e427 100644
--- a/nand_spl/board/freescale/mpc8313erdb/u-boot.lds
+++ b/nand_spl/board/freescale/mpc8313erdb/u-boot.lds
@@ -30,7 +30,6 @@ SECTIONS
 	.text : {
 		*(.text*)
 		. = ALIGN(16);
-		*(.eh_frame)
 		*(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
 	}
 
@@ -39,13 +38,15 @@ SECTIONS
 		*(.data*)
 		*(.sdata*)
 		_GOT2_TABLE_ = .;
-		*(.got2)
+		KEEP(*(.got2))
 		__got2_entries = (. - _GOT2_TABLE_) >> 2;
 	}
 
 	. = ALIGN(8);
 	__bss_start = .;
-	.bss (NOLOAD) : { *(.*bss) }
+	.bss (NOLOAD) : {
+		*(.*bss)
+	}
 	_end = .;
 }
 ENTRY(_start)
diff --git a/nand_spl/board/freescale/mpc8315erdb/u-boot.lds b/nand_spl/board/freescale/mpc8315erdb/u-boot.lds
index ad82589..138e427 100644
--- a/nand_spl/board/freescale/mpc8315erdb/u-boot.lds
+++ b/nand_spl/board/freescale/mpc8315erdb/u-boot.lds
@@ -30,7 +30,6 @@ SECTIONS
 	.text : {
 		*(.text*)
 		. = ALIGN(16);
-		*(.eh_frame)
 		*(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
 	}
 
@@ -39,13 +38,15 @@ SECTIONS
 		*(.data*)
 		*(.sdata*)
 		_GOT2_TABLE_ = .;
-		*(.got2)
+		KEEP(*(.got2))
 		__got2_entries = (. - _GOT2_TABLE_) >> 2;
 	}
 
 	. = ALIGN(8);
 	__bss_start = .;
-	.bss (NOLOAD) : { *(.*bss) }
+	.bss (NOLOAD) : {
+		*(.*bss)
+	}
 	_end = .;
 }
 ENTRY(_start)
diff --git a/nand_spl/board/sheldon/simpc8313/u-boot.lds b/nand_spl/board/sheldon/simpc8313/u-boot.lds
index ad82589..f80fe16 100644
--- a/nand_spl/board/sheldon/simpc8313/u-boot.lds
+++ b/nand_spl/board/sheldon/simpc8313/u-boot.lds
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2006
+ * (C) Copyright 2006-2010
  * Wolfgang Denk, DENX Software Engineering, wd at denx.de.
  *
  * Copyright 2008 Freescale Semiconductor, Inc.
@@ -30,7 +30,6 @@ SECTIONS
 	.text : {
 		*(.text*)
 		. = ALIGN(16);
-		*(.eh_frame)
 		*(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
 	}
 
@@ -39,13 +38,15 @@ SECTIONS
 		*(.data*)
 		*(.sdata*)
 		_GOT2_TABLE_ = .;
-		*(.got2)
+		KEEP(*(.got2))
 		__got2_entries = (. - _GOT2_TABLE_) >> 2;
 	}
 
 	. = ALIGN(8);
 	__bss_start = .;
-	.bss (NOLOAD) : { *(.*bss) }
+	.bss (NOLOAD) : {
+		*(.*bss)
+	}
 	_end = .;
 }
 ENTRY(_start)
-- 
1.7.3.2




More information about the U-Boot mailing list