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

Grant Likely grant.likely at secretlab.ca
Sat Jul 26 08:20:30 CEST 2008


On Sat, Jul 26, 2008 at 1:54 AM, vb <vb at vsbe.com> wrote:
> On Fri, Jul 25, 2008 at 10:43 PM, Grant Likely
> <grant.likely at secretlab.ca> wrote:
>>
>> The problem is that the u-boot C runtime setup is insane and must be
>> fixed.  Fix the C runtime and the problem goes away.  The approach
>> being suggested here would have us *preserve* the insane C runtime and
>> actually depend on the runtime to remain insane in order to work.
>>
>
> Grant, thank you for pitching in.
>
> It would be great if you could elaborate what exactly is insane about
> C runtime setup (especially since in u-boot its code comes from the
> source tree and not from some obscure compiler dependent library) and
> how its insanity is related here.

In a sane C runtime, pointers declared in a static variable are
usable.  Since u-boot's relocation does not fix up the pointers, that
means it is insane.

The mechanism exists to do relocation properly.  It is in the u-boot
code and it conforms to the PowerPC ABI.  However, we're not using GCC
correctly so we cannot reliably get the relocation data loaded into
the .got and .fixup sections.  This is all discussed in detail in the
u-boot archives (see the gmane search link that Jerry posted at the
beginning of this thread).

g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.




More information about the U-Boot mailing list