PowerPC: Add support for -msingle-pic-base
[oweals/u-boot.git] / arch / powerpc / cpu / 74xx_7xx / start.S
index f6011fcaa8c1e654ac13edafa012bc8e2296b072..ab9412ad9e2a1b2d48c096e62c6f4f272fa5898d 100644 (file)
@@ -274,7 +274,11 @@ in_flash:
        stwu    r0, -4(r1)      /* stack backtraces terminate cleanly   */
 
        GET_GOT                 /* initialize GOT access        */
-
+#if defined(__pic__) && __pic__ == 1
+       /* Needed for upcoming -msingle-pic-base */
+       bl      _GLOBAL_OFFSET_TABLE_@local-4
+       mflr    r30
+#endif
        /* run low-level CPU init code     (from Flash) */
        bl      cpu_init_f
        sync
@@ -588,6 +592,11 @@ relocate_code:
        mr      r10, r5         /* Save copy of Destination Address     */
 
        GET_GOT
+#if defined(__pic__) && __pic__ == 1
+       /* Needed for upcoming -msingle-pic-base */
+       bl      _GLOBAL_OFFSET_TABLE_@local-4
+       mflr    r30
+#endif
        mr      r3,  r5                         /* Destination Address  */
        lis     r4, CONFIG_SYS_MONITOR_BASE@h           /* Source      Address  */
        ori     r4, r4, CONFIG_SYS_MONITOR_BASE@l