]> git.sur5r.net Git - u-boot/commitdiff
Blackfin: fix linker scripts to work with --gc-sections
authorMike Frysinger <vapier@gentoo.org>
Fri, 24 Oct 2008 21:48:54 +0000 (17:48 -0400)
committerMike Frysinger <vapier@gentoo.org>
Wed, 7 Jan 2009 07:59:46 +0000 (02:59 -0500)
Make sure all .text sections get pulled in and the entry point is properly
referenced so they don't get discarded when linking with --gc-sections.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
board/bf533-ezkit/u-boot.lds.S
board/bf533-stamp/u-boot.lds.S
board/bf537-stamp/u-boot.lds.S
board/bf561-ezkit/u-boot.lds.S

index 70764acf1ab4eca3494cc56aaef8cfa1d43c58b9..da16726d868cbcd6050bd169fc7a1d624b1bc2d8 100644 (file)
@@ -28,6 +28,8 @@
 #include <config.h>
 #include <asm/blackfin.h>
 #undef ALIGN
+#undef ENTRY
+#undef bfin
 
 /* If we don't actually load anything into L1 data, this will avoid
  * a syntax error.  If we do actually load something into L1 data,
@@ -50,11 +52,12 @@ MEMORY
        l1_data : ORIGIN = L1_DATA_B_SRAM,   LENGTH = L1_DATA_B_SRAM_SIZE
 }
 
+ENTRY(_start)
 SECTIONS
 {
        .text :
        {
-               cpu/blackfin/start.o (.text)
+               cpu/blackfin/start.o (.text .text.*)
 
 #ifdef ENV_IS_EMBEDDED
                /* WARNING - the following is hand-optimized to fit within
@@ -63,20 +66,20 @@ SECTIONS
                 * it linked after the configuration sector.
                 */
 
-               cpu/blackfin/traps.o            (.text)
-               cpu/blackfin/interrupt.o        (.text)
-               cpu/blackfin/serial.o           (.text)
-               common/dlmalloc.o               (.text)
-               lib_generic/crc32.o             (.text)
-               lib_generic/zlib.o              (.text)
-               board/bf533-ezkit/bf533-ezkit.o         (.text)
+               cpu/blackfin/traps.o            (.text .text.*)
+               cpu/blackfin/interrupt.o        (.text .text.*)
+               cpu/blackfin/serial.o           (.text .text.*)
+               common/dlmalloc.o               (.text .text.*)
+               lib_generic/crc32.o             (.text .text.*)
+               lib_generic/zlib.o              (.text .text.*)
+               board/bf533-ezkit/bf533-ezkit.o         (.text .text.*)
 
                . = DEFINED(env_offset) ? env_offset : .;
-               common/env_embedded.o   (.text)
+               common/env_embedded.o   (.text .text.*)
 #endif
 
                __initcode_start = .;
-               cpu/blackfin/initcode.o (.text)
+               cpu/blackfin/initcode.o (.text .text.*)
                __initcode_end = .;
 
                *(.text .text.*)
index 187309f3fcff65af51df5a9d2eff2ba612dc3375..76daa75c0d6bae1990f5a34e9dc7d0a4258972ea 100644 (file)
@@ -28,6 +28,8 @@
 #include <config.h>
 #include <asm/blackfin.h>
 #undef ALIGN
+#undef ENTRY
+#undef bfin
 
 /* If we don't actually load anything into L1 data, this will avoid
  * a syntax error.  If we do actually load something into L1 data,
@@ -50,11 +52,12 @@ MEMORY
        l1_data : ORIGIN = L1_DATA_B_SRAM,   LENGTH = L1_DATA_B_SRAM_SIZE
 }
 
+ENTRY(_start)
 SECTIONS
 {
        .text :
        {
-               cpu/blackfin/start.o (.text)
+               cpu/blackfin/start.o (.text .text.*)
 
 #ifdef ENV_IS_EMBEDDED
                /* WARNING - the following is hand-optimized to fit within
@@ -63,18 +66,18 @@ SECTIONS
                 * it linked after the configuration sector.
                 */
 
-               cpu/blackfin/traps.o            (.text)
-               cpu/blackfin/interrupt.o        (.text)
-               cpu/blackfin/serial.o           (.text)
-               common/dlmalloc.o               (.text)
-               lib_generic/crc32.o             (.text)
+               cpu/blackfin/traps.o            (.text .text.*)
+               cpu/blackfin/interrupt.o        (.text .text.*)
+               cpu/blackfin/serial.o           (.text .text.*)
+               common/dlmalloc.o               (.text .text.*)
+               lib_generic/crc32.o             (.text .text.*)
 
                . = DEFINED(env_offset) ? env_offset : .;
-               common/env_embedded.o   (.text)
+               common/env_embedded.o   (.text .text.*)
 #endif
 
                __initcode_start = .;
-               cpu/blackfin/initcode.o (.text)
+               cpu/blackfin/initcode.o (.text .text.*)
                __initcode_end = .;
 
                *(.text .text.*)
index 187309f3fcff65af51df5a9d2eff2ba612dc3375..76daa75c0d6bae1990f5a34e9dc7d0a4258972ea 100644 (file)
@@ -28,6 +28,8 @@
 #include <config.h>
 #include <asm/blackfin.h>
 #undef ALIGN
+#undef ENTRY
+#undef bfin
 
 /* If we don't actually load anything into L1 data, this will avoid
  * a syntax error.  If we do actually load something into L1 data,
@@ -50,11 +52,12 @@ MEMORY
        l1_data : ORIGIN = L1_DATA_B_SRAM,   LENGTH = L1_DATA_B_SRAM_SIZE
 }
 
+ENTRY(_start)
 SECTIONS
 {
        .text :
        {
-               cpu/blackfin/start.o (.text)
+               cpu/blackfin/start.o (.text .text.*)
 
 #ifdef ENV_IS_EMBEDDED
                /* WARNING - the following is hand-optimized to fit within
@@ -63,18 +66,18 @@ SECTIONS
                 * it linked after the configuration sector.
                 */
 
-               cpu/blackfin/traps.o            (.text)
-               cpu/blackfin/interrupt.o        (.text)
-               cpu/blackfin/serial.o           (.text)
-               common/dlmalloc.o               (.text)
-               lib_generic/crc32.o             (.text)
+               cpu/blackfin/traps.o            (.text .text.*)
+               cpu/blackfin/interrupt.o        (.text .text.*)
+               cpu/blackfin/serial.o           (.text .text.*)
+               common/dlmalloc.o               (.text .text.*)
+               lib_generic/crc32.o             (.text .text.*)
 
                . = DEFINED(env_offset) ? env_offset : .;
-               common/env_embedded.o   (.text)
+               common/env_embedded.o   (.text .text.*)
 #endif
 
                __initcode_start = .;
-               cpu/blackfin/initcode.o (.text)
+               cpu/blackfin/initcode.o (.text .text.*)
                __initcode_end = .;
 
                *(.text .text.*)
index 99d6be634f5fdc49f06332418d02f955738b5a66..3d0453e2f20fde5d511d29d481eea8b5232f466d 100644 (file)
@@ -28,6 +28,8 @@
 #include <config.h>
 #include <asm/blackfin.h>
 #undef ALIGN
+#undef ENTRY
+#undef bfin
 
 /* If we don't actually load anything into L1 data, this will avoid
  * a syntax error.  If we do actually load something into L1 data,
@@ -50,11 +52,12 @@ MEMORY
        l1_data : ORIGIN = L1_DATA_B_SRAM,   LENGTH = L1_DATA_B_SRAM_SIZE
 }
 
+ENTRY(_start)
 SECTIONS
 {
        .text :
        {
-               cpu/blackfin/start.o (.text)
+               cpu/blackfin/start.o (.text .text.*)
 
 #ifdef ENV_IS_EMBEDDED
                /* WARNING - the following is hand-optimized to fit within
@@ -63,20 +66,20 @@ SECTIONS
                 * it linked after the configuration sector.
                 */
 
-               cpu/blackfin/traps.o            (.text)
-               cpu/blackfin/interrupt.o        (.text)
-               cpu/blackfin/serial.o           (.text)
-               common/dlmalloc.o               (.text)
-               lib_generic/crc32.o             (.text)
-               lib_generic/zlib.o              (.text)
-               board/bf561-ezkit/bf561-ezkit.o         (.text)
+               cpu/blackfin/traps.o            (.text .text.*)
+               cpu/blackfin/interrupt.o        (.text .text.*)
+               cpu/blackfin/serial.o           (.text .text.*)
+               common/dlmalloc.o               (.text .text.*)
+               lib_generic/crc32.o             (.text .text.*)
+               lib_generic/zlib.o              (.text .text.*)
+               board/bf561-ezkit/bf561-ezkit.o         (.text .text.*)
 
                . = DEFINED(env_offset) ? env_offset : .;
-               common/env_embedded.o   (.text)
+               common/env_embedded.o   (.text .text.*)
 #endif
 
                __initcode_start = .;
-               cpu/blackfin/initcode.o (.text)
+               cpu/blackfin/initcode.o (.text .text.*)
                __initcode_end = .;
 
                *(.text .text.*)