about summary refs log tree commit diff
path: root/sysdeps/nptl
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2024-07-08 21:14:00 +0200
committerFlorian Weimer <fweimer@redhat.com>2024-07-16 16:35:29 +0200
commite8f521709731ce3ae8d6f1eca30135d5c0606f02 (patch)
tree8ff191e039b2bde1fb55acc7c7003a2b11aa4f92 /sysdeps/nptl
parent143a7a06235cf091b63f58a739c8367ffe54a722 (diff)
downloadglibc-e8f521709731ce3ae8d6f1eca30135d5c0606f02.tar.gz
glibc-e8f521709731ce3ae8d6f1eca30135d5c0606f02.tar.xz
glibc-e8f521709731ce3ae8d6f1eca30135d5c0606f02.zip
Linux: Make __rseq_size useful for feature detection (bug 31965)
The __rseq_size value is now the active area of struct rseq
(so 20 initially), not the full struct size including padding
at the end (32 initially).

Update misc/tst-rseq to print some additional diagnostics.

Reviewed-by: Michael Jeanson <mjeanson@efficios.com>
Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
(cherry picked from commit 2e456ccf0c34a056e3ccafac4a0c7effef14d918)
Diffstat (limited to 'sysdeps/nptl')
-rw-r--r--sysdeps/nptl/dl-tls_init_tp.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/sysdeps/nptl/dl-tls_init_tp.c b/sysdeps/nptl/dl-tls_init_tp.c
index 7eb35fb133..7803e19fd1 100644
--- a/sysdeps/nptl/dl-tls_init_tp.c
+++ b/sysdeps/nptl/dl-tls_init_tp.c
@@ -46,10 +46,6 @@ rtld_mutex_dummy (pthread_mutex_t *lock)
 
 const unsigned int __rseq_flags;
 
-/* The variables are in .data.relro but are not yet write-protected.  */
-extern unsigned int _rseq_size attribute_hidden;
-extern ptrdiff_t _rseq_offset attribute_hidden;
-
 void
 __tls_pre_init_tp (void)
 {
@@ -106,9 +102,7 @@ __tls_init_tp (void)
     bool do_rseq = true;
     do_rseq = TUNABLE_GET (rseq, int, NULL);
     if (rseq_register_current_thread (pd, do_rseq))
-      {
-        _rseq_size = sizeof (pd->rseq_area);
-      }
+      _rseq_size = RSEQ_AREA_SIZE_INITIAL_USED;
 
 #ifdef RSEQ_SIG
     /* This should be a compile-time constant, but the current