]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
powerpc/85xx: fix NAND boot linker scripts for -fpic
authorScott Wood <scottwood@freescale.com>
Tue, 1 May 2012 21:37:57 +0000 (16:37 -0500)
committerScott Wood <scott@tyr.buserror.net>
Fri, 18 May 2012 22:34:39 +0000 (17:34 -0500)
GOT is now handled the way the main u-boot.lds does it.  Without this,
the boot hangs when built with newer GCC (since 4.6).  Older toolchains
hid the issue by converting -fpic to -fPIC.

Signed-off-by: Scott Wood <scottwood@freescale.com>
arch/powerpc/cpu/mpc85xx/u-boot-nand.lds
arch/powerpc/cpu/mpc85xx/u-boot-nand_spl.lds

index b1a1dac16f0f7484bb5c97fca86e453bf37b6ddb..8ba9399169de6d2773e2c01eca286ef407a178ca 100644 (file)
@@ -51,13 +51,14 @@ SECTIONS
   PROVIDE (erotext = .);
   .reloc   :
   {
-    KEEP(*(.got))
     _GOT2_TABLE_ = .;
     KEEP(*(.got2))
+    KEEP(*(.got))
+    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
     _FIXUP_TABLE_ = .;
     KEEP(*(.fixup))
   }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
+  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
   __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
 
   .data    :
index 852f9aa4a392038212175544ecb017fca3ed2087..668158f7029ceae7d43666bd2e448c37d02c6c09 100644 (file)
@@ -37,10 +37,12 @@ SECTIONS
        .reloc : {
                _GOT2_TABLE_ = .;
                KEEP(*(.got2))
+               KEEP(*(.got))
+               PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
                _FIXUP_TABLE_ = .;
                KEEP(*(.fixup))
        }
-       __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
+       __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
        __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
 
        . = ALIGN(8);