[PATCH 1/7] powerpc/build: put sys_call_table in .data.rel.ro if RELOCATABLE

Nicholas Piggin npiggin at gmail.com
Thu Sep 15 01:47:40 AEST 2022


Const function pointers live in .data.rel.ro rather than .rodata because
they must be relocated. This change prevents powerpc/32 from generating
R_PPC_UADDR32 relocations (which are not handled). The sys_call_table is
moved to writeable memory, but a later change will move it back.

After this patch, 44x_defconfig + CONFIG_RELOCATABLE boots to busybox.

Signed-off-by: Nicholas Piggin <npiggin at gmail.com>
---
 arch/powerpc/kernel/systbl.S | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/powerpc/kernel/systbl.S b/arch/powerpc/kernel/systbl.S
index cb3358886203..0bec33e86f50 100644
--- a/arch/powerpc/kernel/systbl.S
+++ b/arch/powerpc/kernel/systbl.S
@@ -12,7 +12,11 @@
 
 #include <asm/ppc_asm.h>
 
+#ifdef CONFIG_RELOCATABLE
+.section .data.rel.ro,"aw"
+#else
 .section .rodata,"a"
+#endif
 
 #ifdef CONFIG_PPC64
 	.p2align	3
-- 
2.37.2



More information about the Linuxppc-dev mailing list