All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] powerpc: do not fixup NULL ptrs
@ 2010-10-14  9:51 Joakim Tjernlund
  2010-10-18 20:39 ` Wolfgang Denk
  0 siblings, 1 reply; 43+ messages in thread
From: Joakim Tjernlund @ 2010-10-14  9:51 UTC (permalink / raw)
  To: u-boot

The fixup routine must not fixup NULL pointers.
Problem can be seen by
 char *testfun(void) __attribute__((weak));
 char *(*myfun)(void) = testfun;

Then add
  printf("myfun:%p, &myfun:%p\n", myfun, &myfun);
before relocation and after relocation.
myfun should be NULL in both cases but it is not.

Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
---
 arch/powerpc/cpu/74xx_7xx/start.S |    4 +++-
 arch/powerpc/cpu/mpc512x/start.S  |    4 +++-
 arch/powerpc/cpu/mpc5xx/start.S   |    4 +++-
 arch/powerpc/cpu/mpc5xxx/start.S  |    4 +++-
 arch/powerpc/cpu/mpc8220/start.S  |    4 +++-
 arch/powerpc/cpu/mpc824x/start.S  |    4 +++-
 arch/powerpc/cpu/mpc8260/start.S  |    4 +++-
 arch/powerpc/cpu/mpc83xx/start.S  |    4 +++-
 arch/powerpc/cpu/mpc85xx/start.S  |    4 +++-
 arch/powerpc/cpu/mpc86xx/start.S  |    4 +++-
 arch/powerpc/cpu/mpc8xx/start.S   |    4 +++-
 arch/powerpc/cpu/ppc4xx/start.S   |    4 +++-
 12 files changed, 36 insertions(+), 12 deletions(-)

diff --git a/arch/powerpc/cpu/74xx_7xx/start.S b/arch/powerpc/cpu/74xx_7xx/start.S
index 88fdf88..ce0fa3d 100644
--- a/arch/powerpc/cpu/74xx_7xx/start.S
+++ b/arch/powerpc/cpu/74xx_7xx/start.S
@@ -722,10 +722,12 @@ in_ram:
 	beq	4f
 3:	lwzu	r4,4(r3)
 	lwzux	r0,r4,r11
+	cmpwi	r0,0
 	add	r0,r0,r11
 	stw	r10,0(r3)
+	beq-	5f
 	stw	r0,0(r4)
-	bdnz	3b
+5:	bdnz	3b
 4:
 /* clear_bss: */
 	/*
diff --git a/arch/powerpc/cpu/mpc512x/start.S b/arch/powerpc/cpu/mpc512x/start.S
index d26b617..64eb657 100644
--- a/arch/powerpc/cpu/mpc512x/start.S
+++ b/arch/powerpc/cpu/mpc512x/start.S
@@ -615,10 +615,12 @@ in_ram:
 	beq	4f
 3:	lwzu	r4,4(r3)
 	lwzux	r0,r4,r11
+	cmpwi	r0,0
 	add	r0,r0,r11
 	stw	r10,0(r3)
+	beq-	5f
 	stw	r0,0(r4)
-	bdnz	3b
+5:	bdnz	3b
 4:
 clear_bss:
 	/*
diff --git a/arch/powerpc/cpu/mpc5xx/start.S b/arch/powerpc/cpu/mpc5xx/start.S
index 0af879e..560c706 100644
--- a/arch/powerpc/cpu/mpc5xx/start.S
+++ b/arch/powerpc/cpu/mpc5xx/start.S
@@ -464,10 +464,12 @@ in_ram:
 	beq	4f
 3:	lwzu	r4,4(r3)
 	lwzux	r0,r4,r11
+	cmpwi	r0,0
 	add	r0,r0,r11
 	stw	r10,0(r3)
+	beq-	5f
 	stw	r0,0(r4)
-	bdnz	3b
+5:	bdnz	3b
 4:
 clear_bss:
 	/*
diff --git a/arch/powerpc/cpu/mpc5xxx/start.S b/arch/powerpc/cpu/mpc5xxx/start.S
index 8b9f09b..b8c1cb5 100644
--- a/arch/powerpc/cpu/mpc5xxx/start.S
+++ b/arch/powerpc/cpu/mpc5xxx/start.S
@@ -680,10 +680,12 @@ in_ram:
 	beq	4f
 3:	lwzu	r4,4(r3)
 	lwzux	r0,r4,r11
+	cmpwi	r0,0
 	add	r0,r0,r11
 	stw	r10,0(r3)
+	beq-	5f
 	stw	r0,0(r4)
-	bdnz	3b
+5:	bdnz	3b
 4:
 clear_bss:
 	/*
diff --git a/arch/powerpc/cpu/mpc8220/start.S b/arch/powerpc/cpu/mpc8220/start.S
index 3d79d8e..6b63821 100644
--- a/arch/powerpc/cpu/mpc8220/start.S
+++ b/arch/powerpc/cpu/mpc8220/start.S
@@ -653,10 +653,12 @@ in_ram:
 	beq	4f
 3:	lwzu	r4,4(r3)
 	lwzux	r0,r4,r11
+	cmpwi	r0,0
 	add	r0,r0,r11
 	stw	r10,0(r3)
+	beq-	5f
 	stw	r0,0(r4)
-	bdnz	3b
+5:	bdnz	3b
 4:
 clear_bss:
 	/*
diff --git a/arch/powerpc/cpu/mpc824x/start.S b/arch/powerpc/cpu/mpc824x/start.S
index f3f595a..a32e68b 100644
--- a/arch/powerpc/cpu/mpc824x/start.S
+++ b/arch/powerpc/cpu/mpc824x/start.S
@@ -595,10 +595,12 @@ in_ram:
 	beq	4f
 3:	lwzu	r4,4(r3)
 	lwzux	r0,r4,r11
+	cmpwi	r0,0
 	add	r0,r0,r11
 	stw	r10,0(r3)
+	beq-	5f
 	stw	r0,0(r4)
-	bdnz	3b
+5:	bdnz	3b
 4:
 clear_bss:
 	/*
diff --git a/arch/powerpc/cpu/mpc8260/start.S b/arch/powerpc/cpu/mpc8260/start.S
index a435042..5c2e251 100644
--- a/arch/powerpc/cpu/mpc8260/start.S
+++ b/arch/powerpc/cpu/mpc8260/start.S
@@ -915,10 +915,12 @@ in_ram:
 	beq	4f
 3:	lwzu	r4,4(r3)
 	lwzux	r0,r4,r11
+	cmpwi	r0,0
 	add	r0,r0,r11
 	stw	r10,0(r3)
+	beq-	5f
 	stw	r0,0(r4)
-	bdnz	3b
+5:	bdnz	3b
 4:
 clear_bss:
 	/*
diff --git a/arch/powerpc/cpu/mpc83xx/start.S b/arch/powerpc/cpu/mpc83xx/start.S
index c9bb0ea..e8b1ebc 100644
--- a/arch/powerpc/cpu/mpc83xx/start.S
+++ b/arch/powerpc/cpu/mpc83xx/start.S
@@ -986,10 +986,12 @@ in_ram:
 	beq	4f
 3:	lwzu	r4,4(r3)
 	lwzux	r0,r4,r11
+	cmpwi	r0,0
 	add	r0,r0,r11
 	stw	r10,0(r3)
+	beq-	5f
 	stw	r0,0(r4)
-	bdnz	3b
+5:	bdnz	3b
 4:
 #endif
 
diff --git a/arch/powerpc/cpu/mpc85xx/start.S b/arch/powerpc/cpu/mpc85xx/start.S
index b3cb56a..19e9735 100644
--- a/arch/powerpc/cpu/mpc85xx/start.S
+++ b/arch/powerpc/cpu/mpc85xx/start.S
@@ -1025,10 +1025,12 @@ in_ram:
 	beq	4f
 3:	lwzu	r4,4(r3)
 	lwzux	r0,r4,r11
+	cmpwi	r0,0
 	add	r0,r0,r11
 	stw	r10,0(r3)
+	beq-	5f
 	stw	r0,0(r4)
-	bdnz	3b
+5:	bdnz	3b
 4:
 clear_bss:
 	/*
diff --git a/arch/powerpc/cpu/mpc86xx/start.S b/arch/powerpc/cpu/mpc86xx/start.S
index ed1e4ca..3f05e53 100644
--- a/arch/powerpc/cpu/mpc86xx/start.S
+++ b/arch/powerpc/cpu/mpc86xx/start.S
@@ -739,10 +739,12 @@ in_ram:
 	beq	4f
 3:	lwzu	r4,4(r3)
 	lwzux	r0,r4,r11
+	cmpwi	r0,0
 	add	r0,r0,r11
 	stw	r10,0(r3)
+	beq-	5f
 	stw	r0,0(r4)
-	bdnz	3b
+5:	bdnz	3b
 4:
 /* clear_bss: */
 	/*
diff --git a/arch/powerpc/cpu/mpc8xx/start.S b/arch/powerpc/cpu/mpc8xx/start.S
index 7cf602f..1b729eb 100644
--- a/arch/powerpc/cpu/mpc8xx/start.S
+++ b/arch/powerpc/cpu/mpc8xx/start.S
@@ -595,10 +595,12 @@ in_ram:
 	beq	4f
 3:	lwzu	r4,4(r3)
 	lwzux	r0,r4,r11
+	cmpwi	r0,0
 	add	r0,r0,r11
 	stw	r10,0(r3)
+	beq-	5f
 	stw	r0,0(r4)
-	bdnz	3b
+5:	bdnz	3b
 4:
 clear_bss:
 	/*
diff --git a/arch/powerpc/cpu/ppc4xx/start.S b/arch/powerpc/cpu/ppc4xx/start.S
index c739deb..27709c4 100644
--- a/arch/powerpc/cpu/ppc4xx/start.S
+++ b/arch/powerpc/cpu/ppc4xx/start.S
@@ -1602,10 +1602,12 @@ in_ram:
 	beq	4f
 3:	lwzu	r4,4(r3)
 	lwzux	r0,r4,r11
+	cmpwi	r0,0
 	add	r0,r0,r11
 	stw	r10,0(r3)
+	beq-	5f
 	stw	r0,0(r4)
-	bdnz	3b
+5:	bdnz	3b
 4:
 clear_bss:
 	/*
-- 
1.7.2.2

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

end of thread, other threads:[~2010-11-04 16:53 UTC | newest]

Thread overview: 43+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-14  9:51 [U-Boot] [PATCH] powerpc: do not fixup NULL ptrs Joakim Tjernlund
2010-10-18 20:39 ` Wolfgang Denk
2010-10-24 20:08   ` Schwarz, Andre
2010-10-24 20:18     ` Wolfgang Denk
2010-10-24 20:33       ` Schwarz, Andre
2010-10-24 20:48         ` Joakim Tjernlund
2010-10-25  8:24           ` Schwarz, Andre
2010-10-25 13:50           ` Andre Schwarz
2010-10-25 14:32             ` Joakim Tjernlund
2010-10-25 14:46               ` Andre Schwarz
2010-10-25 15:36                 ` Joakim Tjernlund
2010-10-25 17:16             ` Wolfgang Denk
2010-10-25 17:45               ` Andre Schwarz
2010-10-25 19:14                 ` Wolfgang Denk
2010-10-26 10:28                   ` Andre Schwarz
2010-10-26 12:34                   ` Andre Schwarz
2010-10-26 12:49                     ` Joakim Tjernlund
2010-11-04  9:10             ` Joakim Tjernlund
2010-11-04  9:57               ` Wolfgang Denk
2010-11-04 10:47                 ` Joakim Tjernlund
2010-11-04 10:54                   ` Joakim Tjernlund
2010-11-04 11:16                     ` Wolfgang Denk
2010-11-04 12:19                       ` Joakim Tjernlund
2010-11-04 12:46                         ` Wolfgang Denk
2010-11-04 12:58                           ` Joakim Tjernlund
2010-11-04 13:07                             ` Wolfgang Denk
2010-11-04 13:11                               ` Joakim Tjernlund
2010-11-04 10:58                   ` Andy Pont
2010-11-04 11:04                     ` Joakim Tjernlund
2010-11-04 12:14                     ` Andre Schwarz
2010-11-04 12:18                       ` Joakim Tjernlund
2010-11-04 12:28                         ` Andre Schwarz
     [not found]                           ` <OF350A930F.C39462D9-ONC <4CD2B5DF.2080400@matrix-vision.de>
2010-11-04 13:01                           ` Joakim Tjernlund
2010-11-04 13:32                             ` Andre Schwarz
2010-11-04 14:06                               ` Joakim Tjernlund
2010-11-04 14:49                                 ` Andre Schwarz
2010-11-04 15:10                                   ` Joakim Tjernlund
2010-11-04 16:53                                     ` Andre Schwarz
2010-11-04 10:59                   ` Reinhard Meyer
2010-11-04 10:00               ` Andre Schwarz
2010-11-04  9:50             ` Wolfgang Denk
2010-11-04 10:21               ` Joakim Tjernlund
2010-10-24 20:44       ` Joakim Tjernlund

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.