PowerPC: Add support for -msingle-pic-base
[oweals/u-boot.git] / arch / powerpc / cpu / mpc5xx / u-boot.lds
index b7fd4bc3a732756d1f903e201b88f53a4d4ec5e7..e02b213d28ef3f52cfb4b005aa6504f81a215678 100644 (file)
@@ -46,13 +46,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    :
@@ -90,7 +91,7 @@ SECTIONS
    . = ALIGN(4);
   }
 
-  _end = . ;
+  __bss_end__ = . ;
   PROVIDE (end = .);
   . = env_start;
   .ppcenv :