* elf32-arm.h: Fix comment typos.
[deliverable/binutils-gdb.git] / bfd / elfxx-ia64.c
index 74049197206df76c7bc09ad12a2c36b43f3af295..49317c6cac50ae6cb8c053749c6caa5ad5a93c9c 100644 (file)
@@ -53,7 +53,7 @@
                descriptor for a MIN_PLT entry, and requires one IPLT reloc.
 
   MIN_PLT      Created by PLTOFF entries against dynamic symbols.  This
-               does not reqire dynamic relocations.  */
+               does not require dynamic relocations.  */
 
 #define NELEMS(a)      ((int) (sizeof (a) / sizeof ((a)[0])))
 
@@ -81,7 +81,7 @@ struct elfNN_ia64_dyn_sym_info
   bfd_vma dtpmod_offset;
   bfd_vma dtprel_offset;
 
-  /* The symbol table entry, if any, that this was derrived from.  */
+  /* The symbol table entry, if any, that this was derived from.  */
   struct elf_link_hash_entry *h;
 
   /* Used to count non-got, non-plt relocations for delayed sizing
@@ -194,7 +194,7 @@ static bfd_boolean elfNN_ia64_add_symbol_hook
 static int elfNN_ia64_additional_program_headers
   PARAMS ((bfd *abfd));
 static bfd_boolean elfNN_ia64_modify_segment_map
-  PARAMS ((bfd *));
+  PARAMS ((bfd *, struct bfd_link_info *));
 static bfd_boolean elfNN_ia64_is_local_label_name
   PARAMS ((bfd *abfd, const char *name));
 static bfd_boolean elfNN_ia64_dynamic_symbol_p
@@ -804,7 +804,7 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again)
 
          isym = isymbuf + ELFNN_R_SYM (irel->r_info);
          if (isym->st_shndx == SHN_UNDEF)
-           continue;   /* We can't do anthing with undefined symbols.  */
+           continue;   /* We can't do anything with undefined symbols.  */
          else if (isym->st_shndx == SHN_ABS)
            tsec = bfd_abs_section_ptr;
          else if (isym->st_shndx == SHN_COMMON)
@@ -852,7 +852,7 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again)
 
          else
            {
-             /* We can't do anthing with undefined symbols.  */
+             /* We can't do anything with undefined symbols.  */
              if (h->root.type == bfd_link_hash_undefined
                  || h->root.type == bfd_link_hash_undefweak)
                continue;
@@ -1405,8 +1405,9 @@ elfNN_ia64_additional_program_headers (abfd)
 }
 
 static bfd_boolean
-elfNN_ia64_modify_segment_map (abfd)
+elfNN_ia64_modify_segment_map (abfd, info)
      bfd *abfd;
+     struct bfd_link_info *info ATTRIBUTE_UNUSED;
 {
   struct elf_segment_map *m, **pm;
   Elf_Internal_Shdr *hdr;
@@ -1592,7 +1593,8 @@ elfNN_ia64_hash_copy_indirect (bed, xdir, xind)
     (ind->root.elf_link_hash_flags
      & (ELF_LINK_HASH_REF_DYNAMIC
         | ELF_LINK_HASH_REF_REGULAR
-        | ELF_LINK_HASH_REF_REGULAR_NONWEAK));
+        | ELF_LINK_HASH_REF_REGULAR_NONWEAK
+        | ELF_LINK_HASH_NEEDS_PLT));
 
   if (ind->root.root.type != bfd_link_hash_indirect)
     return;
@@ -1952,7 +1954,7 @@ get_got (abfd, info, ia64_info)
 }
 
 /* Create function descriptor section (.opd).  This section is called .opd
-   because it contains "official prodecure descriptors".  The "official"
+   because it contains "official procedure descriptors".  The "official"
    refers to the fact that these descriptors are used when taking the address
    of a procedure, thus ensuring a unique address for each procedure.  */
 
@@ -1992,9 +1994,9 @@ get_fptr (abfd, info, ia64_info)
       if (info->pie)
        {
          asection *fptr_rel;
-         fptr_rel = bfd_make_section(abfd, ".rela.opd");
+         fptr_rel = bfd_make_section(dynobj, ".rela.opd");
          if (fptr_rel == NULL
-             || !bfd_set_section_flags (abfd, fptr_rel,
+             || !bfd_set_section_flags (dynobj, fptr_rel,
                                         (SEC_ALLOC | SEC_LOAD
                                          | SEC_HAS_CONTENTS
                                          | SEC_IN_MEMORY
@@ -2927,6 +2929,15 @@ elfNN_ia64_size_dynamic_sections (output_bfd, info)
          if (strip)
            ia64_info->fptr_sec = NULL;
        }
+      else if (sec == ia64_info->rel_fptr_sec)
+       {
+         if (strip)
+           ia64_info->rel_fptr_sec = NULL;
+         else
+           /* We use the reloc_count field as a counter if we need to
+              copy relocs into the output file.  */
+           sec->reloc_count = 0;
+       }
       else if (sec == ia64_info->plt_sec)
        {
          if (strip)
@@ -3544,12 +3555,10 @@ static bfd_vma
 elfNN_ia64_tprel_base (info)
      struct bfd_link_info *info;
 {
-  struct elf_link_tls_segment *tls_segment
-    = elf_hash_table (info)->tls_segment;
+  asection *tls_sec = elf_hash_table (info)->tls_sec;
 
-  BFD_ASSERT (tls_segment != NULL);
-  return (tls_segment->start
-         - align_power ((bfd_vma) 16, tls_segment->align));
+  BFD_ASSERT (tls_sec != NULL);
+  return tls_sec->vma - align_power ((bfd_vma) 16, tls_sec->alignment_power);
 }
 
 /* Return the base VMA address which should be subtracted from real addresses
@@ -3560,8 +3569,8 @@ static bfd_vma
 elfNN_ia64_dtprel_base (info)
      struct bfd_link_info *info;
 {
-  BFD_ASSERT (elf_hash_table (info)->tls_segment != NULL);
-  return elf_hash_table (info)->tls_segment->start;
+  BFD_ASSERT (elf_hash_table (info)->tls_sec != NULL);
+  return elf_hash_table (info)->tls_sec->vma;
 }
 
 /* Called through qsort to sort the .IA_64.unwind section during a
@@ -3848,9 +3857,11 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section,
       if (r_symndx < symtab_hdr->sh_info)
        {
          /* Reloc against local symbol.  */
+         asection *msec;
          sym = local_syms + r_symndx;
          sym_sec = local_sections[r_symndx];
-         value = _bfd_elf_rela_local_sym (output_bfd, sym, sym_sec, rel);
+         msec = sym_sec;
+         value = _bfd_elf_rela_local_sym (output_bfd, sym, &msec, rel);
          if ((sym_sec->flags & SEC_MERGE)
              && ELF_ST_TYPE (sym->st_info) == STT_SECTION
              && sym_sec->sec_info_type == ELF_INFO_TYPE_MERGE)
@@ -3861,7 +3872,6 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section,
              if (loc_h && ! loc_h->sec_merge_done)
                {
                  struct elfNN_ia64_dyn_sym_info *dynent;
-                 asection *msec;
 
                  for (dynent = loc_h->info; dynent; dynent = dynent->next)
                    {
@@ -4900,7 +4910,6 @@ elfNN_hpux_backend_symbol_processing (bfd *abfd ATTRIBUTE_UNUSED,
 #define elf_backend_want_plt_sym       0
 #define elf_backend_plt_alignment      5
 #define elf_backend_got_header_size    0
-#define elf_backend_plt_header_size    PLT_HEADER_SIZE
 #define elf_backend_want_got_plt       1
 #define elf_backend_may_use_rel_p      1
 #define elf_backend_may_use_rela_p     1
This page took 0.026038 seconds and 4 git commands to generate.