aboutsummaryrefslogtreecommitdiff
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
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>
-rw-r--r--sysdeps/aarch64/dl-tls.h27
-rw-r--r--sysdeps/alpha/dl-tls.h27
-rw-r--r--sysdeps/arc/dl-tls.h30
-rw-r--r--sysdeps/arm/dl-tls.h28
-rw-r--r--sysdeps/csky/dl-tls.h26
-rw-r--r--sysdeps/generic/dl-tls.h38
-rw-r--r--sysdeps/hppa/dl-tls.h28
-rw-r--r--sysdeps/i386/dl-tls.h3
-rw-r--r--sysdeps/microblaze/dl-tls.h26
-rw-r--r--sysdeps/or1k/dl-tls.h27
-rw-r--r--sysdeps/sh/dl-tls.h28
-rw-r--r--sysdeps/sparc/dl-tls.h28
-rw-r--r--sysdeps/x86_64/x32/dl-tls.h (renamed from sysdeps/x86_64/dl-tls.h)4
13 files changed, 43 insertions, 277 deletions
diff --git a/sysdeps/aarch64/dl-tls.h b/sysdeps/aarch64/dl-tls.h
deleted file mode 100644
index fe6addc..0000000
--- a/sysdeps/aarch64/dl-tls.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Copyright (C) 2005-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/>. */
-
-/* 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);
diff --git a/sysdeps/alpha/dl-tls.h b/sysdeps/alpha/dl-tls.h
deleted file mode 100644
index 02cf57d..0000000
--- a/sysdeps/alpha/dl-tls.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Thread-local storage handling in the ELF dynamic linker. Alpha 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/>. */
-
-
-/* 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);
diff --git a/sysdeps/arc/dl-tls.h b/sysdeps/arc/dl-tls.h
deleted file mode 100644
index 12d02c7..0000000
--- a/sysdeps/arc/dl-tls.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Thread-local storage handling in the ELF dynamic linker. ARC version.
- Copyright (C) 2020-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/>. */
-
-
-/* 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);
-
-/* Value used for dtv entries for which the allocation is delayed. */
-#define TLS_DTV_UNALLOCATED ((void *) -1l)
diff --git a/sysdeps/arm/dl-tls.h b/sysdeps/arm/dl-tls.h
deleted file mode 100644
index 550f547..0000000
--- a/sysdeps/arm/dl-tls.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Thread-local storage handling in the ELF dynamic linker. ARM version.
- Copyright (C) 2005-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/>. */
-
-
-/* Type used for the representation of TLS information in the GOT. */
-typedef struct dl_tls_index
-{
- unsigned long int ti_module;
- unsigned long int ti_offset;
-} tls_index;
-
-
-extern void *__tls_get_addr (tls_index *ti);
diff --git a/sysdeps/csky/dl-tls.h b/sysdeps/csky/dl-tls.h
deleted file mode 100644
index 62520a3..0000000
--- a/sysdeps/csky/dl-tls.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Thread-local storage handling in the ELF dynamic linker. C-SKY version.
- Copyright (C) 2018-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/>. */
-
-/* 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);
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 */
diff --git a/sysdeps/hppa/dl-tls.h b/sysdeps/hppa/dl-tls.h
deleted file mode 100644
index 363e287..0000000
--- a/sysdeps/hppa/dl-tls.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Thread-local storage handling in the ELF dynamic linker. hppa version.
- Copyright (C) 2003-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/>. */
-
-
-/* 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);
diff --git a/sysdeps/i386/dl-tls.h b/sysdeps/i386/dl-tls.h
index 3bb472e..eed1832 100644
--- a/sysdeps/i386/dl-tls.h
+++ b/sysdeps/i386/dl-tls.h
@@ -24,6 +24,9 @@ typedef struct dl_tls_index
unsigned long int ti_offset;
} tls_index;
+/* Dynamic thread vector pointers point to the start of each
+ TLS block. */
+#define TLS_DTV_OFFSET 0
#ifdef SHARED
/* This is the prototype for the GNU version. */
diff --git a/sysdeps/microblaze/dl-tls.h b/sysdeps/microblaze/dl-tls.h
deleted file mode 100644
index 5cd1370b..0000000
--- a/sysdeps/microblaze/dl-tls.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Copyright (C) 2005-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/>. */
-
-/* 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);
diff --git a/sysdeps/or1k/dl-tls.h b/sysdeps/or1k/dl-tls.h
deleted file mode 100644
index d896f27..0000000
--- a/sysdeps/or1k/dl-tls.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/* TLS definitions for the ELF dynamic linker. OpenRISC version.
- Copyright (C) 2022-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/>. */
-
-/* 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);
diff --git a/sysdeps/sh/dl-tls.h b/sysdeps/sh/dl-tls.h
deleted file mode 100644
index 13c69a6..0000000
--- a/sysdeps/sh/dl-tls.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Thread-local storage handling in the ELF dynamic linker. SH 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/>. */
-
-
-/* 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);
diff --git a/sysdeps/sparc/dl-tls.h b/sysdeps/sparc/dl-tls.h
deleted file mode 100644
index 06ca48b..0000000
--- a/sysdeps/sparc/dl-tls.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Thread-local storage handling in the ELF dynamic linker. SPARC version.
- Copyright (C) 2003-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/>. */
-
-
-/* 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);
diff --git a/sysdeps/x86_64/dl-tls.h b/sysdeps/x86_64/x32/dl-tls.h
index f75da6e..4b736a4 100644
--- a/sysdeps/x86_64/dl-tls.h
+++ b/sysdeps/x86_64/x32/dl-tls.h
@@ -31,4 +31,8 @@ typedef struct dl_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 /* _X86_64_DL_TLS_H */