[U-Boot] [TESTING PATCH] ppc: Relocation test patch

Joakim Tjernlund joakim.tjernlund at transmode.se
Thu Sep 17 14:34:39 CEST 2009


Wolfgang Denk <wd at denx.de> wrote on 17/09/2009 12:15:42:
>
> Dear Joakim Tjernlund,
>
> In message <OFA0E17029.E568D101-ONC1257634.002EFBFD-C1257634.
> 002F97F1 at transmode.se> you wrote:
> >
> > > > One day we can fit the whole relocation table into built-in CPU memory, hopefully
> > > > that will make it possible to make u-boot a true PIC exe
> > >
> > > Why is the former the prerequisite for the latter?
> >
> > Some time ago I looked into making u-boot PIC and I came to the conclusion
> > that one must be able to modify the GOT table before we have relocated to RAM.
> > Perhaps there is another way but didn't see it at the time, maybe there is some
> > "hidden" option to gcc that I missed.
>
> But why has the GOT table to fit "into built-in CPU memory"? When we
> are about to relocate U-Boot to RAM, we already have RAM working. So
> we should also be able to copy the GOT table to RAM and modify it
> there as needed before we use it?

Before you get RAM working there are lots of references to global data and
string literals. These point to their link address so if you have loaded
u-boot at a different address than you link address you have to adjust for
the offset. Hard to do that when GOT is in flash :(

>
> > The main problem are all those string literals, these are in the fixup table
> > and one wants to use printf and friends before relocation to RAM.
>
> Maybe a similar approach is usable here?

Yes, fixups and GOT are the same in this regard.



More information about the U-Boot mailing list