[U-Boot] [PATCH] relocation: Do not relocate NULL pointers.

Joakim Tjernlund joakim.tjernlund at transmode.se
Wed Sep 23 18:53:01 CEST 2009


Peter Tyser <ptyser at xes-inc.com> wrote on 23/09/2009 14:57:19:
>
>
> > > I made the same changes recently, but ran into an "issue" that prevented
> > > me from sending the change upstream.  Some boards/arches have the bss at
> > > address 0 and later relocate it, unlike every other NULL pointer.  If
> > > you don't fix up the bss address, the board will not function.   If you
> > > run readelf on an 83xx u-boot image vs a 85xx u-boot image it should be
> > > more clear what's going on.  I was doing my testing on the XPedite5370
> > > fwiw.
> >
> > Ouch, the horror continues :(
>
> Yeah...  Its seemingly never ending:)
>
> > > In any case, the change as is would break some other arches.  Seems like
> > > the proper workaround would be to "fix" the 85xx (and other arches) link
> > > script to locate the bss similar to the 83xx boards.
> >
> > Yes, something should be done. Does it work for you with a "fixed" linker script?
>
> My "fix" to the linker script was to change:
> __bss_start = .;
> into:
> __bss_start = . | 4;
>
> ie, a big hack, but it did work:)  I'll take a peek at a more proper
> link script workaround.
>
> > > It might be nice to consolidate all the ppc relocate code into 1
> > > function while we were at it.
> >
> > Played around a little and this is what I got sofar, possibly
> > WS damged and fixups untested:
>
> Nice!  It'd be great to have the magical 20 lines of assembly put into
> some semi-understandable c.

Played some more and got this, running out of time now so
I figured I should post as is in case you (or someone else)
wants to play some more. I will answer questions though.



More information about the U-Boot mailing list