]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
relocation: Do not relocate NULL pointers.
authorJoakim Tjernlund <Joakim.Tjernlund@transmode.se>
Thu, 8 Oct 2009 00:03:51 +0000 (02:03 +0200)
committerWolfgang Denk <wd@denx.de>
Thu, 8 Oct 2009 07:33:36 +0000 (09:33 +0200)
NULL is an absolute value and should not be relocated.
After this correction code like:
 void weak_fun(void) __attribute__((weak));
 printf("weak_fun:%p\n", weak_fun);
will still print null after relocation.

Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
12 files changed:
cpu/74xx_7xx/start.S
cpu/mpc512x/start.S
cpu/mpc5xx/start.S
cpu/mpc5xxx/start.S
cpu/mpc8220/start.S
cpu/mpc824x/start.S
cpu/mpc8260/start.S
cpu/mpc83xx/start.S
cpu/mpc85xx/start.S
cpu/mpc86xx/start.S
cpu/mpc8xx/start.S
cpu/ppc4xx/start.S

index 792cd30856621d33c892cf3b3eec72be55482219..23381a35cd768515a2914d29ae8f3a9439e09d83 100644 (file)
@@ -716,15 +716,17 @@ in_ram:
        sub     r11,r3,r11
        addi    r3,r3,-4
 1:     lwzu    r0,4(r3)
+       cmpwi   r0,0
+       beq-    2f
        add     r0,r0,r11
        stw     r0,0(r3)
-       bdnz    1b
+2:     bdnz    1b
 
        /*
         * Now adjust the fixups and the pointers to the fixups
         * in case we need to move ourselves again.
         */
-2:     li      r0,__fixup_entries@sectoff@l
+       li      r0,__fixup_entries@sectoff@l
        lwz     r3,GOT(_FIXUP_TABLE_)
        cmpwi   r0,0
        mtctr   r0
index 2e3f645afbaf5a750bde448f66097701350315ae..4edc8e94d92d55ec231bc3f99553a0f87b32e677 100644 (file)
@@ -611,15 +611,17 @@ in_ram:
        sub     r11,r3,r11
        addi    r3,r3,-4
 1:     lwzu    r0,4(r3)
+       cmpwi   r0,0
+       beq-    2f
        add     r0,r0,r11
        stw     r0,0(r3)
-       bdnz    1b
+2:     bdnz    1b
 
        /*
         * Now adjust the fixups and the pointers to the fixups
         * in case we need to move ourselves again.
         */
-2:     li      r0,__fixup_entries@sectoff@l
+       li      r0,__fixup_entries@sectoff@l
        lwz     r3,GOT(_FIXUP_TABLE_)
        cmpwi   r0,0
        mtctr   r0
index 106935cb6363988944693f1e6e030d1f074dc941..85ea7a88276631cc9ced7d3e699a9fece98e127d 100644 (file)
@@ -458,15 +458,17 @@ in_ram:
        sub     r11,r3,r11
        addi    r3,r3,-4
 1:     lwzu    r0,4(r3)
+       cmpwi   r0,0
+       beq-    2f
        add     r0,r0,r11
        stw     r0,0(r3)
-       bdnz    1b
+2:     bdnz    1b
 
        /*
         * Now adjust the fixups and the pointers to the fixups
         * in case we need to move ourselves again.
         */
-2:     li      r0,__fixup_entries@sectoff@l
+       li      r0,__fixup_entries@sectoff@l
        lwz     r3,GOT(_FIXUP_TABLE_)
        cmpwi   r0,0
        mtctr   r0
index 6b1162aa5ee56360ac87578703bcd1a9ea61d121..eb42939b7b6f504fc0315f7fefc0d36d1d99f5b7 100644 (file)
@@ -684,15 +684,17 @@ in_ram:
        sub     r11,r3,r11
        addi    r3,r3,-4
 1:     lwzu    r0,4(r3)
+       cmpwi   r0,0
+       beq-    2f
        add     r0,r0,r11
        stw     r0,0(r3)
-       bdnz    1b
+2:     bdnz    1b
 
        /*
         * Now adjust the fixups and the pointers to the fixups
         * in case we need to move ourselves again.
         */
-2:     li      r0,__fixup_entries@sectoff@l
+       li      r0,__fixup_entries@sectoff@l
        lwz     r3,GOT(_FIXUP_TABLE_)
        cmpwi   r0,0
        mtctr   r0
index 3abc619269f44e9a24a2fe8fb76252cee68d8063..af9472d6b3d96c3714ffd09e59f7bfcd155fb0b6 100644 (file)
@@ -649,15 +649,17 @@ in_ram:
        sub     r11,r3,r11
        addi    r3,r3,-4
 1:     lwzu    r0,4(r3)
+       cmpwi   r0,0
+       beq-    2f
        add     r0,r0,r11
        stw     r0,0(r3)
-       bdnz    1b
+2:     bdnz    1b
 
        /*
         * Now adjust the fixups and the pointers to the fixups
         * in case we need to move ourselves again.
         */
-2:     li      r0,__fixup_entries@sectoff@l
+       li      r0,__fixup_entries@sectoff@l
        lwz     r3,GOT(_FIXUP_TABLE_)
        cmpwi   r0,0
        mtctr   r0
index 39325cda5b81c282a7f54fbbdd3cc8aefe4a8d16..750457b02ad4ac8ce674574085faf6364ce116b0 100644 (file)
@@ -589,15 +589,17 @@ in_ram:
        sub     r11,r3,r11
        addi    r3,r3,-4
 1:     lwzu    r0,4(r3)
+       cmpwi   r0,0
+       beq-    2f
        add     r0,r0,r11
        stw     r0,0(r3)
-       bdnz    1b
+2:     bdnz    1b
 
        /*
         * Now adjust the fixups and the pointers to the fixups
         * in case we need to move ourselves again.
         */
-2:     li      r0,__fixup_entries@sectoff@l
+       li      r0,__fixup_entries@sectoff@l
        lwz     r3,GOT(_FIXUP_TABLE_)
        cmpwi   r0,0
        mtctr   r0
index 379f2fb1753548c8466912978596067676422143..edb95e6a62aa2b8ac1533d337f51731dbb9eaa3a 100644 (file)
@@ -909,15 +909,17 @@ in_ram:
        sub     r11,r3,r11
        addi    r3,r3,-4
 1:     lwzu    r0,4(r3)
+       cmpwi   r0,0
+       beq-    2f
        add     r0,r0,r11
        stw     r0,0(r3)
-       bdnz    1b
+2:     bdnz    1b
 
        /*
         * Now adjust the fixups and the pointers to the fixups
         * in case we need to move ourselves again.
         */
-2:     li      r0,__fixup_entries@sectoff@l
+       li      r0,__fixup_entries@sectoff@l
        lwz     r3,GOT(_FIXUP_TABLE_)
        cmpwi   r0,0
        mtctr   r0
index 26e31061f41f268ecf65cdc082398fd844aa10ea..ee4b8624aaa58bdf47a9742ae9b25cf02b1c17de 100644 (file)
@@ -957,16 +957,18 @@ in_ram:
        sub     r11,r3,r11
        addi    r3,r3,-4
 1:     lwzu    r0,4(r3)
+       cmpwi   r0,0
+       beq-    2f
        add     r0,r0,r11
        stw     r0,0(r3)
-       bdnz    1b
+2:     bdnz    1b
 
 #ifndef CONFIG_NAND_SPL
        /*
         * Now adjust the fixups and the pointers to the fixups
         * in case we need to move ourselves again.
         */
-2:     li      r0,__fixup_entries@sectoff@l
+       li      r0,__fixup_entries@sectoff@l
        lwz     r3,GOT(_FIXUP_TABLE_)
        cmpwi   r0,0
        mtctr   r0
index c9e91a90da696cfa4b22b11ce12b94106bfdd76f..6a865283d484a5a00fddb6b69aa9d8c30320d9ca 100644 (file)
@@ -977,15 +977,17 @@ in_ram:
        sub     r11,r3,r11
        addi    r3,r3,-4
 1:     lwzu    r0,4(r3)
+       cmpwi   r0,0
+       beq-    2f
        add     r0,r0,r11
        stw     r0,0(r3)
-       bdnz    1b
+2:     bdnz    1b
 
        /*
         * Now adjust the fixups and the pointers to the fixups
         * in case we need to move ourselves again.
         */
-2:     li      r0,__fixup_entries@sectoff@l
+       li      r0,__fixup_entries@sectoff@l
        lwz     r3,GOT(_FIXUP_TABLE_)
        cmpwi   r0,0
        mtctr   r0
index 63cc8dbcda9ebe0d540d0dc3409056c982d949f1..e65f1c0649ac689b76203746420631c113af0221 100644 (file)
@@ -733,15 +733,17 @@ in_ram:
        sub     r11,r3,r11
        addi    r3,r3,-4
 1:     lwzu    r0,4(r3)
+       cmpwi   r0,0
+       beq-    2f
        add     r0,r0,r11
        stw     r0,0(r3)
-       bdnz    1b
+2:     bdnz    1b
 
        /*
         * Now adjust the fixups and the pointers to the fixups
         * in case we need to move ourselves again.
         */
-2:     li      r0,__fixup_entries@sectoff@l
+       li      r0,__fixup_entries@sectoff@l
        lwz     r3,GOT(_FIXUP_TABLE_)
        cmpwi   r0,0
        mtctr   r0
index 8864c37cf65468467072b54e3375050de942be80..e84326ebdc5518c18068c16df7bbb3d37fd91abd 100644 (file)
@@ -589,15 +589,17 @@ in_ram:
        sub     r11,r3,r11
        addi    r3,r3,-4
 1:     lwzu    r0,4(r3)
+       cmpwi   r0,0
+       beq-    2f
        add     r0,r0,r11
        stw     r0,0(r3)
-       bdnz    1b
+2:     bdnz    1b
 
        /*
         * Now adjust the fixups and the pointers to the fixups
         * in case we need to move ourselves again.
         */
-2:     li      r0,__fixup_entries@sectoff@l
+       li      r0,__fixup_entries@sectoff@l
        lwz     r3,GOT(_FIXUP_TABLE_)
        cmpwi   r0,0
        mtctr   r0
index 287a912246a855ae8ca91e1cd6d2fe867466e030..46f65aa779b1fb0711bdd14b8cc38186d8fcc98e 100644 (file)
@@ -1596,15 +1596,17 @@ in_ram:
        sub     r11,r3,r11
        addi    r3,r3,-4
 1:     lwzu    r0,4(r3)
+       cmpwi   r0,0
+       beq-    2f
        add     r0,r0,r11
        stw     r0,0(r3)
-       bdnz    1b
+2:     bdnz    1b
 
        /*
         * Now adjust the fixups and the pointers to the fixups
         * in case we need to move ourselves again.
         */
-2:     li      r0,__fixup_entries@sectoff@l
+       li      r0,__fixup_entries@sectoff@l
        lwz     r3,GOT(_FIXUP_TABLE_)
        cmpwi   r0,0
        mtctr   r0