Skip to content

Commit

Permalink
powerpc/64: Change the way relocation copy is calculated
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Nicholas Piggin authored and Michael Ellerman committed Oct 4, 2016
1 parent be642c3 commit 573819e
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions arch/powerpc/kernel/head_64.S
Original file line number Diff line number Diff line change
@@ -628,11 +628,16 @@ __after_prom_start:
bctr

.balign 8
p_end: .llong _end - _stext
p_end: .llong _end - copy_to_here

4: /* Now copy the rest of the kernel up to _end */
addis r5,r26,(p_end - _stext)@ha
ld r5,(p_end - _stext)@l(r5) /* get _end */
4:
/*
* Now copy the rest of the kernel up to _end, add
* _end - copy_to_here to the copy limit and run again.
*/
addis r8,r26,(p_end - _stext)@ha
ld r8,(p_end - _stext)@l(r8)
add r5,r5,r8
5: bl copy_and_flush /* copy the rest */

9: b start_here_multiplatform

0 comments on commit 573819e

Please sign in to comment.