PowerPC: Add relocation support for -fpic
[oweals/u-boot.git] / arch / powerpc / cpu / mpc8260 / u-boot.lds
index ad2ce37f1bcae0243e94e30234c8e8366f34cc64..c76555ef80cb14e7b801aa73a53e85804e91ba1e 100644 (file)
@@ -40,13 +40,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    :