Convert generic probe interface to C++ (and perform some cleanups)
[deliverable/binutils-gdb.git] / bfd / elfxx-x86.c
index f4466ebd5921fdedaf32e95d8a0a68b7789cc5ee..e58e3d0ebb4278860cd0855dce5dfe54cc6fa3e2 100644 (file)
@@ -108,11 +108,6 @@ elf_x86_allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
 
   resolved_to_zero = UNDEFINED_WEAK_RESOLVED_TO_ZERO (info, eh);
 
-  /* Clear the reference count of function pointer relocations if
-     symbol isn't a normal function.  */
-  if (h->type != STT_FUNC)
-    eh->func_pointer_refcount = 0;
-
   /* We can't use the GOT PLT if pointer equality is needed since
      finish_dynamic_symbol won't clear symbol value and the dynamic
      linker won't update the GOT slot.  We will get into an infinite
@@ -162,15 +157,11 @@ elf_x86_allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
   /* Don't create the PLT entry if there are only function pointer
      relocations which can be resolved at run-time.  */
   else if (htab->elf.dynamic_sections_created
-          && (h->plt.refcount > eh->func_pointer_refcount
+          && (h->plt.refcount > 0
               || eh->plt_got.refcount > 0))
     {
       bfd_boolean use_plt_got = eh->plt_got.refcount > 0;
 
-      /* Clear the reference count of function pointer relocations
-        if PLT is used.  */
-      eh->func_pointer_refcount = 0;
-
       /* Make sure this symbol is output as a dynamic symbol.
         Undefined weak syms won't yet be marked as dynamic.  */
       if (h->dynindx == -1
@@ -488,7 +479,6 @@ elf_x86_allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
         pointer initialization.  */
 
       if ((!h->non_got_ref
-          || eh->func_pointer_refcount > 0
           || (h->root.type == bfd_link_hash_undefweak
               && !resolved_to_zero))
          && ((h->def_dynamic
@@ -513,7 +503,6 @@ elf_x86_allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
        }
 
       eh->dyn_relocs = NULL;
-      eh->func_pointer_refcount = 0;
 
     keep: ;
     }
@@ -1643,15 +1632,7 @@ _bfd_x86_elf_copy_indirect_symbol (struct bfd_link_info *info,
       dir->pointer_equality_needed |= ind->pointer_equality_needed;
     }
   else
-    {
-      if (eind->func_pointer_refcount > 0)
-       {
-         edir->func_pointer_refcount += eind->func_pointer_refcount;
-         eind->func_pointer_refcount = 0;
-       }
-
-      _bfd_elf_link_hash_copy_indirect (info, dir, ind);
-    }
+    _bfd_elf_link_hash_copy_indirect (info, dir, ind);
 }
 
 /* Remove undefined weak symbol from the dynamic symbol table if it
@@ -1900,7 +1881,7 @@ _bfd_x86_elf_hide_symbol (struct bfd_link_info *info,
         weak symbol dynamic so that PC relative branch to the undefined
         weak symbol will land to address 0.  */
       struct elf_x86_link_hash_entry *eh = elf_x86_hash_entry (h);
-      if (h->plt.refcount > eh->func_pointer_refcount
+      if (h->plt.refcount > 0
          || eh->plt_got.refcount > 0)
        return;
     }
@@ -2420,7 +2401,7 @@ _bfd_x86_elf_link_setup_gnu_properties
                                              | SEC_HAS_CONTENTS
                                              | SEC_DATA));
          if (sec == NULL)
-           info->callbacks->einfo (_("%F: failed to create GNU property section\n"));
+           info->callbacks->einfo (_("%F%P: failed to create GNU property section\n"));
 
          if (!bfd_set_section_alignment (ebfd, sec, class_align))
            {
@@ -2575,7 +2556,7 @@ error_alignment:
       && !elf_vxworks_create_dynamic_sections (dynobj, info,
                                               &htab->srelplt2))
     {
-      info->callbacks->einfo (_("%F: failed to create VxWorks dynamic sections\n"));
+      info->callbacks->einfo (_("%F%P: failed to create VxWorks dynamic sections\n"));
       return pbfd;
     }
 
@@ -2584,7 +2565,7 @@ error_alignment:
      don't need to do it in check_relocs.  */
   if (htab->elf.sgot == NULL
       && !_bfd_elf_create_got_section (dynobj, info))
-    info->callbacks->einfo (_("%F: failed to create GOT sections\n"));
+    info->callbacks->einfo (_("%F%P: failed to create GOT sections\n"));
 
   got_align = (bed->target_id == X86_64_ELF_DATA) ? 3 : 2;
 
@@ -2602,7 +2583,7 @@ error_alignment:
   /* Create the ifunc sections here so that check_relocs can be
      simplified.  */
   if (!_bfd_elf_create_ifunc_sections (dynobj, info))
-    info->callbacks->einfo (_("%F: failed to create ifunc sections\n"));
+    info->callbacks->einfo (_("%F%P: failed to create ifunc sections\n"));
 
   plt_alignment = bfd_log2 (htab->plt.plt_entry_size);
 
@@ -2643,7 +2624,7 @@ error_alignment:
                                                    ".plt.got",
                                                    pltflags);
          if (sec == NULL)
-           info->callbacks->einfo (_("%F: failed to create GOT PLT section\n"));
+           info->callbacks->einfo (_("%F%P: failed to create GOT PLT section\n"));
 
          if (!bfd_set_section_alignment (dynobj, sec,
                                          non_lazy_plt_alignment))
@@ -2664,7 +2645,7 @@ error_alignment:
                                                            ".plt.sec",
                                                            pltflags);
                  if (sec == NULL)
-                   info->callbacks->einfo (_("%F: failed to create IBT-enabled PLT section\n"));
+                   info->callbacks->einfo (_("%F%P: failed to create IBT-enabled PLT section\n"));
 
                  if (!bfd_set_section_alignment (dynobj, sec,
                                                  plt_alignment))
@@ -2679,7 +2660,7 @@ error_alignment:
                                                            ".plt.sec",
                                                            pltflags);
                  if (sec == NULL)
-                   info->callbacks->einfo (_("%F: failed to create BND PLT section\n"));
+                   info->callbacks->einfo (_("%F%P: failed to create BND PLT section\n"));
 
                  if (!bfd_set_section_alignment (dynobj, sec,
                                                  non_lazy_plt_alignment))
@@ -2700,7 +2681,7 @@ error_alignment:
                                                    ".eh_frame",
                                                    flags);
          if (sec == NULL)
-           info->callbacks->einfo (_("%F: failed to create PLT .eh_frame section\n"));
+           info->callbacks->einfo (_("%F%P: failed to create PLT .eh_frame section\n"));
 
          if (!bfd_set_section_alignment (dynobj, sec, class_align))
            goto error_alignment;
@@ -2713,7 +2694,7 @@ error_alignment:
                                                        ".eh_frame",
                                                        flags);
              if (sec == NULL)
-               info->callbacks->einfo (_("%F: failed to create GOT PLT .eh_frame section\n"));
+               info->callbacks->einfo (_("%F%P: failed to create GOT PLT .eh_frame section\n"));
 
              if (!bfd_set_section_alignment (dynobj, sec, class_align))
                goto error_alignment;
@@ -2727,7 +2708,7 @@ error_alignment:
                                                        ".eh_frame",
                                                        flags);
              if (sec == NULL)
-               info->callbacks->einfo (_("%F: failed to create the second PLT .eh_frame section\n"));
+               info->callbacks->einfo (_("%F%P: failed to create the second PLT .eh_frame section\n"));
 
              if (!bfd_set_section_alignment (dynobj, sec, class_align))
                goto error_alignment;
This page took 0.027094 seconds and 4 git commands to generate.