use -ffunction-sections / --gc-sections on IXP42x
authorMichael Schwingen <michael@schwingen.org>
Sun, 22 May 2011 22:00:03 +0000 (00:00 +0200)
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>
Thu, 23 Jun 2011 06:24:55 +0000 (08:24 +0200)
Signed-off-by: Michael Schwingen <michael@schwingen.org>
arch/arm/cpu/ixp/config.mk
arch/arm/cpu/ixp/u-boot.lds

index deca3f4d550c5443ebe8e25fee6426dccd8daff7..5868cba38b7f3f3d3d486e52c227c4d4f2ce847e 100644 (file)
@@ -27,6 +27,11 @@ BIG_ENDIAN = y
 PLATFORM_RELFLAGS += -fno-common -ffixed-r8 -msoft-float -mbig-endian
 
 PLATFORM_CPPFLAGS += -mbig-endian -march=armv5te -mtune=strongarm1100
+
+# -fdata-sections triggers "section .bss overlaps section .rel.dyn" linker error
+PLATFORM_RELFLAGS += -ffunction-sections
+LDFLAGS_u-boot += --gc-sections
+
 # =========================================================================
 #
 # Supply options according to compiler version
index 3587f8aa6bee87c4c6641efff9aced1d129415d2..7199de4af1e317fed2cf01764d57d536f6c2f562 100644 (file)
@@ -31,8 +31,8 @@ SECTIONS
        . = ALIGN(4);
        .text :
        {
-               arch/arm/cpu/ixp/start.o(.text)
-               *(.text)
+               arch/arm/cpu/ixp/start.o(.text*)
+               *(.text*)
        }
 
        . = ALIGN(4);
@@ -40,7 +40,7 @@ SECTIONS
 
        . = ALIGN(4);
        .data : {
-               *(.data)
+               *(.data*)
        }
 
        . = ALIGN(4);
@@ -67,7 +67,7 @@ SECTIONS
 
        .bss __rel_dyn_start (OVERLAY) : {
                __bss_start = .;
-               *(.bss)
+               *(.bss*)
                 . = ALIGN(4);
                __bss_end__ = .;
        }