Le 19/09/2022 à 16:01, Nicholas Piggin a écrit :
Use asm helpers to access global variables and to define them in asm.
Stop using got addressing and use the more common @toc offsets. 32-bit
already does this so that should be unchanged.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
quoted hunk ↗ jump to hunk
diff --git a/arch/powerpc/boot/ppc_asm.h b/arch/powerpc/boot/ppc_asm.h
index 192b97523b05..ea290bf78fb2 100644
--- a/arch/powerpc/boot/ppc_asm.h
+++ b/arch/powerpc/boot/ppc_asm.h
@@ -84,4 +84,8 @@
#define MFTBU(dest) mfspr dest, SPRN_TBRU
#endif
+#define LOAD_REG_ADDR(reg,name) \
+ addis reg,r2,name@toc@ha; \
+ addi reg,reg,name@toc@l
+
#endif /* _PPC64_PPC_ASM_H */
Wouldn't it be better as a GAS macro ?