public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] arm: fix exception vectors
@ 2014-12-29 15:10 Luca Ellero
  2015-01-17  6:40 ` Albert ARIBAUD
  0 siblings, 1 reply; 7+ messages in thread
From: Luca Ellero @ 2014-12-29 15:10 UTC (permalink / raw)
  To: u-boot

After relocation, exception vectors still point to the old code (not relocated).
This patch fixes them.

Signed-off-by: Luca Ellero <luca.ellero@brickedbrain.com>
---
 arch/arm/lib/relocate.S |   15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/arch/arm/lib/relocate.S b/arch/arm/lib/relocate.S
index 92f5314..4186344 100644
--- a/arch/arm/lib/relocate.S
+++ b/arch/arm/lib/relocate.S
@@ -76,6 +76,21 @@ copy_loop:
 	blo	copy_loop
 
 	/*
+	 * fix exception vectors
+	 */
+	ldr r2, =_undefined_instruction
+	ldr r3, =_fiq
+	add	r2, r2, r4
+	add	r3, r3, r4
+fix_exceptions:
+	ldr r0, [r2]
+	add	r0, r0, r4
+	str	r0, [r2]
+	cmp r2,r3
+	add r2, #4
+	blo fix_exceptions
+
+	/*
 	 * fix .rel.dyn relocations
 	 */
 	ldr	r2, =__rel_dyn_start	/* r2 <- SRC &__rel_dyn_start */
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-01-20  6:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-29 15:10 [U-Boot] [PATCH] arm: fix exception vectors Luca Ellero
2015-01-17  6:40 ` Albert ARIBAUD
2015-01-19 10:11   ` Luca Ellero
2015-01-19 10:28     ` Albert ARIBAUD
2015-01-19 15:28       ` Luca Ellero
2015-01-19 15:40       ` Bill Pringlemeir
2015-01-20  6:55         ` Albert ARIBAUD

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox