powerpc/64: switch asm helpers from GOT to TOC relative addressing
authorNicholas Piggin <npiggin@gmail.com>
Mon, 26 Sep 2022 03:40:55 +0000 (13:40 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 28 Sep 2022 09:22:12 +0000 (19:22 +1000)
There is no need to use GOT addressing within the kernel.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220926034057.2360083-4-npiggin@gmail.com
arch/powerpc/boot/ppc_asm.h
arch/powerpc/include/asm/ppc_asm.h

index 2824a3e32aab3ea62a1dc9648d85cde97867b5fb..a66cfd76fa4d245946247aac7e89792badfa8466 100644 (file)
@@ -86,7 +86,8 @@
 
 #ifdef CONFIG_PPC64_BOOT_WRAPPER
 #define LOAD_REG_ADDR(reg,name)                        \
-       ld      reg,name@got(r2)
+       addis   reg,r2,name@toc@ha;             \
+       addi    reg,reg,name@toc@l
 #else
 #define LOAD_REG_ADDR(reg,name)                        \
        lis     reg,name@ha;                    \
index eeb7dc8cd45fc4b36944419edeb475879c55903f..9972f3e90c9dcb89a535b947bcd5969065a08f45 100644 (file)
@@ -337,7 +337,8 @@ n:
        rldimi  reg, tmp, 32, 0
 
 #define LOAD_REG_ADDR(reg,name)                        \
-       ld      reg,name@got(r2)
+       addis   reg,r2,name@toc@ha;             \
+       addi    reg,reg,name@toc@l
 
 #define LOAD_REG_ADDRBASE(reg,name)    LOAD_REG_ADDR(reg,name)
 #define ADDROFF(name)                  0