]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
elf: Consolidate machine-agnostic DTV definitions in <dl-dtv.h>
authorFlorian Weimer <fweimer@redhat.com>
Mon, 20 Jun 2016 12:31:40 +0000 (14:31 +0200)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Fri, 27 Jan 2017 15:16:28 +0000 (13:16 -0200)
Identical definitions of dtv_t and TLS_DTV_UNALLOCATED were
repeated for all architectures using DTVs.

35 files changed:
ChangeLog
sysdeps/aarch64/dl-tls.h
sysdeps/aarch64/nptl/tls.h
sysdeps/alpha/dl-tls.h
sysdeps/alpha/nptl/tls.h
sysdeps/arm/dl-tls.h
sysdeps/arm/nptl/tls.h
sysdeps/generic/dl-dtv.h [new file with mode: 0644]
sysdeps/hppa/dl-tls.h
sysdeps/hppa/nptl/tls.h
sysdeps/i386/dl-tls.h
sysdeps/i386/nptl/tls.h
sysdeps/ia64/dl-tls.h
sysdeps/ia64/nptl/tls.h
sysdeps/m68k/dl-tls.h
sysdeps/m68k/nptl/tls.h
sysdeps/mach/hurd/i386/tls.h
sysdeps/microblaze/dl-tls.h
sysdeps/microblaze/nptl/tls.h
sysdeps/mips/dl-tls.h
sysdeps/mips/nptl/tls.h
sysdeps/nios2/dl-tls.h
sysdeps/nios2/nptl/tls.h
sysdeps/powerpc/dl-tls.h
sysdeps/powerpc/nptl/tls.h
sysdeps/s390/dl-tls.h
sysdeps/s390/nptl/tls.h
sysdeps/sh/dl-tls.h
sysdeps/sh/nptl/tls.h
sysdeps/sparc/dl-tls.h
sysdeps/sparc/nptl/tls.h
sysdeps/tile/dl-tls.h
sysdeps/tile/nptl/tls.h
sysdeps/x86_64/dl-tls.h
sysdeps/x86_64/nptl/tls.h

index 79fa583cd76e56d6f11e2a0b2b5c093db926d54d..3408f9c28af42a6d6c7ed8ce40fe7c97cc80596f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,55 @@
+2016-06-20  Florian Weimer  <fweimer@redhat.com>
+
+       Consolidate machine-agnostic DTV definitions in <dl-dtv.h>.
+       * sysdeps/generic/dl-dtv.h: New file.
+       * sysdeps/aarch64/dl-tls.h (TLS_DTV_UNALLOCATED): Remove.
+       * sysdeps/aarch64/nptl/tls.h: Include <dl-dtv.h>.
+       (dtv_t): Remove.
+       * sysdeps/alpha/dl-tls.h (TLS_DTV_UNALLOCATED): Remove.
+       * sysdeps/alpha/nptl/tls.h: Include <dl-dtv.h>.
+       (dtv_t): Remove.
+       * sysdeps/arm/dl-tls.h (TLS_DTV_UNALLOCATED): Remove.
+       * sysdeps/arm/nptl/tls.h: Include <dl-dtv.h>.
+       (dtv_t): Remove.
+       * sysdeps/hppa/dl-tls.h (TLS_DTV_UNALLOCATED): Remove.
+       * sysdeps/hppa/nptl/tls.h: Include <dl-dtv.h>.
+       (dtv_t): Remove.
+       * sysdeps/i386/dl-tls.h (TLS_DTV_UNALLOCATED): Remove.
+       * sysdeps/i386/nptl/tls.h: Include <dl-dtv.h>.
+       (dtv_t): Remove.
+       * sysdeps/ia64/dl-tls.h (TLS_DTV_UNALLOCATED): Remove.
+       * sysdeps/ia64/nptl/tls.h: Include <dl-dtv.h>.
+       (dtv_t): Remove.
+       * sysdeps/m68k/dl-tls.h (TLS_DTV_UNALLOCATED): Remove.
+       * sysdeps/m68k/nptl/tls.h: Include <dl-dtv.h>.
+       (dtv_t): Remove.
+       * sysdeps/mach/hurd/i386/tls.h: Include <dl-dtv.h>.
+       (dtv_t): Remove.
+       * sysdeps/microblaze/dl-tls.h (TLS_DTV_UNALLOCATED): Remove.
+       * sysdeps/microblaze/nptl/tls.h: Include <dl-dtv.h>.
+       (dtv_t): Remove.
+       * sysdeps/mips/dl-tls.h (TLS_DTV_UNALLOCATED): Remove.
+       * sysdeps/mips/nptl/tls.h: Include <dl-dtv.h>.
+       (dtv_t): Remove.
+       * sysdeps/nios2/dl-tls.h (TLS_DTV_UNALLOCATED): Remove.
+       * sysdeps/nios2/nptl/tls.h: Include <dl-dtv.h>.
+       (dtv_t): Remove.
+       * sysdeps/powerpc/dl-tls.h (TLS_DTV_UNALLOCATED): Remove.
+       * sysdeps/powerpc/nptl/tls.h: Include <dl-dtv.h>.
+       (dtv_t): Remove.
+       * sysdeps/s390/dl-tls.h (TLS_DTV_UNALLOCATED): Remove.
+       * sysdeps/s390/nptl/tls.h: Include <dl-dtv.h>.
+       (dtv_t): Remove.
+       * sysdeps/sh/dl-tls.h (TLS_DTV_UNALLOCATED): Remove.
+       * sysdeps/sh/nptl/tls.h: Include <dl-dtv.h>.
+       (dtv_t): Remove.
+       * sysdeps/sparc/dl-tls.h (TLS_DTV_UNALLOCATED): Remove.
+       * sysdeps/sparc/nptl/tls.h: Include <dl-dtv.h>.
+       (dtv_t): Remove.
+       * sysdeps/x86_64/dl-tls.h (TLS_DTV_UNALLOCATED): Remove.
+       * sysdeps/x86_64/nptl/tls.h: Include <dl-dtv.h>.
+       (dtv_t): Remove.
+
 2016-04-14  Florian Weimer  <fweimer@redhat.com>
 
        [BZ #19431]
index 24657165421b56537450da19f966bb81128b3576..9a7d716cdd143cfd2f825027bb68442c4cd5dd8d 100644 (file)
@@ -25,6 +25,3 @@ typedef struct
 
 
 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)
index 1e3904eafbf16f3b92046c240da3d68b29d09be1..10b82cf120e7adecbae6a1f8617765f3fb90d6eb 100644 (file)
 # include <stdbool.h>
 # include <stddef.h>
 # include <stdint.h>
-
-/* Type for the dtv.  */
-typedef union dtv
-{
-  size_t counter;
-  struct
-  {
-    void *val;
-    bool is_static;
-  } pointer;
-} dtv_t;
+# include <dl-dtv.h>
 
 #else /* __ASSEMBLER__ */
 # include <tcb-offsets.h>
index 5cdd439ef908233685f2f9fe77c6b3459e2a676a..eb0126ca82a1a223f342ea916401603ca2d8a7fc 100644 (file)
@@ -25,6 +25,3 @@ typedef struct
 } 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)
index 4eddf40eeec4e6b3e2fdb3b9e2dc5baca02bd3a3..2b360e9d90a28be20ccc182fefbdbb58864c57ef 100644 (file)
 # include <stdbool.h>
 # include <stddef.h>
 # include <stdint.h>
-
-/* Type for the dtv.  */
-typedef union dtv
-{
-  size_t counter;
-  struct
-  {
-    void *val;
-    bool is_static;
-  } pointer;
-} dtv_t;
+# include <dl-dtv.h>
 
 /* Get system call information.  */
 # include <sysdep.h>
index 30599bb1be154b5b91f87bcf8ffcb9e978901b99..0e716e56943a0ef61bf5940dfcbec15ddb420b1b 100644 (file)
@@ -26,6 +26,3 @@ typedef struct dl_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)
index 27ea00601ecd0dfe2aaa982ac672554a723166a6..f69ed1bcfdb359469cc4a344f936a31fe48cf559 100644 (file)
 # include <stdbool.h>
 # include <stddef.h>
 # include <stdint.h>
-
-/* Type for the dtv.  */
-typedef union dtv
-{
-  size_t counter;
-  struct
-  {
-    void *val;
-    bool is_static;
-  } pointer;
-} dtv_t;
+# include <dl-dtv.h>
 
 #else /* __ASSEMBLER__ */
 # include <tcb-offsets.h>
diff --git a/sysdeps/generic/dl-dtv.h b/sysdeps/generic/dl-dtv.h
new file mode 100644 (file)
index 0000000..36c5c58
--- /dev/null
@@ -0,0 +1,36 @@
+/* Generic declarations for DTV-based TLS handling in the dynamic linker.
+   Copyright (C) 2002-2016 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
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _DL_DTV_H
+#define _DL_DTV_H
+
+/* Type for the dtv.  */
+typedef union dtv
+{
+  size_t counter;
+  struct
+  {
+    void *val;
+    bool is_static;
+  } pointer;
+} dtv_t;
+
+/* Value used for dtv entries for which the allocation is delayed.  */
+#define TLS_DTV_UNALLOCATED ((void *) -1l)
+
+#endif /* _DLT_DTV_H */
index bf0b2a463d3f3560fd88ae5a796b85f61eab9cb9..e9eda9f582ad53200e50e4c573c573d8969ebbbc 100644 (file)
@@ -26,6 +26,3 @@ typedef struct
 
 
 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)
index ab271cf241278f7de8db03a103c05949016fad78..5ac6e63dd1bc3a4071f87ee3407d710cb878dd08 100644 (file)
 # include <stdbool.h>
 # include <stddef.h>
 # include <stdint.h>
-
-/* Type for the dtv.  */
-typedef union dtv
-{
-  size_t counter;
-  struct
-  {
-    void *val;
-    bool is_static;
-  } pointer;
-} dtv_t;
+# include <dl-dtv.h>
 
 #else /* __ASSEMBLER__ */
 # include <tcb-offsets.h>
index f8e108f7304bfbdf1bbe46992fdfdefefd8e428d..9072327957de9c25e73cfdba2a199425d9df902f 100644 (file)
@@ -59,6 +59,3 @@ rtld_hidden_def (___tls_get_addr)
 
 # endif
 #endif
-
-/* Value used for dtv entries for which the allocation is delayed.  */
-#define TLS_DTV_UNALLOCATED    ((void *) -1l)
index 40f84ef4f7cf01ed69da00574b0bdbb37542536f..5f6c3d7f21af64ebbcb8b482c3b70de836ca08f7 100644 (file)
 # include <sysdep.h>
 # include <libc-internal.h>
 # include <kernel-features.h>
-
-
-/* Type for the dtv.  */
-typedef union dtv
-{
-  size_t counter;
-  struct
-  {
-    void *val;
-    bool is_static;
-  } pointer;
-} dtv_t;
-
+# include <dl-dtv.h>
 
 typedef struct
 {
index a36d99087805d660cb8bb393609208e981bc06e4..e9bb0ca61245518669e02e9dace350c5f5651792 100644 (file)
@@ -28,6 +28,3 @@
 #define DONT_USE_TLS_INDEX     1
 
 extern void *__tls_get_addr (size_t m, size_t offset);
-
-/* Value used for dtv entries for which the allocation is delayed.  */
-#define TLS_DTV_UNALLOCATED    ((void *) -1l)
index 1668fd4ca9a0eff8edcd77482bed7361df243e99..65226d77ca9af82a11e4ca2ea066773d8fa11c59 100644 (file)
 # include <stdint.h>
 # include <stdlib.h>
 # include <list.h>
-
-
-/* Type for the dtv.  */
-typedef union dtv
-{
-  size_t counter;
-  struct
-  {
-    void *val;
-    bool is_static;
-  } pointer;
-} dtv_t;
-
+# include <dl-dtv.h>
 
 typedef struct
 {
index 82ff78c36c33ab2da893c155154e3a7cc4723946..fab9f0ad1454e9ace146b62a18885d76de04756d 100644 (file)
@@ -45,6 +45,3 @@ extern void *__tls_get_addr (tls_index *ti);
 
 #define GET_ADDR_OFFSET                (ti->ti_offset + TLS_DTV_OFFSET)
 #define __TLS_GET_ADDR(__ti)   (__tls_get_addr (__ti) - TLS_DTV_OFFSET)
-
-/* Value used for dtv entries for which the allocation is delayed.  */
-#define TLS_DTV_UNALLOCATED    ((void *) -1l)
index 93bc1ad0807c62c0186ff1c22d9db3a41cf4e735..703d368e922e78ea1ee9a0235d172d4c0a4cac64 100644 (file)
 # include <stdbool.h>
 # include <stddef.h>
 # include <stdint.h>
-
-/* Type for the dtv.  */
-typedef union dtv
-{
-  size_t counter;
-  struct
-  {
-    void *val;
-    bool is_static;
-  } pointer;
-} dtv_t;
+# include <dl-dtv.h>
 
 #else /* __ASSEMBLER__ */
 # include <tcb-offsets.h>
index ca68d1cfde9b5532942a7d8b362638ebdc0423dd..34564ae4656958d48532d71841314ff6423d4650 100644 (file)
 
 
 #ifndef __ASSEMBLER__
-/* Type for the dtv.  */
-typedef union dtv
-{
-  size_t counter;
-  struct
-  {
-    void *val;
-    bool is_static;
-  } pointer;
-} dtv_t;
-
+# include <dl-dtv.h>
 
 /* Type of the TCB.  */
 typedef struct
index 704ad2595269b9326ad0830506009aa68ea97479..9f0f49111dd583d1335d840644ae2daf7372a1a5 100644 (file)
@@ -24,6 +24,3 @@ typedef struct
 } 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)
index 171a745db979ab3dcbe165799fe53c034a9b0f58..42d2c4bcd402a9cce740f44b55dddb8a66849698 100644 (file)
 # include <stdbool.h>
 # include <stddef.h>
 # include <stdint.h>
-
-/* Type for the dtv.  */
-typedef union dtv
-{
-  size_t counter;
-  struct
-  {
-    void *val;
-    bool is_static;
-  } pointer;
-} dtv_t;
+# include <dl-dtv.h>
 
 #else /* __ASSEMBLER__ */
 # include <tcb-offsets.h>
index 54dc71190c430eea32a45e892b78221263e59e6f..58d968ff3548d59ebbfbb19826affdb6a8a9f54e 100644 (file)
@@ -43,6 +43,3 @@ extern void *__tls_get_addr (tls_index *ti);
 
 # define GET_ADDR_OFFSET       (ti->ti_offset + TLS_DTV_OFFSET)
 # define __TLS_GET_ADDR(__ti)  (__tls_get_addr (__ti) - TLS_DTV_OFFSET)
-
-/* Value used for dtv entries for which the allocation is delayed.  */
-#define TLS_DTV_UNALLOCATED    ((void *) -1l)
index ef1145779df47816bb7d6e501c77d853d61ce0fa..95f8d33a2e0643d4732a78a4f2d64a0e485e89b9 100644 (file)
 # include <stdbool.h>
 # include <stddef.h>
 # include <stdint.h>
+# include <dl-dtv.h>
 
-/* Type for the dtv.  */
-typedef union dtv
-{
-  size_t counter;
-  struct
-  {
-    void *val;
-    bool is_static;
-  } pointer;
-} dtv_t;
+/* Get system call information.  */
+# include <sysdep.h>
 
 #ifdef __mips16
 /* MIPS16 uses GCC builtin to access the TP.  */
index 541e4b012e8ab2cc63ace8fd9cfd36a37d97f358..65a9cc850637f6c0db251203ac84dd97bf0ccbd9 100644 (file)
@@ -43,6 +43,3 @@ extern void *__tls_get_addr (tls_index *ti);
 
 # define GET_ADDR_OFFSET       (ti->ti_offset + TLS_DTV_OFFSET)
 # define __TLS_GET_ADDR(__ti)  (__tls_get_addr (__ti) - TLS_DTV_OFFSET)
-
-/* Value used for dtv entries for which the allocation is delayed.  */
-#define TLS_DTV_UNALLOCATED    ((void *) -1l)
index 465a4b913487db9a6c03c7907be6e02185adba2e..3fd8b32f8042ddb25586b9d49b4fcb8b3f72ce07 100644 (file)
 # include <stdbool.h>
 # include <stddef.h>
 # include <stdint.h>
-
-/* Type for the dtv.  */
-typedef union dtv
-{
-  size_t counter;
-  struct
-  {
-    void *val;
-    bool is_static;
-  } pointer;
-} dtv_t;
+# include <dl-dtv.h>
 
 #else /* __ASSEMBLER__ */
 # include <tcb-offsets.h>
index 4e3e93a84d920346e6adaa004990eb3a7f1f7eed..cc0771aa4348d1500a17803e235548dc95bc68a7 100644 (file)
@@ -49,7 +49,4 @@ extern void *__tls_get_addr (tls_index *ti);
 # define __TLS_GET_ADDR(__ti)  (__tls_get_addr (__ti) - TLS_DTV_OFFSET)
 #endif
 
-/* Value used for dtv entries for which the allocation is delayed.  */
-#define TLS_DTV_UNALLOCATED    ((void *) -1l)
-
 #endif /* dl-tls.h */
index 1f3d97a99593afbd3c56318eaa6d7a2d03a59005..93d001151cdd5b9996a4eb3f59f534e434591f60 100644 (file)
 # include <stdbool.h>
 # include <stddef.h>
 # include <stdint.h>
-
-/* Type for the dtv.  */
-typedef union dtv
-{
-  size_t counter;
-  struct
-  {
-    void *val;
-    bool is_static;
-  } pointer;
-} dtv_t;
+# include <dl-dtv.h>
 
 #else /* __ASSEMBLER__ */
 # include <tcb-offsets.h>
index 8132b10ab55a6295a4f6eca24d7c419ada4ce682..98262b2b6230ab3a9aa5621caeb0c98f6dd025d5 100644 (file)
@@ -102,6 +102,3 @@ extern void *__tls_get_addr_internal (tls_index *ti);
       + (unsigned long) __builtin_thread_pointer (); })
 
 #endif
-
-/* Value used for dtv entries for which the allocation is delayed.  */
-#define TLS_DTV_UNALLOCATED    ((void *) -1l)
index e6f8a47eccf8486ddc2a139a01e0fe2444f1a277..4a5638e589647d42a0747cee9294c379bd1c54c4 100644 (file)
 # include <stdlib.h>
 # include <list.h>
 # include <kernel-features.h>
-
-
-/* Type for the dtv.  */
-typedef union dtv
-{
-  size_t counter;
-  struct
-  {
-    void *val;
-    bool is_static;
-  } pointer;
-} dtv_t;
-
+# include <dl-dtv.h>
 
 typedef struct
 {
index 2b6d57356d76728b4a15645c0d100e59ce994acd..2b2bbabe70b60a786fd3d5a724cb171409a1f98d 100644 (file)
@@ -26,6 +26,3 @@ typedef struct
 
 
 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)
index 9615a76e3e8527666e4622a2866f108730d4cb13..4421910554640da08581c834e5630de945a9e748 100644 (file)
 # include <stdlib.h>
 # include <list.h>
 # include <sysdep.h>
-
-/* Type for the dtv.  */
-typedef union dtv
-{
-  size_t counter;
-  struct
-  {
-    void *val;
-    bool is_static;
-  } pointer;
-} dtv_t;
+# include <dl-dtv.h>
 
 typedef struct
 {
index 9fbe90934cbcf3c4d73a8fe090dad903d9f626bf..0c0ca061ee1b49529a3d8d85dcb1d80be47b6950 100644 (file)
@@ -26,6 +26,3 @@ typedef struct
 
 
 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)
index 54bce7e950c3756a979d3afb7560e69bcc384e3c..9c0c5158b1e08ede06d6e164b730289a606445d5 100644 (file)
 # include <stdlib.h>
 # include <list.h>
 # include <kernel-features.h>
-
-/* Type for the dtv.  */
-typedef union dtv
-{
-  size_t counter;
-  struct
-  {
-    void *val;
-    bool is_static;
-  } pointer;
-} dtv_t;
+# include <dl-dtv.h>
 
 typedef struct
 {
index 16c5a433846f205cb0e5b626f1ca5096f238387c..b66cc086664152ace32abb30d813f9e8e7839fe1 100644 (file)
@@ -40,6 +40,3 @@ extern void *__tls_get_addr (tls_index *ti);
 /* Compute the value for a DTPREL reloc.  */
 #define TLS_DTPREL_VALUE(sym) \
   ((sym)->st_value - TLS_DTV_OFFSET)
-
-/* Value used for dtv entries for which the allocation is delayed.  */
-#define TLS_DTV_UNALLOCATED    ((void *) -1l)
index 08e1d54346a94c07069e4d006f96bfeb09d6a3e3..9ab195f6f26b7e0ec645fbd9ed59af531fd27dbd 100644 (file)
 # include <stdbool.h>
 # include <stddef.h>
 # include <stdint.h>
-
-/* Type for the dtv.  */
-typedef union dtv
-{
-  size_t counter;
-  struct
-  {
-    void *val;
-    bool is_static;
-  } pointer;
-} dtv_t;
+# include <dl-dtv.h>
 
 #else /* __ASSEMBLER__ */
 # include <tcb-offsets.h>
index 285799b674cc84e7e68d031dabdd352cd5b8b38b..eba9993f9db1089f3ae66eb7b07ee4d47828097a 100644 (file)
@@ -27,6 +27,3 @@ typedef struct dl_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)
index b947d57447fc1cf14ef972e0eb7c05aab65b8b61..0672348efde57df973c4c307522866da5eb586de 100644 (file)
@@ -28,6 +28,7 @@
 # include <sysdep.h>
 # include <libc-internal.h>
 # include <kernel-features.h>
+# include <dl-dtv.h>
 
 /* Replacement type for __m128 since this file is included by ld.so,
    which is compiled with -mno-sse.  It must not change the alignment
@@ -38,18 +39,6 @@ typedef struct
 } __128bits;
 
 
-/* Type for the dtv.  */
-typedef union dtv
-{
-  size_t counter;
-  struct
-  {
-    void *val;
-    bool is_static;
-  } pointer;
-} dtv_t;
-
-
 typedef struct
 {
   void *tcb;           /* Pointer to the TCB.  Not necessarily the