From mboxrd@z Thu Jan 1 00:00:00 1970 From: Albert ARIBAUD Date: Sat, 30 Oct 2010 23:56:42 +0200 Subject: [U-Boot] Trying to understand ARM926EJS/start.S In-Reply-To: <20101030192116.77E561522C0@gemini.denx.de> References: <4CCC5F4D.20405@emk-elektronik.de> <4CCC69E4.8090103@free.fr> <20101030192116.77E561522C0@gemini.denx.de> Message-ID: <4CCC949A.2030208@free.fr> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Le 30/10/2010 21:21, Wolfgang Denk a ?crit : > Dear Albert ARIBAUD, > > In message<4CCC69E4.8090103@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.