[U-Boot] [PATCH] relocation: Do not relocate NULL pointers.
Peter Tyser
ptyser at xes-inc.com
Tue Oct 6 01:20:11 CEST 2009
Hi Jocke,
> > > There are a few change which would further improve relocation that Jocke
> > > and I want to get merged. Whether these improvements occur in this
> > > release or the next is not a big deal to me.
> > > 1. Fix relocation of NULL pointers.
> > > eg the following code would print the relocation fixup offset instead of
> > > the expected NULL.
> > > void weak_fun(void) __attribute__((weak));
> > > printf("weak_fun:%p\n", weak_fun);
> > > This was already an issue, so we're not breaking anything in the "reloc"
> > > branch
> > >
> > > 2. Move relocation fixup code to C-code
> > >
> > > 3. Possibly get true relocation working so that U-Boot could be located
> > > anywhere and still execute.
> >
> > I tend to get all of this (as far as it's available and considered to
> > be ready) into this release, so we have it all in one big block.
>
> 3. isn't ready and won't be for a while more
>
> 1. is just a small fix the the existing asm reloc functions. Pretty much
> ready but needs some linker tweeks it seems. No idea if other
> boards than 85xx also needs a linker tweak or not.
It looks like 85xx is the only arch that needed linker script tweaks. I
just submitted some patches a bit ago.
> 2. is 1 in C and some common supporting asm for ppc. Any idea were
> to put common asm files for ppc? I was hoping I could get away with
> just 83xx and the rest could be done later by interested parties?
Assuming the 85xx link script changes are accepted, what's the gameplan
now? #1 is pretty trivial (the original patch that spawned this thread
with slight tweaks) and should be easy to get in this merge window.
That would get us to the point that relocation is fully functional,
including non-relocation of NULL pointers.
#2 looks more involved and prone to errors as it requires some shuffling
of registers in assembly for all architectures. Are we aiming for
getting #2 across all architectures in this window? I should be able to
implement and test it on 85xx, 86xx, and 44x, and Jocke's tested on
83xx. I don't think I could do the rest of the arches by the end of
this week though. Any other takers? Save it for the next merge window?
Best,
Peter
More information about the U-Boot
mailing list