commit b3d9b0e3f6bab5d662ec385cf754872f8a90607f (tree)
parent f77e1b86225cd49c2d04dfa6ca4a7ede315dc0b1
Author: Alex Rønne Petersen <alex@alexrp.com>
Date: Fri, 24 Jan 2025 06:15:46 +0100
musl: Manually inline __tls_get_addr into s390x __tls_get_offset.
See these mailing list threads:
* https://www.openwall.com/lists/musl/2024/11/23/3
* https://www.openwall.com/lists/musl/2025/01/24/1
This supplants cc73d7ad749df8d53da442faa2e7af5d69357b33.
Diffstat:
1 file changed, 10 insertions(+), 11 deletions(-)
diff --git a/lib/libc/musl/src/thread/s390x/__tls_get_offset.s b/lib/libc/musl/src/thread/s390x/__tls_get_offset.s
@@ -1,18 +1,17 @@
.global __tls_get_offset
.type __tls_get_offset,%function
__tls_get_offset:
- stmg %r14, %r15, 112(%r15)
- aghi %r15, -160
+ ear %r0, %a0
+ sllg %r0, %r0, 32
+ ear %r0, %a1
- la %r2, 0(%r2, %r12)
-.hidden __tls_get_addr
- brasl %r14, __tls_get_addr
+ la %r1, 0(%r2, %r12)
- ear %r1, %a0
- sllg %r1, %r1, 32
- ear %r1, %a1
+ lg %r3, 0(%r1)
+ sllg %r4, %r3, 3
+ lg %r5, 8(%r0)
+ lg %r2, 0(%r4, %r5)
+ ag %r2, 8(%r1)
+ sgr %r2, %r0
- sgr %r2, %r1
-
- lmg %r14, %r15, 272(%r15)
br %r14