diff options
Diffstat (limited to 'arch/powerpc/boot/crt0.S')
-rw-r--r-- | arch/powerpc/boot/crt0.S | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/arch/powerpc/boot/crt0.S b/arch/powerpc/boot/crt0.S index d2f2ace56cd..e0192c26037 100644 --- a/arch/powerpc/boot/crt0.S +++ b/arch/powerpc/boot/crt0.S | |||
@@ -12,17 +12,23 @@ | |||
12 | #include "ppc_asm.h" | 12 | #include "ppc_asm.h" |
13 | 13 | ||
14 | .text | 14 | .text |
15 | /* a procedure descriptor used when booting this as a COFF file */ | ||
16 | _zimage_start_opd: | ||
17 | .long _zimage_start, 0, 0, 0 | ||
18 | |||
15 | .globl _zimage_start | 19 | .globl _zimage_start |
16 | _zimage_start: | 20 | _zimage_start: |
21 | /* Work out the offset between the address we were linked at | ||
22 | and the address where we're running. */ | ||
17 | bl 1f | 23 | bl 1f |
18 | 24 | 1: mflr r0 | |
19 | 1: | ||
20 | mflr r0 | ||
21 | lis r9,1b@ha | 25 | lis r9,1b@ha |
22 | addi r9,r9,1b@l | 26 | addi r9,r9,1b@l |
23 | subf. r0,r9,r0 | 27 | subf. r0,r9,r0 |
24 | beq 3f | 28 | beq 3f /* if running at same address as linked */ |
25 | 29 | ||
30 | /* The .got2 section contains a list of addresses, so add | ||
31 | the address offset onto each entry. */ | ||
26 | lis r9,__got2_start@ha | 32 | lis r9,__got2_start@ha |
27 | addi r9,r9,__got2_start@l | 33 | addi r9,r9,__got2_start@l |
28 | lis r8,__got2_end@ha | 34 | lis r8,__got2_end@ha |
@@ -32,15 +38,14 @@ _zimage_start: | |||
32 | srwi. r8,r8,2 | 38 | srwi. r8,r8,2 |
33 | mtctr r8 | 39 | mtctr r8 |
34 | add r9,r0,r9 | 40 | add r9,r0,r9 |
35 | 2: | 41 | 2: lwz r8,0(r9) |
36 | lwz r8,0(r9) | ||
37 | add r8,r8,r0 | 42 | add r8,r8,r0 |
38 | stw r8,0(r9) | 43 | stw r8,0(r9) |
39 | addi r9,r9,4 | 44 | addi r9,r9,4 |
40 | bdnz 2b | 45 | bdnz 2b |
41 | 46 | ||
42 | 3: | 47 | /* Do a cache flush for our text, in case OF didn't */ |
43 | lis r9,_start@h | 48 | 3: lis r9,_start@h |
44 | add r9,r0,r9 | 49 | add r9,r0,r9 |
45 | lis r8,_etext@ha | 50 | lis r8,_etext@ha |
46 | addi r8,r8,_etext@l | 51 | addi r8,r8,_etext@l |