Skip to contentSkip to conversation

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

PATCH New Kim Phillips 1 participant 1 message Feb 17, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mpc83xx: fix builds with new linker and improve link script rodata section

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.

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

---
 cpu/mpc83xx/u-boot.lds |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
cpu/mpc83xx/u-boot.lds +1 -3
index 3a08f64..7d57ee4 100644
@@ -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)   }
Signature · 3 lines
1.6.0.3.640.g6331a

Kim