aboutsummaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
authorMichael Jeanson <mjeanson@efficios.com>2024-07-10 15:48:11 -0400
committerMichael Jeanson <mjeanson@efficios.com>2025-01-10 20:19:28 +0000
commit0e411c5d3098982d67cd2d7a233eaa6c977a1869 (patch)
treee69eef11d9d92dc76c6115eef5512c3aae6878aa /sysdeps
parentc813c1490d5d8640a94fced10fc7674a48737b96 (diff)
downloadglibc-0e411c5d3098982d67cd2d7a233eaa6c977a1869.zip
glibc-0e411c5d3098982d67cd2d7a233eaa6c977a1869.tar.gz
glibc-0e411c5d3098982d67cd2d7a233eaa6c977a1869.tar.bz2
Add generic 'extra TLS'
Add the logic to append an 'extra TLS' block in the TLS block allocator with a generic stub implementation. The duplicated code in 'csu/libc-tls.c' and 'elf/dl-tls.c' is to handle both statically linked applications and the ELF dynamic loader. Signed-off-by: Michael Jeanson <mjeanson@efficios.com> Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Reviewed-by: Florian Weimer <fweimer@redhat.com>
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/generic/dl-extra_tls.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/sysdeps/generic/dl-extra_tls.h b/sysdeps/generic/dl-extra_tls.h
new file mode 100644
index 0000000..7f5b10d
--- /dev/null
+++ b/sysdeps/generic/dl-extra_tls.h
@@ -0,0 +1,46 @@
+/* extra tls utils for the dynamic linker. Generic stub version.
+ Copyright (C) 2025 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+#ifndef _DL_EXTRA_TLS_H
+#define _DL_EXTRA_TLS_H 1
+#include <stddef.h>
+
+/* In this generic version, the extra TLS block is unused. */
+
+/* Returns the size of the extra TLS block, it must always be a multiple of the
+ alignment. */
+static inline size_t
+_dl_extra_tls_get_size (void)
+{
+ return 0;
+}
+
+/* Returns the alignment requirements of the extra TLS block. */
+static inline size_t
+_dl_extra_tls_get_align (void)
+{
+ return 0;
+}
+
+/* Record the offset of the extra TLS block from the thread pointer. */
+static inline void
+_dl_extra_tls_set_offset (ptrdiff_t tls_offset __attribute__ ((unused)))
+{
+}
+
+#endif