[U-Boot] [PATCH 1/2] arm: implement ELF relocations

Reinhard Meyer u-boot at emk-elektronik.de
Wed Oct 6 08:45:35 CEST 2010


Dear Albert ARIBAUD,

> Indeed, CONFIG_SYS_ARM_WITHOUT_RELOC should disappear eventually -- it's
> still there only to give board maintainers a way to build with and
> without relocation e.g. for testing purposes, and it was announced that
> it would disappear when relocation makes it into an official release.
> 
> As for CONFIG_SKIP_RELOCATE_UBOOT, it was useful in getting a smaller
> u-boot that would not relocated because it was already at the right
> place to execute; perfect (along with CONFIG_SKIP_LOWLEVEL_INIT) for
> building a RAM-based, run-where-it-is u-boot.

CONFIG_SKIP_RELOCATE_UBOOT could remain, making CONFIG_SYS_ARM_WITHOUT_RELOC
obsolete. Both must now anyway be defined together or both not!

Also I observed problems with old AT91 code since without
CONFIG_SYS_ARM_WITHOUT_RELOC board_init() is called very early, with it
is called after relocation is done. I think most AT91 boards that copied
code from AT91SAM9***-EK's have to correct their code because "early init"
stuff is done in board_init().

> 
> Now with relocation, we may not need it any more; but you're right that
> it cannot stay if it does not work.
> 
>> Although I am not happy to have that removed right now
>> (for code size concerns), I would suggest to remove all relocation
>> preventing code which should make the code much more readable.
> 
> What do you mean by 'relocation-*preventing* code'?

Everything, including the #if's that is there for the non-relocating cases.
(preventing was a bad choice of word)

> 
>> If really required, a new introduction of a define, mainly changing
>> the linker options not to emit relocation information and skipping a
>> few lines of relocation business _could_ be introduced.
> 
> That would be a cleaner thing, yes.
> 
> Right now I don't think that should go into the ELF relocation patch,
> though; I'll make sure CONFIG_SKIP_RELOCATE_UBOOT either works or goes
> away, but unless instructed otherwise, I won't introduce a system-wide
> "don't relocate" feature.

CONFIG_RELOCATE_UBOOT definitely worked before the relocation patches, I
am not sure whether it still works, especially when
CONFIG_SYS_ARM_WITHOUT_RELOC is removed.

Best Regards,
Reinhard



More information about the U-Boot mailing list