[U-Boot] [PATCH] Fix Freescale link scripts for newer GCCs

Kim Phillips
2009-02-17T02:05:02Z

On Mon, 2 Feb 2009 20:11:56 -0800 (PST)
Trent Piepho <xyzzy@speakeasy.org> wrote:

> On Sat, 31 Jan 2009, Wolfgang Denk wrote:
> > In message <Pine.LNX.4.64.0901310259430.8685@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 at 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