]> git.sur5r.net Git - u-boot/commitdiff
Fix alignment error on ARM for modules
authorWoodruff, Richard <r-woodruff2@ti.com>
Fri, 29 Feb 2008 23:34:35 +0000 (17:34 -0600)
committerWolfgang Denk <wd@denx.de>
Sun, 2 Mar 2008 21:48:34 +0000 (22:48 +0100)
Fix alignment fault on ARM when running modules.  With out an explicit
linker file gcc4.2.1 will half word align __bss_start's value.  The word
dereference will crash hello_world.

signed-off-by Richard Woodruff <r-woodruff2@ti.com>

examples/Makefile
examples/stubs.c

index d63fa703232a92af2069e76fd52a006252650e60..60a6f5ea56db319c3d23a74b53fa2ab9734af61d 100644 (file)
@@ -30,8 +30,12 @@ LOAD_ADDR = 0x40000
 endif
 
 ifeq ($(ARCH),arm)
+ifeq ($(BOARD),omap2420h4)
+LOAD_ADDR = 0x80300000
+else
 LOAD_ADDR = 0xc100000
 endif
+endif
 
 ifeq ($(ARCH),mips)
 LOAD_ADDR = 0x80200000 -T mips.lds
index 9b3cadde33f997fd4d3f91ff99444ad738edc8a6..b9dbcf9065b9a8e635f1c1b9f5bcb9b99b391145 100644 (file)
@@ -190,10 +190,10 @@ extern unsigned long __bss_start, _end;
 
 void app_startup(char **argv)
 {
-       unsigned long * cp = &__bss_start;
+       unsigned char * cp = (unsigned char *) &__bss_start;
 
        /* Zero out BSS */
-       while (cp < &_end) {
+       while (cp < (unsigned char *)&_end) {
                *cp++ = 0;
        }