]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
s390: Define TLS_DTV_OFFSET instead of GET_ADDR_OFFSET
authorFlorian Weimer <fweimer@redhat.com>
Thu, 2 Jan 2025 12:45:27 +0000 (13:45 +0100)
committerFlorian Weimer <fweimer@redhat.com>
Thu, 2 Jan 2025 12:45:27 +0000 (13:45 +0100)
This will be used in __tls_get_addr to adjust the returned pointer
value.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
sysdeps/s390/dl-tls.h

index a5c18a6892692684dcfa5f97956d9cce97548a76..74756ddf05b350f058f093be026f0327ab49968a 100644 (file)
@@ -24,6 +24,9 @@ typedef struct
   unsigned long int ti_offset;
 } tls_index;
 
+/* The DTV stores absolute addresses, but __tls_get_addr must return
+   TP-relative addresses.  */
+#define TLS_DTV_OFFSET (-(unsigned long int) __builtin_thread_pointer ())
 
 #ifdef SHARED
 
@@ -89,9 +92,6 @@ __tls_get_offset:\n\
 extern void *__tls_get_addr_internal (tls_index *ti);
 # endif /* !IS_IN (rtld) */
 
-# define GET_ADDR_OFFSET \
-  (ti->ti_offset - (unsigned long) __builtin_thread_pointer ())
-
 /* Use the privately exported __tls_get_addr_internal instead of
    __tls_get_offset in order to avoid the __tls_get_offset special
    linkage requiring the GOT pointer to be set up in r12.  The