diff options
author | Joakim Tjernlund <Joakim.Tjernlund@transmode.se> | 2010-01-19 14:41:56 +0100 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2010-01-26 19:30:13 +0100 |
commit | 0f8aa159175385ddd77bc91d11b9568583fbbd0c (patch) | |
tree | 5f2bd327b499525805cb7672eb7fca600ea5376e /cpu/ppc4xx | |
parent | fc4e188789b01dc9f18c80869c43fdd7d1a51378 (diff) | |
download | u-boot-imx-0f8aa159175385ddd77bc91d11b9568583fbbd0c.zip u-boot-imx-0f8aa159175385ddd77bc91d11b9568583fbbd0c.tar.gz u-boot-imx-0f8aa159175385ddd77bc91d11b9568583fbbd0c.tar.bz2 |
ppc: Use r12 instead of r14 as GOT pointer.
r14 is not supposed to be clobbered by functions. Switch
to r12 and call GET_GOT when needed. This will allow u-boot
to loose the -ffixed-r14 gcc option.
Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
Diffstat (limited to 'cpu/ppc4xx')
-rw-r--r-- | cpu/ppc4xx/start.S | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/cpu/ppc4xx/start.S b/cpu/ppc4xx/start.S index 2eb21fa..927c88c 100644 --- a/cpu/ppc4xx/start.S +++ b/cpu/ppc4xx/start.S @@ -228,7 +228,7 @@ /* * Set up GOT: Global Offset Table * - * Use r14 to access the GOT + * Use r12 to access the GOT */ #if !defined(CONFIG_NAND_SPL) START_GOT @@ -1489,6 +1489,7 @@ relocate_code: mr r9, r4 /* Save copy of Init Data pointer */ mr r10, r5 /* Save copy of Destination Address */ + GET_GOT mr r3, r5 /* Destination Address */ lis r4, CONFIG_SYS_MONITOR_BASE@h /* Source Address */ ori r4, r4, CONFIG_SYS_MONITOR_BASE@l @@ -1506,7 +1507,7 @@ relocate_code: sub r15, r10, r4 /* First our own GOT */ - add r14, r14, r15 + add r12, r12, r15 /* then the one used by the C code */ add r30, r30, r15 @@ -1571,7 +1572,7 @@ relocate_code: in_ram: /* - * Relocation Function, r14 point to got2+0x8000 + * Relocation Function, r12 point to got2+0x8000 * * Adjust got2 pointers, no need to check for 0, this code * already puts a few entries in the table. @@ -1645,6 +1646,8 @@ clear_bss: */ .globl trap_init trap_init: + mflr r4 /* save link register */ + GET_GOT lwz r7, GOT(_start_of_vectors) lwz r8, GOT(_end_of_vectors) @@ -1652,8 +1655,6 @@ trap_init: cmplw 0, r7, r8 bgelr /* return if r7>=r8 - just in case */ - - mflr r4 /* save link register */ 1: lwz r0, 0(r7) stw r0, 0(r9) |