[U-Boot] Question about relocation

Albert ARIBAUD albert.u.boot at aribaud.net
Sun Apr 17 20:23:23 CEST 2011


Le 17/04/2011 19:57, Alessandro Rubini a écrit :

>> beginning-to-end copy or an end-to-beginning copy depending on the
>> source and destination addresses and size.
>
> Ori, simply, end-to-beginning when moving up. Or always
> end-to-beginning since we are expected to always move up (upper than
> the target address it can't run).

Since the 'issue' is caused by the code assuming one direction, I'd 
prefer it not to assume the other now; I prefer choosing 
end-to-beginning if target is dest than source, beginning-to-end otherwise.

> It is safer, but not safe. Also, it's difficult to accomplish bcause
> copying and fixing addresses is done ina single run, so the relocation
> tables are read from the old area. Possibly relocatng first and
> copying then.

Actually no, copying and fixing is not done in a single run. There is 
the copying of the text+data+const area, then the fixing which runs 
through the relocation table area; they are different.

> Or, easier: if we are already high enough to overlap, don't relocate
> at all.  If it's acceptable, I'll patch for taht.

But then comes the question of how enough is "high enough". :)

> thanks
> /alessandro

Amicalement,
-- 
Albert.


More information about the U-Boot mailing list