Commit fce01acf authored by Nicholas Piggin's avatar Nicholas Piggin Committed by Michael Ellerman

powerpc/64e: fix CONFIG_RELOCATABLE build warnings

CONFIG_RELOCATABLE=y causes build warnings from unresolved relocations.
Fix these by using TOC addressing for these cases.

Commit 24d33ac5 ("powerpc/64s: Make prom_init require RELOCATABLE")
caused some 64e configs to select RELOCATABLE resulting in these
warnings, but the underlying issue was already there.

This passes basic qemu testing.
Signed-off-by: default avatarNicholas Piggin <npiggin@gmail.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210630074621.2109197-3-npiggin@gmail.com
parent 5567b1ee
...@@ -912,8 +912,14 @@ kernel_dbg_exc: ...@@ -912,8 +912,14 @@ kernel_dbg_exc:
b interrupt_return b interrupt_return
.macro SEARCH_RESTART_TABLE .macro SEARCH_RESTART_TABLE
#ifdef CONFIG_RELOCATABLE
ld r11,PACATOC(r13)
ld r14,__start___restart_table@got(r11)
ld r15,__stop___restart_table@got(r11)
#else
LOAD_REG_IMMEDIATE_SYM(r14, r11, __start___restart_table) LOAD_REG_IMMEDIATE_SYM(r14, r11, __start___restart_table)
LOAD_REG_IMMEDIATE_SYM(r15, r11, __stop___restart_table) LOAD_REG_IMMEDIATE_SYM(r15, r11, __stop___restart_table)
#endif
300: 300:
cmpd r14,r15 cmpd r14,r15
beq 302f beq 302f
...@@ -1329,7 +1335,12 @@ a2_tlbinit_code_start: ...@@ -1329,7 +1335,12 @@ a2_tlbinit_code_start:
a2_tlbinit_after_linear_map: a2_tlbinit_after_linear_map:
/* Now we branch the new virtual address mapped by this entry */ /* Now we branch the new virtual address mapped by this entry */
#ifdef CONFIG_RELOCATABLE
ld r5,PACATOC(r13)
ld r3,1f@got(r5)
#else
LOAD_REG_IMMEDIATE_SYM(r3, r5, 1f) LOAD_REG_IMMEDIATE_SYM(r3, r5, 1f)
#endif
mtctr r3 mtctr r3
bctr bctr
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment