x86: Move GOT_TLS_* in elf32-i386.c to elfxx-x86.h
authorH.J. Lu <hjl.tools@gmail.com>
Sat, 2 Sep 2017 11:52:00 +0000 (04:52 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Sat, 2 Sep 2017 11:52:15 +0000 (04:52 -0700)
elf64-x86-64.c can use GOT_TLS_* definitions in elf32-i386.c with
GOT_TLS_IE_POS, GOT_TLS_IE_NEG and GOT_TLS_IE_BOTH unused.

* elf32-i386.c (GOT_TLS_IE, GOT_TLS_IE_POS, GOT_TLS_IE_NEG,
GOT_TLS_IE_BOTH, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Moved to ...
* elfxx-x86.h (GOT_TLS_IE, GOT_TLS_IE_POS, GOT_TLS_IE_NEG,
GOT_TLS_IE_BOTH, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Here.
* elf64-x86-64.c (GOT_TLS_IE, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Removed.

bfd/ChangeLog
bfd/elf32-i386.c
bfd/elf64-x86-64.c
bfd/elfxx-x86.h

index 5ef77cce6c7467d0a63561580a36d9b5daaed7e7..2bcee4929ce33558bb7070d08d5ed74d7ae82e5d 100644 (file)
@@ -1,3 +1,14 @@
+2017-09-02  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * elf32-i386.c (GOT_TLS_IE, GOT_TLS_IE_POS, GOT_TLS_IE_NEG,
+       GOT_TLS_IE_BOTH, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
+       GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Moved to ...
+       * elfxx-x86.h (GOT_TLS_IE, GOT_TLS_IE_POS, GOT_TLS_IE_NEG,
+       GOT_TLS_IE_BOTH, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
+       GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Here.
+       * elf64-x86-64.c (GOT_TLS_IE, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
+       GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Removed.
+
 2017-09-01  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR ld/22064
index 0803bee909cc8afd18fec6f202337a4d9179fea8..252a09d424eab6a44ed93e5dde3780ed224b1520 100644 (file)
@@ -853,21 +853,6 @@ static const struct elf_i386_backend_data elf_i386_arch_bed =
 
 #define        elf_backend_arch_data   &elf_i386_arch_bed
 
-/* Values in tls_type of x86 ELF linker hash entry.  */
-#define GOT_TLS_IE     4
-#define GOT_TLS_IE_POS 5
-#define GOT_TLS_IE_NEG 6
-#define GOT_TLS_IE_BOTH 7
-#define GOT_TLS_GDESC  8
-#define GOT_TLS_GD_BOTH_P(type)                                                \
-  ((type) == (GOT_TLS_GD | GOT_TLS_GDESC))
-#define GOT_TLS_GD_P(type)                                             \
-  ((type) == GOT_TLS_GD || GOT_TLS_GD_BOTH_P (type))
-#define GOT_TLS_GDESC_P(type)                                          \
-  ((type) == GOT_TLS_GDESC || GOT_TLS_GD_BOTH_P (type))
-#define GOT_TLS_GD_ANY_P(type)                                         \
-  (GOT_TLS_GD_P (type) || GOT_TLS_GDESC_P (type))
-
 #define is_i386_elf(bfd)                               \
   (bfd_get_flavour (bfd) == bfd_target_elf_flavour     \
    && elf_tdata (bfd) != NULL                          \
index 26ab715daf244ac69510a0a4678b42f1aaa06433..300e99ae4f0e13a28c82602b29e38a22a986973c 100644 (file)
@@ -968,18 +968,6 @@ static const struct elf_x86_64_backend_data elf_x86_64_arch_bed =
 
 #define        elf_backend_arch_data   &elf_x86_64_arch_bed
 
-/* Values in tls_type of x86 ELF linker hash entry.  */
-#define GOT_TLS_IE     3
-#define GOT_TLS_GDESC  4
-#define GOT_TLS_GD_BOTH_P(type) \
-  ((type) == (GOT_TLS_GD | GOT_TLS_GDESC))
-#define GOT_TLS_GD_P(type) \
-  ((type) == GOT_TLS_GD || GOT_TLS_GD_BOTH_P (type))
-#define GOT_TLS_GDESC_P(type) \
-  ((type) == GOT_TLS_GDESC || GOT_TLS_GD_BOTH_P (type))
-#define GOT_TLS_GD_ANY_P(type) \
-  (GOT_TLS_GD_P (type) || GOT_TLS_GDESC_P (type))
-
 #define is_x86_64_elf(bfd)                             \
   (bfd_get_flavour (bfd) == bfd_target_elf_flavour     \
    && elf_tdata (bfd) != NULL                          \
index edaab45533fec4c968a2c0cc7b6f3c6c511a423f..86af21f431c6840e80a25f292549dd4b64967bf1 100644 (file)
@@ -218,10 +218,23 @@ struct elf_x86_plt_layout
   unsigned int eh_frame_plt_size;
 };
 
-/* The first 3 values in tls_type of x86 ELF linker hash entry.  */
+/* Values in tls_type of x86 ELF linker hash entry.  */
 #define GOT_UNKNOWN    0
 #define GOT_NORMAL     1
 #define GOT_TLS_GD     2
+#define GOT_TLS_IE     4
+#define GOT_TLS_IE_POS 5
+#define GOT_TLS_IE_NEG 6
+#define GOT_TLS_IE_BOTH 7
+#define GOT_TLS_GDESC  8
+#define GOT_TLS_GD_BOTH_P(type)        \
+  ((type) == (GOT_TLS_GD | GOT_TLS_GDESC))
+#define GOT_TLS_GD_P(type) \
+  ((type) == GOT_TLS_GD || GOT_TLS_GD_BOTH_P (type))
+#define GOT_TLS_GDESC_P(type) \
+  ((type) == GOT_TLS_GDESC || GOT_TLS_GD_BOTH_P (type))
+#define GOT_TLS_GD_ANY_P(type) \
+  (GOT_TLS_GD_P (type) || GOT_TLS_GDESC_P (type))
 
 #define elf_x86_hash_entry(ent) \
   ((struct elf_x86_link_hash_entry *)(ent))