Skip to content

Commit fce01ac

Browse files
npigginmpe
authored andcommitted
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 24d33ac ("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: Nicholas Piggin <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 5567b1e commit fce01ac

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

arch/powerpc/kernel/exceptions-64e.S

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -912,8 +912,14 @@ kernel_dbg_exc:
912912
b interrupt_return
913913

914914
.macro SEARCH_RESTART_TABLE
915+
#ifdef CONFIG_RELOCATABLE
916+
ld r11,PACATOC(r13)
917+
ld r14,__start___restart_table@got(r11)
918+
ld r15,__stop___restart_table@got(r11)
919+
#else
915920
LOAD_REG_IMMEDIATE_SYM(r14, r11, __start___restart_table)
916921
LOAD_REG_IMMEDIATE_SYM(r15, r11, __stop___restart_table)
922+
#endif
917923
300:
918924
cmpd r14,r15
919925
beq 302f
@@ -1329,7 +1335,12 @@ a2_tlbinit_code_start:
13291335
a2_tlbinit_after_linear_map:
13301336

13311337
/* Now we branch the new virtual address mapped by this entry */
1338+
#ifdef CONFIG_RELOCATABLE
1339+
ld r5,PACATOC(r13)
1340+
ld r3,1f@got(r5)
1341+
#else
13321342
LOAD_REG_IMMEDIATE_SYM(r3, r5, 1f)
1343+
#endif
13331344
mtctr r3
13341345
bctr
13351346

0 commit comments

Comments
 (0)