Patchwork [U-Boot,07/17] use -ffunction-sections / --gc-sections on IXP42x

login
register
mail settings
Submitter Michael Schwingen
Date Feb. 4, 2011, 11:05 p.m.
Message ID <1296860763-16149-8-git-send-email-michael@schwingen.org>
Download mbox | patch
Permalink /patch/81974/
State Superseded
Headers show

Comments

Michael Schwingen - Feb. 4, 2011, 11:05 p.m.
Signed-off-by: Michael Schwingen <michael@schwingen.org>
---
 arch/arm/cpu/ixp/config.mk  |    5 +++++
 arch/arm/cpu/ixp/u-boot.lds |    8 ++++----
 2 files changed, 9 insertions(+), 4 deletions(-)

Patch

diff --git a/arch/arm/cpu/ixp/config.mk b/arch/arm/cpu/ixp/config.mk
index deca3f4..5868cba 100644
--- a/arch/arm/cpu/ixp/config.mk
+++ b/arch/arm/cpu/ixp/config.mk
@@ -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
diff --git a/arch/arm/cpu/ixp/u-boot.lds b/arch/arm/cpu/ixp/u-boot.lds
index a55eb8a..747a7b6 100644
--- a/arch/arm/cpu/ixp/u-boot.lds
+++ b/arch/arm/cpu/ixp/u-boot.lds
@@ -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);
@@ -65,7 +65,7 @@  SECTIONS
 
 	.bss __rel_dyn_start (OVERLAY) : {
 		__bss_start = .;
-		*(.bss)
+		*(.bss*)
 		 . = ALIGN(4);
 		_end = .;
 	}