From mboxrd@z Thu Jan 1 00:00:00 1970 From: Albert ARIBAUD Date: Tue, 05 Oct 2010 11:32:56 +0200 Subject: [U-Boot] [RFC] [PATCH V2] arm: arm926ejs: use ELF relocations In-Reply-To: <4CAAEEFC.8080205@denx.de> References: <1286260287-1571-1-git-send-email-albert.aribaud@free.fr> <4CAAEEFC.8080205@denx.de> Message-ID: <4CAAF0C8.5090503@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 05/10/2010 11:25, Heiko Schocher a ?crit : > Following patch works on the tx25 with booting from nand: > > remark !!!! : > > --- a/arch/arm/cpu/arm926ejs/start.S > +++ b/arch/arm/cpu/arm926ejs/start.S > @@ -266,7 +266,7 @@ fixnext: > str r1, [r0] > add r2, r2, #8 /* each rel.dyn entry is 8 bytes */ > cmp r2, r3 > - ble fixloop > + bne fixloop > > Must be discussed/changed, because this fixes just a bug. For this board > my last entry in __rel_dyn_start is filled with 00000000, which results > in crashing code ... The bug you uncovered is -- again -- mine. The 'bne' would loop until r2 equals r3, and as r3 is *right after* the last .rel.dyn entry, it works. Whereas my 'ble' loops until r2 is *greater* than r3, thus it tries to process as a .rel.dyn entry what actually is the 8 bytes that *follow* .rel.dyn. The right opcode (both function and resilient to errors) is 'blo'. Amicalement, -- Albert.