From mboxrd@z Thu Jan 1 00:00:00 1970 From: Schwarz,Andre Date: Sun, 24 Oct 2010 22:08:19 +0200 (CEST) Subject: [U-Boot] [PATCH] powerpc: do not fixup NULL ptrs In-Reply-To: <20101018203948.676071359B3@gemini.denx.de> References: <1287049904-18917-1-git-send-email-Joakim.Tjernlund@transmode.se> <20101018203948.676071359B3@gemini.denx.de> Message-ID: <1702240919.111.1287950899754.JavaMail.open-xchange@proteus> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de All, Wolfgang Denk hat am 18. Oktober 2010 um 22:39 geschrieben: > Dear Joakim Tjernlund, > > In message <1287049904-18917-1-git-send-email-Joakim.Tjernlund@transmode.se> > you wrote: > > 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 > > --- > >? 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(-) > > Applied, thanks.? has anybody ever tested this ? Although it looks obvious and correct this patch is somewhat intrusive and breaks at least two of our (MPC83xx) boards. ? I've asked Joakim already for some clarification : ? http://lists.denx.de/pipermail/u-boot/2010-October/080121.html ? Since I assume Wolfgang won't accept a board specific "add 4 nops after _start"-patch I'd like to solve this without trial and error. ? Of course digging into this is beyond my knowledge and any help would be appreciated. I simply can't think of being the only one having this issue... ? I'm running U-Boot TOT with ELDK-4.2 toolchain. Regards, Andr? MATRIX VISION GmbH, Talstrasse 16, DE-71570 Oppenweiler Registergericht: Amtsgericht Stuttgart, HRB 271090 Geschaeftsfuehrer: Gerhard Thullner, Werner Armingeon, Uwe Furtner