* ChangeLog: Fix typos.
[deliverable/binutils-gdb.git] / bfd / elf64-ppc.c
index 8ae3f12ed888625b8c75e5065a03763e96978026..1282b3b524a1c9444e19a2234a6f916724a2ce0d 100644 (file)
@@ -2641,7 +2641,7 @@ struct plt_entry
    pointers must reference the descriptor.  Thus, a function pointer
    initialized to the address of a function in a shared library will
    either require a copy reloc, or a dynamic reloc.  Using a copy reloc
-   redefines the function desctriptor symbol to point to the copy.  This
+   redefines the function descriptor symbol to point to the copy.  This
    presents a problem as a plt entry for that function is also
    initialized from the function descriptor symbol and the copy reloc
    may not be initialized first.  */
@@ -3359,7 +3359,8 @@ ppc64_elf_copy_indirect_symbol
   edir->tls_mask |= eind->tls_mask;
 
   mask = (ELF_LINK_HASH_REF_DYNAMIC | ELF_LINK_HASH_REF_REGULAR
-         | ELF_LINK_HASH_REF_REGULAR_NONWEAK | ELF_LINK_NON_GOT_REF);
+         | ELF_LINK_HASH_REF_REGULAR_NONWEAK | ELF_LINK_NON_GOT_REF
+         | ELF_LINK_HASH_NEEDS_PLT);
   /* If called to transfer flags for a weakdef during processing
      of elf_adjust_dynamic_symbol, don't copy ELF_LINK_NON_GOT_REF.
      We clear it ourselves for ELIMINATE_COPY_RELOCS.  */
@@ -6069,8 +6070,9 @@ ppc_type_of_stub (asection *input_sec,
              }
        }
 
-      if (h->elf.root.type != bfd_link_hash_defined
-         && h->elf.root.type != bfd_link_hash_defweak)
+      if (!(h->elf.root.type == bfd_link_hash_defined
+           || h->elf.root.type == bfd_link_hash_defweak)
+         || h->elf.root.u.def.section->output_section == NULL)
        return ppc_stub_none;
     }
 
@@ -6565,6 +6567,9 @@ toc_adjusting_stub_needed (struct bfd_link_info *info, asection *isec)
   if ((isec->flags & SEC_LINKER_CREATED) != 0)
     return 0;
 
+  if (isec->_raw_size == 0)
+    return 0;
+
   /* Hack for linux kernel.  .fixup contains branches, but only back to
      the function that hit an exception.  */
   branch_ok = strcmp (isec->name, ".fixup") == 0;
This page took 0.027424 seconds and 4 git commands to generate.