]> git.sur5r.net Git - u-boot/blobdiff - arch/powerpc/cpu/mpc85xx/u-boot-nand.lds
powerpc/85xx: fix NAND boot linker scripts for -fpic
[u-boot] / arch / powerpc / cpu / mpc85xx / u-boot-nand.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    :