x86: Replace elf_x86_plt_layout_table with elf_x86_init_table
authorH.J. Lu <hjl.tools@gmail.com>
Fri, 8 Sep 2017 11:10:34 +0000 (04:10 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Fri, 8 Sep 2017 11:10:34 +0000 (04:10 -0700)
* elf32-i386.c (elf_i386_link_setup_gnu_properties): Replace
elf_x86_plt_layout_table with elf_x86_init_table.
* elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties):
Likewise.
* elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties):
Likewise.
* elfxx-x86.h (elf_x86_plt_layout_table): Renamed to ...
(elf_x86_init_table): This.
(_bfd_x86_elf_link_setup_gnu_properties): Replace
elf_x86_plt_layout_table with elf_x86_init_table.

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

index c3144b3363c26be5ae3ff1bfc9161a9d20377b91..73d3d1ca443f1d1bd5921e64c53f736943153419 100644 (file)
@@ -1,3 +1,16 @@
+2017-09-08  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * elf32-i386.c (elf_i386_link_setup_gnu_properties): Replace
+       elf_x86_plt_layout_table with elf_x86_init_table.
+       * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties):
+       Likewise.
+       * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties):
+       Likewise.
+       * elfxx-x86.h (elf_x86_plt_layout_table): Renamed to ...
+       (elf_x86_init_table): This.
+       (_bfd_x86_elf_link_setup_gnu_properties): Replace
+       elf_x86_plt_layout_table with elf_x86_init_table.
+
 2017-09-07  H.J. Lu  <hongjiu.lu@intel.com>
 
        * configure.ac (bfd_backends): Don't add elf64-x86-64.lo nor
index a64a09d458970f7389a8db06ca0ede1b9d70e47f..dcf07d95d8e6ff76f43cc8ef321847db3fe550a4 100644 (file)
@@ -4600,38 +4600,38 @@ elf_i386_get_synthetic_symtab (bfd *abfd,
 static bfd *
 elf_i386_link_setup_gnu_properties (struct bfd_link_info *info)
 {
-  struct elf_x86_plt_layout_table plt_layout;
+  struct elf_x86_init_table init_table;
 
-  plt_layout.normal_target = FALSE;
-  plt_layout.is_vxworks = FALSE;
+  init_table.normal_target = FALSE;
+  init_table.is_vxworks = FALSE;
   switch (get_elf_i386_backend_data (info->output_bfd)->os)
     {
     case is_normal:
-      plt_layout.lazy_plt = &elf_i386_lazy_plt;
-      plt_layout.non_lazy_plt = &elf_i386_non_lazy_plt;
-      plt_layout.lazy_ibt_plt = &elf_i386_lazy_ibt_plt;
-      plt_layout.non_lazy_ibt_plt = &elf_i386_non_lazy_ibt_plt;
-      plt_layout.normal_target = TRUE;
+      init_table.lazy_plt = &elf_i386_lazy_plt;
+      init_table.non_lazy_plt = &elf_i386_non_lazy_plt;
+      init_table.lazy_ibt_plt = &elf_i386_lazy_ibt_plt;
+      init_table.non_lazy_ibt_plt = &elf_i386_non_lazy_ibt_plt;
+      init_table.normal_target = TRUE;
       break;
     case is_vxworks:
-      plt_layout.lazy_plt = &elf_i386_lazy_plt;
-      plt_layout.non_lazy_plt = NULL;
-      plt_layout.lazy_ibt_plt = NULL;
-      plt_layout.non_lazy_ibt_plt = NULL;
-      plt_layout.is_vxworks = TRUE;
+      init_table.lazy_plt = &elf_i386_lazy_plt;
+      init_table.non_lazy_plt = NULL;
+      init_table.lazy_ibt_plt = NULL;
+      init_table.non_lazy_ibt_plt = NULL;
+      init_table.is_vxworks = TRUE;
       break;
     case is_nacl:
-      plt_layout.lazy_plt = &elf_i386_nacl_plt;
-      plt_layout.non_lazy_plt = NULL;
-      plt_layout.lazy_ibt_plt = NULL;
-      plt_layout.non_lazy_ibt_plt = NULL;
+      init_table.lazy_plt = &elf_i386_nacl_plt;
+      init_table.non_lazy_plt = NULL;
+      init_table.lazy_ibt_plt = NULL;
+      init_table.non_lazy_ibt_plt = NULL;
       break;
     }
 
-  plt_layout.r_info = elf32_r_info;
-  plt_layout.r_sym = elf32_r_sym;
+  init_table.r_info = elf32_r_info;
+  init_table.r_sym = elf32_r_sym;
 
-  return _bfd_x86_elf_link_setup_gnu_properties (info, &plt_layout);
+  return _bfd_x86_elf_link_setup_gnu_properties (info, &init_table);
 }
 
 #define TARGET_LITTLE_SYM              i386_elf32_vec
index 10da82051800d8f92172b264c61aef43b5e6e60b..cab086db05aab2f23eae06a66e3ff4c33bd4d9cd 100644 (file)
@@ -5140,7 +5140,7 @@ elf_x86_64_relocs_compatible (const bfd_target *input,
 static bfd *
 elf_x86_64_link_setup_gnu_properties (struct bfd_link_info *info)
 {
-  struct elf_x86_plt_layout_table plt_layout;
+  struct elf_x86_init_table init_table;
 
   if ((int) R_X86_64_standard >= (int) R_X86_64_converted_reloc_bit
       || (int) R_X86_64_max <= (int) R_X86_64_converted_reloc_bit
@@ -5150,53 +5150,53 @@ elf_x86_64_link_setup_gnu_properties (struct bfd_link_info *info)
          != (int) R_X86_64_GNU_VTENTRY))
     abort ();
 
-  plt_layout.is_vxworks = FALSE;
+  init_table.is_vxworks = FALSE;
   if (get_elf_x86_64_backend_data (info->output_bfd)->os == is_normal)
     {
       if (info->bndplt)
        {
-         plt_layout.lazy_plt = &elf_x86_64_lazy_bnd_plt;
-         plt_layout.non_lazy_plt = &elf_x86_64_non_lazy_bnd_plt;
+         init_table.lazy_plt = &elf_x86_64_lazy_bnd_plt;
+         init_table.non_lazy_plt = &elf_x86_64_non_lazy_bnd_plt;
        }
       else
        {
-         plt_layout.lazy_plt = &elf_x86_64_lazy_plt;
-         plt_layout.non_lazy_plt = &elf_x86_64_non_lazy_plt;
+         init_table.lazy_plt = &elf_x86_64_lazy_plt;
+         init_table.non_lazy_plt = &elf_x86_64_non_lazy_plt;
        }
 
       if (ABI_64_P (info->output_bfd))
        {
-         plt_layout.lazy_ibt_plt = &elf_x86_64_lazy_ibt_plt;
-         plt_layout.non_lazy_ibt_plt = &elf_x86_64_non_lazy_ibt_plt;
+         init_table.lazy_ibt_plt = &elf_x86_64_lazy_ibt_plt;
+         init_table.non_lazy_ibt_plt = &elf_x86_64_non_lazy_ibt_plt;
        }
       else
        {
-         plt_layout.lazy_ibt_plt = &elf_x32_lazy_ibt_plt;
-         plt_layout.non_lazy_ibt_plt = &elf_x32_non_lazy_ibt_plt;
+         init_table.lazy_ibt_plt = &elf_x32_lazy_ibt_plt;
+         init_table.non_lazy_ibt_plt = &elf_x32_non_lazy_ibt_plt;
        }
-      plt_layout.normal_target = TRUE;
+      init_table.normal_target = TRUE;
     }
   else
     {
-      plt_layout.lazy_plt = &elf_x86_64_nacl_plt;
-      plt_layout.non_lazy_plt = NULL;
-      plt_layout.lazy_ibt_plt = NULL;
-      plt_layout.non_lazy_ibt_plt = NULL;
-      plt_layout.normal_target = FALSE;
+      init_table.lazy_plt = &elf_x86_64_nacl_plt;
+      init_table.non_lazy_plt = NULL;
+      init_table.lazy_ibt_plt = NULL;
+      init_table.non_lazy_ibt_plt = NULL;
+      init_table.normal_target = FALSE;
     }
 
   if (ABI_64_P (info->output_bfd))
     {
-      plt_layout.r_info = elf64_r_info;
-      plt_layout.r_sym = elf64_r_sym;
+      init_table.r_info = elf64_r_info;
+      init_table.r_sym = elf64_r_sym;
     }
   else
     {
-      plt_layout.r_info = elf32_r_info;
-      plt_layout.r_sym = elf32_r_sym;
+      init_table.r_info = elf32_r_info;
+      init_table.r_sym = elf32_r_sym;
     }
 
-  return _bfd_x86_elf_link_setup_gnu_properties (info, &plt_layout);
+  return _bfd_x86_elf_link_setup_gnu_properties (info, &init_table);
 }
 
 static const struct bfd_elf_special_section
index bbb0578031b795c8447d2602c617d4e7b1c13581..86e26f985281279220ffa0a87b49b0feb7fed33d 100644 (file)
@@ -2106,8 +2106,7 @@ _bfd_x86_elf_merge_gnu_properties (struct bfd_link_info *info,
 
 bfd *
 _bfd_x86_elf_link_setup_gnu_properties
-  (struct bfd_link_info *info,
-   struct elf_x86_plt_layout_table *plt_layout)
+  (struct bfd_link_info *info, struct elf_x86_init_table *init_table)
 {
   bfd_boolean normal_target;
   bfd_boolean lazy_plt;
@@ -2185,9 +2184,9 @@ error_alignment:
   if (htab == NULL)
     return pbfd;
 
-  htab->is_vxworks = plt_layout->is_vxworks;
-  htab->r_info = plt_layout->r_info;
-  htab->r_sym = plt_layout->r_sym;
+  htab->is_vxworks = init_table->is_vxworks;
+  htab->r_info = init_table->r_info;
+  htab->r_sym = init_table->r_sym;
 
   if (bfd_link_relocatable (info))
     return pbfd;
@@ -2247,24 +2246,24 @@ error_alignment:
      still be used with LD_AUDIT or LD_PROFILE if PLT entry is used for
      canonical function address.  */
   htab->plt.has_plt0 = 1;
-  normal_target = plt_layout->normal_target;
+  normal_target = init_table->normal_target;
 
   if (normal_target)
     {
       if (use_ibt_plt)
        {
-         htab->lazy_plt = plt_layout->lazy_ibt_plt;
-         htab->non_lazy_plt = plt_layout->non_lazy_ibt_plt;
+         htab->lazy_plt = init_table->lazy_ibt_plt;
+         htab->non_lazy_plt = init_table->non_lazy_ibt_plt;
        }
       else
        {
-         htab->lazy_plt = plt_layout->lazy_plt;
-         htab->non_lazy_plt = plt_layout->non_lazy_plt;
+         htab->lazy_plt = init_table->lazy_plt;
+         htab->non_lazy_plt = init_table->non_lazy_plt;
        }
     }
   else
     {
-      htab->lazy_plt = plt_layout->lazy_plt;
+      htab->lazy_plt = init_table->lazy_plt;
       htab->non_lazy_plt = NULL;
     }
 
index 6e773561f4c0c56fd4d7560302cbf406347d9e6b..8f0cad02812e95350e6c6ec550eb83b57a555cd4 100644 (file)
@@ -343,7 +343,7 @@ struct elf_x86_link_hash_table
   const char *tls_get_addr;
 };
 
-struct elf_x86_plt_layout_table
+struct elf_x86_init_table
 {
   /* The lazy PLT layout.  */
   const struct elf_x86_lazy_plt_layout *lazy_plt;
@@ -491,7 +491,7 @@ extern bfd_boolean _bfd_x86_elf_merge_gnu_properties
   (struct bfd_link_info *, bfd *, elf_property *, elf_property *);
 
 extern bfd * _bfd_x86_elf_link_setup_gnu_properties
-  (struct bfd_link_info *, struct elf_x86_plt_layout_table *);
+  (struct bfd_link_info *, struct elf_x86_init_table *);
 
 #define bfd_elf64_mkobject \
   _bfd_x86_elf_mkobject