[U-Boot-Users] Changing u-boot relocation scheme

Kenneth Johansson kenneth at southpole.se
Thu Jul 24 20:09:41 CEST 2008


On Thu, 2008-07-24 at 10:37 -0700, vb wrote:
> On Thu, Jul 24, 2008 at 9:57 AM, Haavard Skinnemoen
> <haavard.skinnemoen at atmel.com> wrote:
> > Kenneth Johansson <kenneth at southpole.se> wrote:
> >> you have to
> >> read the gcc code to understand what the -mrelocatable option really do.
> >
> > Plus it's only defined for PowerPC. What do we do on the 11 other
> > architectures?
> >
> > We could build u-boot as a shared library I guess, but that feels a bit
> > weird...
> >
> 
> I ran a quick experiment with -mrelocate, compiled a module with it
> and then objdump -D its contents, it seems to do exactly what I wanted
> - stores addresses of pointers to adjust into the fixit section.
> 
> I guess the least intrusive alternative would be to compile the ported
> code with this option, and then add a check to the u-boot function
> dealing with GOT adjustments to see if the fixit section is nonempty.
> If so - relocate .fixit in addition to GOT.
> 
> But as you pointed out, this would work on ppc only (with a 'good'
> compiler), and still remains to be proven, I will get to it a bit
> later.

I have run u-boot with everything compiled with -mrelocatable and normal
relocation fixup code removed so I know it works fine. So consider it
proven. But since it apparently is a problem in some situation the best
is probably to make it a configuration option. 






More information about the U-Boot mailing list