[PATCH] tools/nolibc/powerpc: mark ctr and xer as clobbered by system call

From: Thomas Weißschuh

Date: Mon Jul 27 2026 - 11:26:29 EST


The system call can clobber the ctr and xer registers.

Make sure the compiler takes this into account.

The missing clobbers only seem to be an issue with newer compilers.

Fixes: 0cb0675ec37e ("tools/nolibc: add support for powerpc")
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@xxxxxxxxxxxxx>
---
tools/include/nolibc/arch-powerpc.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/include/nolibc/arch-powerpc.h b/tools/include/nolibc/arch-powerpc.h
index a1ab91d55384..dbe2e5205aaa 100644
--- a/tools/include/nolibc/arch-powerpc.h
+++ b/tools/include/nolibc/arch-powerpc.h
@@ -26,7 +26,7 @@
*/

#define _NOLIBC_SYSCALL_CLOBBERLIST \
- "memory", "cr0", "r12", "r11", "r10", "r9"
+ "memory", "cr0", "ctr", "xer", "r12", "r11", "r10", "r9"

#define __nolibc_syscall0(num) \
({ \

---
base-commit: dc59e4fea9d83f03bad6bddf3fa2e52491777482
change-id: 20260727-nolibc-powerpc-clobber-dd9c1686a95b

Best regards,
--
Thomas Weißschuh <thomas.weissschuh@xxxxxxxxxxxxx>