[U-Boot] Trying to understand ARM926EJS/start.S

Albert ARIBAUD albert.aribaud at free.fr
Sat Oct 30 23:56:42 CEST 2010


Le 30/10/2010 21:21, Wolfgang Denk a écrit :
> Dear Albert ARIBAUD,
>
> In message<4CCC69E4.8090103 at free.fr>  you wrote:
>>
>>> 	ldr	r0, _TEXT_BASE		/* r0<- Text base */
>>> %%% why are we using _TEXT_BASE here and not _start?
>>
>> Because we're accessing the relocation tables in the FLASH (or freshly
>> NAND-loaded) "source" copy of u-boot, not in the RAM "target" copy (in
>> which the relocation tables won't exist).
>
> Sorry, but I don't understand this explanation.
>
> With the linker script we make sure that the symbol _start gets linked
> to the absolute address CONFIG_SYS_TEXT_BASE, right?  And _TEXT_BASE
> is a storage that holds exactly the value CONFIG_SYS_TEXT_BASE, which
> should be identical to the address of _start ?

Somehow I thought the question was "why use the source location rather 
than the target".

Yes, if we're still running from the "source" address at that point, the 
value of _start and the content of _TEXT_BASE should be the same -- that 
does change once we start the fixup loop, though; after the loop is 
done, I think "adr r0, _start" will still give us the source start 
address but _TEXT_BASE will contain the target start address -- though 
at this time of the evening I'd want to be careful about that.

Tomorrow morning I'll run a step-by-step case on my ED Mini V2 and on my 
OpenRD and see if / where we can use "adr rX, _start".

> Best regards,
>
> Wolfgang Denk

Amicalement,
-- 
Albert.


More information about the U-Boot mailing list