[U-Boot] [PATCH 23/24 V2] 8260: Cleanup for partial linking and --gc-sections

Wolfgang Denk wd at denx.de
Thu Nov 25 17:00:43 CET 2010


Signed-off-by: Wolfgang Denk <wd at denx.de>
---
 arch/powerpc/cpu/mpc8260/u-boot.lds |   56 +++++++----------------------------
 board/atc/ti113x.c                  |    4 +-
 board/cogent/u-boot.lds             |    6 +++-
 include/configs/cogent_mpc8260.h    |    2 +-
 4 files changed, 19 insertions(+), 49 deletions(-)

diff --git a/arch/powerpc/cpu/mpc8260/u-boot.lds b/arch/powerpc/cpu/mpc8260/u-boot.lds
index b8681e7..ad2ce37 100644
--- a/arch/powerpc/cpu/mpc8260/u-boot.lds
+++ b/arch/powerpc/cpu/mpc8260/u-boot.lds
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2001-2007
+ * (C) Copyright 2001-2010
  * Wolfgang Denk, DENX Software Engineering, wd at denx.de.
  *
  * See file CREDITS for list of people who contributed to this
@@ -22,46 +22,17 @@
  */
 
 OUTPUT_ARCH(powerpc)
-/* Do we need any of these for elf?
-   __DYNAMIC = 0;    */
+
 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/mpc8260/start.o		(.text)
-    *(.text)
-    *(.got1)
+    arch/powerpc/cpu/mpc8260/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;
@@ -69,23 +40,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 = .);
@@ -111,9 +78,8 @@ SECTIONS
   __bss_start = .;
   .bss (NOLOAD)       :
   {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
+   *(.bss*)
+   *(.sbss*)
    *(COMMON)
    . = ALIGN(4);
   }
diff --git a/board/atc/ti113x.c b/board/atc/ti113x.c
index 473bb10..ff871f6 100644
--- a/board/atc/ti113x.c
+++ b/board/atc/ti113x.c
@@ -468,7 +468,7 @@ static int i365_set_io_map (socket_info_t * s, struct pccard_io_map *io)
 
 /*====================================================================*/
 
-int i82365_init (void)
+static int i82365_init (void)
 {
 	u_int val;
 	int i;
@@ -545,7 +545,7 @@ int i82365_init (void)
 	return 0;
 }
 
-void i82365_exit (void)
+static void i82365_exit (void)
 {
 	io.map = 0;
 	io.flags = 0;
diff --git a/board/cogent/u-boot.lds b/board/cogent/u-boot.lds
index b4c7a0e..42ed142 100644
--- a/board/cogent/u-boot.lds
+++ b/board/cogent/u-boot.lds
@@ -21,6 +21,7 @@
  * MA 02111-1307 USA
  */
 
+#include <config.h>
 OUTPUT_ARCH(powerpc)
 
 SECTIONS
@@ -29,9 +30,12 @@ SECTIONS
   . = + SIZEOF_HEADERS;
   .text      :
   {
+#ifdef CONFIG_MPC8260
+    arch/powerpc/cpu/mpc8260/start.o	(.text*)
+#else
     arch/powerpc/cpu/mpc8xx/start.o	(.text*)
     arch/powerpc/cpu/mpc8xx/traps.o	(.text*)
-
+#endif
     *(.text*)
   }
   _etext = .;
diff --git a/include/configs/cogent_mpc8260.h b/include/configs/cogent_mpc8260.h
index d77af0d..2997f52 100644
--- a/include/configs/cogent_mpc8260.h
+++ b/include/configs/cogent_mpc8260.h
@@ -108,7 +108,7 @@
 #define CONFIG_CMD_KGDB
 
 #undef CONFIG_CMD_NET
-
+#undef CONFIG_CMD_NFS
 
 #ifdef DEBUG
 #define CONFIG_BOOTDELAY	-1	/* autoboot disabled		*/
-- 
1.7.3.2



More information about the U-Boot mailing list