]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
elf: Introduce generic <dl-tls.h>
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)
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>
13 files changed:
sysdeps/aarch64/dl-tls.h [deleted file]
sysdeps/alpha/dl-tls.h [deleted file]
sysdeps/arc/dl-tls.h [deleted file]
sysdeps/arm/dl-tls.h [deleted file]
sysdeps/csky/dl-tls.h [deleted file]
sysdeps/generic/dl-tls.h
sysdeps/hppa/dl-tls.h [deleted file]
sysdeps/i386/dl-tls.h
sysdeps/microblaze/dl-tls.h [deleted file]
sysdeps/or1k/dl-tls.h [deleted file]
sysdeps/sh/dl-tls.h [deleted file]
sysdeps/sparc/dl-tls.h [deleted file]
sysdeps/x86_64/x32/dl-tls.h [moved from sysdeps/x86_64/dl-tls.h with 91% similarity]

diff --git a/sysdeps/aarch64/dl-tls.h b/sysdeps/aarch64/dl-tls.h
deleted file mode 100644 (file)
index fe6addc..0000000
+++ /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 (file)
index 02cf57d..0000000
+++ /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 (file)
index 12d02c7..0000000
+++ /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 (file)
index 550f547..0000000
+++ /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 (file)
index 62520a3..0000000
+++ /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);
index 7703a975255f3b5110187ab3a781819e8e15174d..8aff4b6ca618568a115117c4380e8834033c0c6f 100644 (file)
@@ -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 (file)
index 363e287..0000000
+++ /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);
index 3bb472eb040228db7a8be5cab056dbf1ab2ced5e..eed183293c8e000dbfffe8ccd89cc63904792b52 100644 (file)
@@ -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 (file)
index 5cd1370..0000000
+++ /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 (file)
index d896f27..0000000
+++ /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 (file)
index 13c69a6..0000000
+++ /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 (file)
index 06ca48b..0000000
+++ /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);
similarity index 91%
rename from sysdeps/x86_64/dl-tls.h
rename to sysdeps/x86_64/x32/dl-tls.h
index f75da6efe65591ea9a0985d4989191624238e65d..4b736a4f30427e4f3a83bd7dd362d87d19b19d8e 100644 (file)
@@ -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 */