[PATCH] mpc83xx: fix builds with new linker and improve link script rodata section

Kim Phillips kim.phillips at freescale.com
Tue Feb 17 02:44:15 CET 2009


A recent gcc added a new unaligned rodata section called '.rodata.str1.1'
and that needs to be added the the linker script.

Rather than just add that one section, instead use '*(.rodata*)' to catch
that section and any future rodata sections.

'*(.rodata*)' by itself will result in sub-optimal section ordering.  The
section will be sorted by object file, which causes extra padding between
the unaligned rodata.str.1.1 of one object file and the aligned rotdata of
the next object file.  This is easy to fix by using the SORT_BY_ALIGNMENT
command.

Signed-off-by: Trent Piepho <xyzzy at speakeasy.org>

stole Trent's 85xx version and made to apply to 83xx.

Signed-off-by: Kim Phillips <kim.phillips at freescale.com>
---
 cpu/mpc83xx/u-boot.lds |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/cpu/mpc83xx/u-boot.lds b/cpu/mpc83xx/u-boot.lds
index 3a08f64..7d57ee4 100644
--- a/cpu/mpc83xx/u-boot.lds
+++ b/cpu/mpc83xx/u-boot.lds
@@ -55,10 +55,8 @@ SECTIONS
     *(.fixup)
     *(.got1)
     . = ALIGN(16);
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
     *(.eh_frame)
+    *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
   }
   .fini      : { *(.fini)    } =0
   .ctors     : { *(.ctors)   }
-- 
1.6.0.3.640.g6331a

Kim


More information about the U-Boot mailing list