From: Reinhard Meyer Date: Wed, 06 Oct 2010 11:48:32 +0200 Subject: [U-Boot] [PATCH] futile c relocation attempt In-Reply-To: <4CAC44B4.800@gmail.com> References: <1286290132-2935-1-git-send-email-u-boot@emk-elektronik.de> <4CAC44B4.800@gmail.com> Message-ID: <4CAC45F0.3040805@emk-elektronik.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Graeme Russ, > I had a quick look at this and nothing is jumping out at me. Of course I am > not familiar with ARM asm... > > I don't see any reason why this ultimately will not work eventually. You > may be having some issues with the transition from asm->C->asm through the > relocation - This was an especially painful thing for me involving an > intermediate trampoline which I have only recently figured out how to remove. I think the relocation itself works fine, when looking at the debug output. > Maybe some memory barriers are needed to stop the C optimiser mangling things? It can't really optimize across the call to the (now wrongly named) reloc_code in assembly. > Interestingly, ARM is adding gd->reloc_off while x86 is subtracting > gd->reloc_off. If this is correct, I need to change the calculation of > gd_reloc_off to be consistent It should always ADD it, when it is calculated as "Final Location" - "Current Location". Note, of course, that the value itself might well be negative. If, for example, the NOR Flash is at a higher address than RAM... Best Regards Reinhard