提交 573819e3 编写于 作者: N Nicholas Piggin 提交者: Michael Ellerman

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: NNicholas Piggin <npiggin@gmail.com>
Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
上级 be642c34
...@@ -628,11 +628,16 @@ __after_prom_start: ...@@ -628,11 +628,16 @@ __after_prom_start:
bctr bctr
.balign 8 .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 */ 4:
addis r5,r26,(p_end - _stext)@ha /*
ld r5,(p_end - _stext)@l(r5) /* get _end */ * 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 */ 5: bl copy_and_flush /* copy the rest */
9: b start_here_multiplatform 9: b start_here_multiplatform
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册