about summary refs log tree commit diff
path: root/arch
diff options
context:
space:
mode:
authorStefan Liebler <stli@linux.ibm.com>2024-10-10 15:02:44 +0200
committerRich Felker <dalias@aerifal.cx>2024-10-11 12:21:35 -0400
commit5be920e9103fb7c7e492af7cd8bf56a71ae0b2c6 (patch)
treee766cdec257e1adc124562506dd64684daad415f /arch
parent2fc56aaa9f660ebd735d1595c3501b792af42eb8 (diff)
downloadmusl-5be920e9103fb7c7e492af7cd8bf56a71ae0b2c6.tar.gz
musl-5be920e9103fb7c7e492af7cd8bf56a71ae0b2c6.tar.xz
musl-5be920e9103fb7c7e492af7cd8bf56a71ae0b2c6.zip
s390x: don't allow br r0 in CRTJMP asm
The instruction encoding that would be "br %r0" is not actually a
branch to r0, but instead a nop/memory-barrier. gcc 14 has been found
to choose r0 for the "r"(pc) constraint, breaking CRTJMP.

This patch adjusts the inline assembly constraints and marks "pc" as
address ("a"), which disallows usage of r0.
Diffstat (limited to 'arch')
-rw-r--r--arch/s390x/reloc.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/s390x/reloc.h b/arch/s390x/reloc.h
index 6e5c1fb8..38de9d9b 100644
--- a/arch/s390x/reloc.h
+++ b/arch/s390x/reloc.h
@@ -10,4 +10,4 @@
 #define REL_TPOFF       R_390_TLS_TPOFF
 
 #define CRTJMP(pc,sp) __asm__ __volatile__( \
-	"lgr %%r15,%1; br %0" : : "r"(pc), "r"(sp) : "memory" )
+	"lgr %%r15,%1; br %0" : : "a"(pc), "r"(sp) : "memory" )