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

Wolfgang Denk wd at denx.de
Thu Jul 24 15:01:05 CEST 2008


In message <f608b67d0807232345r482792b6lbc9bd6804f48e597 at mail.gmail.com> you wrote:
> 
> So, the value of 'pf' is equal to the address of do_ptrt() *before*
> relocation. The fact that there is a GOT and a sophisticated linker
> script did not prevent this from happening.

Yes, statically initialized function pointers are known to be not
relocated at the moment; they need manual fixing after relocation.
Note that this is exactly what Grant's patch fixed.

> > Why would we do that? The compiler already generates such a table for
> > free - the GOT.
> 
> well, didn't the example above show that the compiler will not do that
> to an arbitrary pointer to a text object?

It just shows that we don't know (yet) how to handle this correctly on
a range of given toolchains.

> Quite frankly, GOT is also clumsy and even ugly IMHO - it requires a
> lot of special treatment, explicit data definitions and linker
> scripts, and does not work for arbitrary data as we saw above.

It is standard, documented by the ABI, and works fine if done
correctly. We just don't do it correctly yet.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The only person who always got his work done by Friday
                                                 was Robinson Crusoe.




More information about the U-Boot mailing list