diff options
author | Nicholas Piggin <npiggin@gmail.com> | 2016-09-27 21:31:47 -0400 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2016-10-03 22:06:55 -0400 |
commit | 573819e3433278cde17e7b93e101e59e96f19ccf (patch) | |
tree | 475f117ca37f5045a820569c40a054cb9ad68b68 | |
parent | be642c3457e75983be6f1f4bddcc77c9e2ed4650 (diff) |
powerpc/64: Change the way relocation copy is calculated
With a subsequent patch to put text into different sections,
(_end - _stext) can no longer be computed at link time to determine
the end of the copy. Instead, calculate it at runtime with
(copy_to_here - _stext) + (_end - copy_to_here).
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
-rw-r--r-- | arch/powerpc/kernel/head_64.S | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S index f765b0434731..6e21812ee672 100644 --- a/arch/powerpc/kernel/head_64.S +++ b/arch/powerpc/kernel/head_64.S | |||
@@ -628,11 +628,16 @@ __after_prom_start: | |||
628 | bctr | 628 | bctr |
629 | 629 | ||
630 | .balign 8 | 630 | .balign 8 |
631 | p_end: .llong _end - _stext | 631 | p_end: .llong _end - copy_to_here |
632 | 632 | ||
633 | 4: /* Now copy the rest of the kernel up to _end */ | 633 | 4: |
634 | addis r5,r26,(p_end - _stext)@ha | 634 | /* |
635 | ld r5,(p_end - _stext)@l(r5) /* get _end */ | 635 | * Now copy the rest of the kernel up to _end, add |
636 | * _end - copy_to_here to the copy limit and run again. | ||
637 | */ | ||
638 | addis r8,r26,(p_end - _stext)@ha | ||
639 | ld r8,(p_end - _stext)@l(r8) | ||
640 | add r5,r5,r8 | ||
636 | 5: bl copy_and_flush /* copy the rest */ | 641 | 5: bl copy_and_flush /* copy the rest */ |
637 | 642 | ||
638 | 9: b start_here_multiplatform | 643 | 9: b start_here_multiplatform |