On Mon, 2 Feb 2009 20:11:56 -0800 (PST) Trent Piepho <xy...@speakeasy.org> wrote:
> On Sat, 31 Jan 2009, Wolfgang Denk wrote: > > In message <pine.lnx.4.64.0901310259430.8...@t2.domain.actdsltmp> you wrote: > > > > so, what's the status of this patch? I've seen this fail on 83xx. > > > > Most of these types of patches that fix the newer gcc's behaviour have > > > > been dropped, one of which even did sorting on name and alignment: > > > > > > > > http://www.mail-archive.com/u-boot@lists.denx.de/msg03193.html > > > > > > > > Do I need to make one for 83xx and apply it myself? > > > > > > Wolfgang rejected mine because he wanted a patch that fixed every single > > > board in one shot. I didn't feel like patching a hundred other linker > > > scripts I knew nothing about. > > > > Why not? If you know what you are doing (and I have strong resons to > > believe that you do) then I think your fix should be applied to all > > systems that are affected by the problem. > > But what systems are affected by the problem? For instance ms7750se only > has ".rodata", not even ".rodata.str1.4". So should it get changed too? > > There are CPUs that have a special segment for byte aligned data. Does > u-boot support any of these CPUs? I don't know. But changing ".rodata" to > ".rodata*" could break a system if ".rodata1" was supposed to be picked up > by a ".*data*1" somewhere else in the linker script. It seems like people > who know the platform would be less likely to get caught by this. > > Or take something like mpc8220, which has this for a text segment: > *(.text) > *(.fixup) > *(.got1) > . = ALIGN(16); > *(.rodata) > *(.rodata1) > *(.rodata.str1.4) > *(.eh_frame) > > Why is the start of rodata aligned to 16 bytes? I'd guess some sort of I/D > cache issue. Though aren't fixup and got1 data, not code? I can't > find any docs on what the differences between fixup, got, got1, and got2 > are. It seems like current gcc only uses got2. The mpc8220 ld script also > lists fixup a second time, in the reloc section, a mistake that probably > doesn't break anything since I think gcc hasn't used fixup in some time. > > Anyway, not knowing if it's ok to delete fixup and got1, I would change > this to: > *(.text) > *(.fixup) > *(.got1) > . = ALIGN(16); > *(.eh_frame) > *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) > > eh_frame should go before rodata* since it has has a larger alignment, but > now rodata isn't 16 byte aligned like it was before. Does that matter? I > doubt it, but I don't know for sure. > WD, do you have a response to the above? Otherwise, I'll put this in my queue: >From 14bca65bf1122cb1cae14e39d1cf7e5e0cec7b70 Mon Sep 17 00:00:00 2001 From: Kim Phillips <kim.phill...@freescale.com> Date: Mon, 16 Feb 2009 19:44:15 -0600 Subject: [PATCH] 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. Signed-off-by: Trent Piepho <xy...@speakeasy.org> stole Trent's 85xx version and made to apply to 83xx. Signed-off-by: Kim Phillips <kim.phill...@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 _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot