aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/generic
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2025-01-02 13:45:27 +0100
committerFlorian Weimer <fweimer@redhat.com>2025-01-02 13:45:27 +0100
commitceae7e2770302b04a9f9321b66dc8978c9747bd1 (patch)
treec20ae18da66e59056d5d6f01722dbd38050492cc /sysdeps/generic
parent64d07e117d93a8f0db324c376e0344d9aca21f6f (diff)
downloadglibc-ceae7e2770302b04a9f9321b66dc8978c9747bd1.zip
glibc-ceae7e2770302b04a9f9321b66dc8978c9747bd1.tar.gz
glibc-ceae7e2770302b04a9f9321b66dc8978c9747bd1.tar.bz2
elf: Introduce generic <dl-tls.h>
On arc, the definition of TLS_DTV_UNALLOCATED now comes from <dl-dtv.h>. For x86-64 x32, a separate version is needed because unsigned long int is 32 bits on this target. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Diffstat (limited to 'sysdeps/generic')
-rw-r--r--sysdeps/generic/dl-tls.h38
1 files changed, 36 insertions, 2 deletions
diff --git a/sysdeps/generic/dl-tls.h b/sysdeps/generic/dl-tls.h
index 7703a97..8aff4b6 100644
--- a/sysdeps/generic/dl-tls.h
+++ b/sysdeps/generic/dl-tls.h
@@ -1,2 +1,36 @@
-/* There has to be an architecture specific version of this file. */
-#error "architecture-specific version of <dl-tls.h> missing"
+/* TLS definitions for the ELF dynamic linker. Generic version.
+ Copyright (C) 2002-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_TLS_H
+#define _DL_TLS_H
+
+/* Type used for the representation of TLS information in the GOT. */
+typedef struct
+{
+ unsigned long int ti_module;
+ unsigned long int ti_offset;
+} tls_index;
+
+extern void *__tls_get_addr (tls_index *ti);
+
+/* Dynamic thread vector pointers point to the start of each
+ TLS block. */
+#define TLS_DTV_OFFSET 0
+
+#endif /* _DL_TLS_H */