Skip to contentSkip to conversation

powerpc/pseries: move hcall_tracepoint_refcount out of .toc

PATCH Applied Nicholas Piggin 2 participants 2 messages Sep 26, 2022 – Oct 4, 2022 PowerPC

lore
Share & tools
lore

Nicholas Piggin

author reviewer
#0 lore raw

PATCH 1/1 powerpc/pseries: move hcall_tracepoint_refcount out of .toc

The .toc section is not really intended for arbitrary data. Writable data in particular prevents making the TOC read-only after relocation. Move hcall_tracepoint_refcount into the .data section.

---
This is split out from "[v2,2/5] powerpc/64: asm use consistent global variable declaration and access" because another series to make TOC read-only depends on it. This patch decouples the two series.

Thanks,
Nick

 arch/powerpc/platforms/pseries/hvCall.S | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/powerpc/platforms/pseries/hvCall.S +2 -2
index ab9fc6506861..762eb15d3bd4 100644
@@ -16,7 +16,7 @@
 #ifdef CONFIG_TRACEPOINTS
 
 #ifndef CONFIG_JUMP_LABEL
-	.section	".toc","aw"
+	.data
 
 	.globl hcall_tracepoint_refcount
 hcall_tracepoint_refcount:
@@ -88,7 +88,7 @@ hcall_tracepoint_refcount:
 BEGIN_FTR_SECTION;						\
 	b	1f;						\
 END_FTR_SECTION(0, 1);						\
-	ld	r12,hcall_tracepoint_refcount@toc(r2);		\
+	LOAD_REG_ADDR(r12, hcall_tracepoint_refcount) ;		\
 	std	r12,32(r1);					\
 	cmpdi	r12,0;						\
 	bne-	LABEL;						\
Signature · 1 line
2.37.2