[U-Boot] ARM relocation, question to Heiko

Albert ARIBAUD
2010-10-03T08:58:00Z

Le 03/10/2010 10:44, Graeme Russ a ?crit :

>> Bill just said that -pic (or, for ARM, -fPIC or -fPIE) was unnecessary
>> for relocation. You seem to imply it actually is... In my experience,
>> -fPIC and-fPIE do increase code by adding GOT relocation to symbols that
>> need fixing, so they would indeed be redundant to any other relocation
>> mechanism -- I just did some test with basic code and this seems to
>> confirm, no -fPIx is needed to get relocation the way you do on ARM.
>
> Just to clarify -fpic is a compiler option, -pic is a linker option. x86
> has no compile time relocation options (therefore no referencing .got etc).
> Using the link time pic option produces the relocation data table
> (.rel.dyn) which must be pre-processed before execution can begin at the
> relocated address

Thanks for clarifying, Graeme.

This is consistent with the ARM compile-time options -fPIC/-fPIE vs
link-time option -pie. So there may be at least an interest in
investigating ELF-style relocation on ARM and comparing it to GOT-based
relocation in terms of FLASH and RAM sizes and code speed.

> Cheers,
>
> Graeme

Amicalement,
--
Albert.