Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc/64: switch asm helpers from GOT to TOC relative addressing

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

authored by

Nicholas Piggin and committed by
Michael Ellerman
754f6117 dab3b8f4

+4 -2
+2 -1
arch/powerpc/boot/ppc_asm.h
··· 86 86 87 87 #ifdef CONFIG_PPC64_BOOT_WRAPPER 88 88 #define LOAD_REG_ADDR(reg,name) \ 89 - ld reg,name@got(r2) 89 + addis reg,r2,name@toc@ha; \ 90 + addi reg,reg,name@toc@l 90 91 #else 91 92 #define LOAD_REG_ADDR(reg,name) \ 92 93 lis reg,name@ha; \
+2 -1
arch/powerpc/include/asm/ppc_asm.h
··· 337 337 rldimi reg, tmp, 32, 0 338 338 339 339 #define LOAD_REG_ADDR(reg,name) \ 340 - ld reg,name@got(r2) 340 + addis reg,r2,name@toc@ha; \ 341 + addi reg,reg,name@toc@l 341 342 342 343 #define LOAD_REG_ADDRBASE(reg,name) LOAD_REG_ADDR(reg,name) 343 344 #define ADDROFF(name) 0