Eliminate ia64 compiler warnings. Fix ia64 gas testsuite again.
[deliverable/binutils-gdb.git] / bfd / elfxx-ia64.c
index 1e319bc34f593274a584037ef57cb51ca664ab03..56087a6e0ca8f15052c6ce9980af2c2a5f04cea9 100644 (file)
@@ -283,10 +283,10 @@ static boolean elfNN_ia64_print_private_bfd_data
 static bfd_reloc_status_type
 elfNN_ia64_reloc (abfd, reloc, sym, data, input_section,
                  output_bfd, error_message)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      arelent *reloc;
-     asymbol *sym;
-     PTR data;
+     asymbol *sym ATTRIBUTE_UNUSED;
+     PTR data ATTRIBUTE_UNUSED;
      asection *input_section;
      bfd *output_bfd;
      char **error_message;
@@ -353,7 +353,6 @@ static reloc_howto_type ia64_howto_table[] =
     IA64_HOWTO (R_IA64_LTOFF_FPTR64MSB, "LTOFF_FPTR64MSB", 4, false, true),
     IA64_HOWTO (R_IA64_LTOFF_FPTR64LSB, "LTOFF_FPTR64LSB", 4, false, true),
 
-    IA64_HOWTO (R_IA64_SEGBASE,            "SEGBASE",     4, false, true),
     IA64_HOWTO (R_IA64_SEGREL32MSB, "SEGREL32MSB", 2, false, true),
     IA64_HOWTO (R_IA64_SEGREL32LSB, "SEGREL32LSB", 2, false, true),
     IA64_HOWTO (R_IA64_SEGREL64MSB, "SEGREL64MSB", 4, false, true),
@@ -380,8 +379,6 @@ static reloc_howto_type ia64_howto_table[] =
 
     IA64_HOWTO (R_IA64_IPLTMSB,            "IPLTMSB",     4, false, true),
     IA64_HOWTO (R_IA64_IPLTLSB,            "IPLTLSB",     4, false, true),
-    IA64_HOWTO (R_IA64_EPLTMSB,            "EPLTMSB",     4, false, true),
-    IA64_HOWTO (R_IA64_EPLTLSB,            "EPLTLSB",     4, false, true),
     IA64_HOWTO (R_IA64_COPY,       "COPY",        4, false, true),
     IA64_HOWTO (R_IA64_LTOFF22X,    "LTOFF22X",           0, false, true),
     IA64_HOWTO (R_IA64_LDXMOV,     "LDXMOV",      0, false, true),
@@ -421,7 +418,7 @@ lookup_howto (rtype)
 
 static reloc_howto_type*
 elfNN_ia64_reloc_type_lookup (abfd, bfd_code)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      bfd_reloc_code_real_type bfd_code;
 {
   unsigned int rtype;
@@ -476,7 +473,6 @@ elfNN_ia64_reloc_type_lookup (abfd, bfd_code)
     case BFD_RELOC_IA64_LTOFF_FPTR64MSB: rtype = R_IA64_LTOFF_FPTR64MSB; break;
     case BFD_RELOC_IA64_LTOFF_FPTR64LSB: rtype = R_IA64_LTOFF_FPTR64LSB; break;
 
-    case BFD_RELOC_IA64_SEGBASE:       rtype = R_IA64_SEGBASE; break;
     case BFD_RELOC_IA64_SEGREL32MSB:   rtype = R_IA64_SEGREL32MSB; break;
     case BFD_RELOC_IA64_SEGREL32LSB:   rtype = R_IA64_SEGREL32LSB; break;
     case BFD_RELOC_IA64_SEGREL64MSB:   rtype = R_IA64_SEGREL64MSB; break;
@@ -499,8 +495,6 @@ elfNN_ia64_reloc_type_lookup (abfd, bfd_code)
 
     case BFD_RELOC_IA64_IPLTMSB:       rtype = R_IA64_IPLTMSB; break;
     case BFD_RELOC_IA64_IPLTLSB:       rtype = R_IA64_IPLTLSB; break;
-    case BFD_RELOC_IA64_EPLTMSB:       rtype = R_IA64_EPLTMSB; break;
-    case BFD_RELOC_IA64_EPLTLSB:       rtype = R_IA64_EPLTLSB; break;
     case BFD_RELOC_IA64_COPY:          rtype = R_IA64_COPY; break;
     case BFD_RELOC_IA64_LTOFF22X:      rtype = R_IA64_LTOFF22X; break;
     case BFD_RELOC_IA64_LDXMOV:                rtype = R_IA64_LDXMOV; break;
@@ -519,7 +513,7 @@ elfNN_ia64_reloc_type_lookup (abfd, bfd_code)
 
 static void
 elfNN_ia64_info_to_howto (abfd, bfd_reloc, elf_reloc)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      arelent *bfd_reloc;
      ElfNN_Internal_Rela *elf_reloc;
 {
@@ -609,12 +603,12 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again)
 
   Elf_Internal_Shdr *symtab_hdr;
   Elf_Internal_Rela *internal_relocs;
-  Elf_Internal_Rela *free_relocs;
+  Elf_Internal_Rela *free_relocs = NULL;
   Elf_Internal_Rela *irel, *irelend;
   bfd_byte *contents;
-  bfd_byte *free_contents;
+  bfd_byte *free_contents = NULL;
   ElfNN_External_Sym *extsyms;
-  ElfNN_External_Sym *free_extsyms;
+  ElfNN_External_Sym *free_extsyms = NULL;
   struct elfNN_ia64_link_hash_table *ia64_info;
   struct one_fixup *fixups = NULL;
   boolean changed_contents = false;
@@ -642,7 +636,7 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again)
                      link_info->keep_memory));
   if (internal_relocs == NULL)
     goto error_return;
-  free_relocs = NULL;
+
   if (! link_info->keep_memory)
     free_relocs = internal_relocs;
 
@@ -662,7 +656,6 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again)
     }
 
   /* Get the section contents.  */
-  free_contents = NULL;
   if (elf_section_data (sec)->this_hdr.contents != NULL)
     contents = elf_section_data (sec)->this_hdr.contents;
   else
@@ -678,7 +671,6 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again)
     }
 
   /* Read this BFD's symbols.  */
-  free_extsyms = NULL;
   if (symtab_hdr->contents != NULL)
     extsyms = (ElfNN_External_Sym *) symtab_hdr->contents;
   else
@@ -970,7 +962,7 @@ elfNN_ia64_section_flags (flags, hdr)
 
 static boolean
 elfNN_ia64_fake_sections (abfd, hdr, sec)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      ElfNN_Internal_Shdr *hdr;
      asection *sec;
 {
@@ -1017,14 +1009,14 @@ elfNN_ia64_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
      bfd *abfd;
      struct bfd_link_info *info;
      const Elf_Internal_Sym *sym;
-     const char **namep;
-     flagword *flagsp;
+     const char **namep ATTRIBUTE_UNUSED;
+     flagword *flagsp ATTRIBUTE_UNUSED;
      asection **secp;
      bfd_vma *valp;
 {
   if (sym->st_shndx == SHN_COMMON
       && !info->relocateable
-      && sym->st_size <= bfd_get_gp_size (abfd))
+      && sym->st_size <= (unsigned) bfd_get_gp_size (abfd))
     {
       /* Common symbols less than or equal to -G nn bytes are
         automatically put into .sbss.  */
@@ -1170,7 +1162,7 @@ elfNN_ia64_modify_segment_map (abfd)
 
 static boolean
 elfNN_ia64_is_local_label_name (abfd, name)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      const char *name;
 {
   return name[0] == '.';
@@ -1209,7 +1201,7 @@ elfNN_ia64_dynamic_symbol_p (h, info)
 static boolean
 elfNN_ia64_local_hash_table_init (ht, abfd, new)
      struct elfNN_ia64_local_hash_table *ht;
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      new_hash_entry_func new;
 {
   memset (ht, 0, sizeof(*ht));
@@ -1439,7 +1431,6 @@ elfNN_ia64_create_dynamic_sections (abfd, info)
      struct bfd_link_info *info;
 {
   struct elfNN_ia64_link_hash_table *ia64_info;
-  struct elf_link_hash_entry *h;
   asection *s;
 
   if (! _bfd_elf_create_dynamic_sections (abfd, info))
@@ -1513,7 +1504,7 @@ get_dyn_sym_info (ia64_info, h, abfd, rel, create)
       len += 10;       /* %p slop */
 
       addr_name = alloca (len);
-      sprintf (addr_name, "%p:%lx", abfd, ELFNN_R_SYM (rel->r_info));
+      sprintf (addr_name, "%p:%lx", (void *) abfd, ELFNN_R_SYM (rel->r_info));
 
       /* Collect the canonical entry data for this address.  */
       loc_h = elfNN_ia64_local_hash_lookup (&ia64_info->loc_hash_table,
@@ -1543,7 +1534,7 @@ get_got (abfd, info, ia64_info)
      struct bfd_link_info *info;
      struct elfNN_ia64_link_hash_table *ia64_info;
 {
-  asection *got, *srel;
+  asection *got;
   bfd *dynobj;
 
   got = ia64_info->got_sec;
@@ -1576,7 +1567,7 @@ get_got (abfd, info, ia64_info)
 static asection *
 get_fptr (abfd, info, ia64_info)
      bfd *abfd;
-     struct bfd_link_info *info;
+     struct bfd_link_info *info ATTRIBUTE_UNUSED;
      struct elfNN_ia64_link_hash_table *ia64_info;
 {
   asection *fptr;
@@ -1613,7 +1604,7 @@ get_fptr (abfd, info, ia64_info)
 static asection *
 get_pltoff (abfd, info, ia64_info)
      bfd *abfd;
-     struct bfd_link_info *info;
+     struct bfd_link_info *info ATTRIBUTE_UNUSED;
      struct elfNN_ia64_link_hash_table *ia64_info;
 {
   asection *pltoff;
@@ -1764,7 +1755,7 @@ elfNN_ia64_check_relocs (abfd, info, sec, relocs)
       struct elfNN_ia64_dyn_sym_info *dyn_i;
       int need_entry;
       boolean maybe_dynamic;
-      int dynrel_type;
+      int dynrel_type = R_IA64_NONE;
 
       if (r_symndx >= symtab_hdr->sh_info)
        {
@@ -1864,6 +1855,14 @@ elfNN_ia64_check_relocs (abfd, info, sec, relocs)
          dynrel_type = R_IA64_DIR64LSB;
          break;
 
+       case R_IA64_IPLTMSB:
+       case R_IA64_IPLTLSB:
+         /* Shared objects will always need at least a REL relocation.  */
+         if (info->shared || maybe_dynamic)
+           need_entry = NEED_DYNREL;
+         dynrel_type = R_IA64_IPLTLSB;
+         break;
+
        case R_IA64_PCREL22:
        case R_IA64_PCREL64I:
        case R_IA64_PCREL32MSB:
@@ -2184,6 +2183,8 @@ allocate_dynrel_entries (dyn_i, data)
 
   for (rent = dyn_i->reloc_entries; rent; rent = rent->next)
     {
+      int count = rent->count;
+
       switch (rent->type)
        {
        case R_IA64_FPTR64LSB:
@@ -2201,8 +2202,18 @@ allocate_dynrel_entries (dyn_i, data)
          if (!dynamic_symbol && !shared)
            continue;
          break;
+       case R_IA64_IPLTLSB:
+         if (!dynamic_symbol && !shared)
+           continue;
+         /* Use two REL relocations for IPLT relocations
+            against local symbols.  */
+         if (!dynamic_symbol)
+           count *= 2;
+         break;
+       default:
+         abort ();
        }
-      rent->srel->_raw_size += sizeof (ElfNN_External_Rela) * rent->count;
+      rent->srel->_raw_size += sizeof (ElfNN_External_Rela) * count;
     }
 
   /* Take care of the GOT and PLT relocations.  */
@@ -2231,7 +2242,7 @@ allocate_dynrel_entries (dyn_i, data)
 
 static boolean
 elfNN_ia64_adjust_dynamic_symbol (info, h)
-     struct bfd_link_info *info;
+     struct bfd_link_info *info ATTRIBUTE_UNUSED;
      struct elf_link_hash_entry *h;
 {
   /* ??? Undefined symbols with PLT entries should be re-defined
@@ -2286,36 +2297,6 @@ elfNN_ia64_size_dynamic_sections (output_bfd, info)
       sec->_raw_size = strlen (ELF_DYNAMIC_INTERPRETER) + 1;
     }
 
-  /* DT_INIT and DT_FINI get function descriptors not raw code addresses.
-     Force their symbols to have pltoff entries so we can use those.  */
-  if (ia64_info->root.dynamic_sections_created)
-    {
-      struct elf_link_hash_entry *h;
-      struct elfNN_ia64_dyn_sym_info *dyn_i;
-      if (info->init_function
-         && (h = elf_link_hash_lookup (elf_hash_table (info), 
-                                       info->init_function, false,
-                                       false, false))
-          && (h->elf_link_hash_flags & (ELF_LINK_HASH_REF_REGULAR
-                                        | ELF_LINK_HASH_DEF_REGULAR)) != 0)
-        {
-         dyn_i = get_dyn_sym_info (ia64_info, h, output_bfd, NULL, true);
-         dyn_i->want_pltoff = 1;
-        }
-
-      if (info->fini_function
-         && (h = elf_link_hash_lookup (elf_hash_table (info), 
-                                       info->fini_function, false,
-                                       false, false))
-          && (h->elf_link_hash_flags & (ELF_LINK_HASH_REF_REGULAR
-                                        | ELF_LINK_HASH_DEF_REGULAR)) != 0)
-        {
-         dyn_i = get_dyn_sym_info (ia64_info, h, output_bfd, NULL, true);
-         dyn_i->want_pltoff = 1;
-        }
-    }
-
   /* Allocate the GOT entries.  */
 
   if (ia64_info->got_sec)
@@ -2639,25 +2620,6 @@ elfNN_ia64_install_value (abfd, hit_addr, val, r_type)
       break;
 
       /* Unsupported / Dynamic relocations.  */
-
-    case R_IA64_REL32MSB:
-    case R_IA64_REL32LSB:
-    case R_IA64_REL64MSB:
-    case R_IA64_REL64LSB:
-
-    case R_IA64_IPLTMSB:
-    case R_IA64_IPLTLSB:
-    case R_IA64_EPLTMSB:
-    case R_IA64_EPLTLSB:
-    case R_IA64_COPY:
-
-    case R_IA64_SEGBASE:
-
-    case R_IA64_TPREL22:
-    case R_IA64_TPREL64MSB:
-    case R_IA64_TPREL64LSB:
-    case R_IA64_LTOFF_TP22:
-
     default:
       return bfd_reloc_notsupported;
     }
@@ -2937,10 +2899,11 @@ set_pltoff_entry (abfd, info, dyn_i, value, is_plt)
   if ((! dyn_i->want_plt || is_plt)
       && !dyn_i->pltoff_done)
     {
+      bfd_vma gp = _bfd_get_gp_value (abfd);
+
       /* Fill in the function descriptor.  */
       bfd_put_64 (abfd, value, pltoff_sec->contents + dyn_i->pltoff_offset);
-      bfd_put_64 (abfd, _bfd_get_gp_value (abfd),
-                 pltoff_sec->contents + dyn_i->pltoff_offset + 8);
+      bfd_put_64 (abfd, gp, pltoff_sec->contents + dyn_i->pltoff_offset + 8);
 
       /* Install dynamic relocations if needed.  */
       if (!is_plt && info->shared)
@@ -2955,11 +2918,11 @@ set_pltoff_entry (abfd, info, dyn_i, value, is_plt)
          elfNN_ia64_install_dyn_reloc (abfd, NULL, pltoff_sec,
                                        ia64_info->rel_pltoff_sec,
                                        dyn_i->pltoff_offset,
-                                       dyn_r_type, 0, 0);
+                                       dyn_r_type, 0, value);
          elfNN_ia64_install_dyn_reloc (abfd, NULL, pltoff_sec,
                                        ia64_info->rel_pltoff_sec,
                                        dyn_i->pltoff_offset + 8,
-                                       dyn_r_type, 0, 0);
+                                       dyn_r_type, 0, gp);
        }
 
       dyn_i->pltoff_done = 1;
@@ -2998,6 +2961,8 @@ elfNN_ia64_final_link (abfd, info)
      struct bfd_link_info *info;
 {
   struct elfNN_ia64_link_hash_table *ia64_info;
+  asection *unwind_output_sec;
+
   ia64_info = elfNN_ia64_hash_table (info);
 
   /* Make sure we've got ourselves a nice fat __gp value.  */
@@ -3110,75 +3075,37 @@ elfNN_ia64_final_link (abfd, info)
       _bfd_set_gp_value (abfd, gp_val);
     }
 
-  /* Tricky bits.  DT_INIT and DT_FINI use a pltoff entry, which is
-     normally initialized in finish_dynamic_sections.  Except that
-     we need all non-plt pltoff entries to be initialized before
-     finish_dynamic_symbols.  This because the array of relocations
-     used for plt entries (aka DT_JMPREL) begins after all the 
-     non-plt pltoff relocations.  If the order gets confused, we
-     munge either the array or the array base.  */
-  if (ia64_info->root.dynamic_sections_created)
-    {
-      struct elf_link_hash_entry *h;
-      struct elfNN_ia64_dyn_sym_info *dyn_i;
-      bfd_vma addr;
-      if (info->init_function
-         && (h = elf_link_hash_lookup (elf_hash_table (info), 
-                                       info->init_function, false,
-                                       false, false))
-          && (h->elf_link_hash_flags & (ELF_LINK_HASH_REF_REGULAR
-                                        | ELF_LINK_HASH_DEF_REGULAR)) != 0)
-        {
-         dyn_i = get_dyn_sym_info (ia64_info, h, NULL, NULL, false);
-         addr = (h->root.u.def.section->output_section->vma
-                 + h->root.u.def.section->output_offset
-                 + h->root.u.def.value);
-         (void) set_pltoff_entry (abfd, info, dyn_i, addr, false);
-        }
-
-      if (info->fini_function
-         && (h = elf_link_hash_lookup (elf_hash_table (info), 
-                                       info->fini_function, false,
-                                       false, false))
-          && (h->elf_link_hash_flags & (ELF_LINK_HASH_REF_REGULAR
-                                        | ELF_LINK_HASH_DEF_REGULAR)) != 0)
-        {
-         dyn_i = get_dyn_sym_info (ia64_info, h, NULL, NULL, false);
-         addr = (h->root.u.def.section->output_section->vma
-                 + h->root.u.def.section->output_offset
-                 + h->root.u.def.value);
-         (void) set_pltoff_entry (abfd, info, dyn_i, addr, false);
-        }
-    }
-
-  /* Invoke the regular ELF backend linker to do all the work.  */
-  if (!bfd_elfNN_bfd_final_link (abfd, info))
-    return false;
-
   /* If we're producing a final executable, we need to sort the contents
-     of the .IA_64.unwind section.  */
+     of the .IA_64.unwind section.  Force this section to be relocated
+     into memory rather than written immediately to the output file.  */
+  unwind_output_sec = NULL;
   if (!info->relocateable)
     {
       asection *s = bfd_get_section_by_name (abfd, ELF_STRING_ia64_unwind);
       if (s)
        {
-         bfd_size_type size = s->output_section->_raw_size;
-         char *contents = bfd_malloc (size);
-
-         if (contents == NULL)
-           return false;
-         if (! bfd_get_section_contents (abfd, s->output_section,
-                                         contents, (file_ptr) 0, size))
+         unwind_output_sec = s->output_section;
+         unwind_output_sec->contents
+           = bfd_malloc (unwind_output_sec->_raw_size);
+         if (unwind_output_sec->contents == NULL)
            return false;
+       }
+    }
 
-         elfNN_ia64_unwind_entry_compare_bfd = abfd;
-         qsort (contents, size / 24, 24, elfNN_ia64_unwind_entry_compare);
+  /* Invoke the regular ELF backend linker to do all the work.  */
+  if (!bfd_elfNN_bfd_final_link (abfd, info))
+    return false;
 
-         if (! bfd_set_section_contents (abfd, s->output_section,
-                                         contents, (file_ptr) 0, size))
-           return false;
-       }
+  if (unwind_output_sec)
+    {
+      elfNN_ia64_unwind_entry_compare_bfd = abfd;
+      qsort (unwind_output_sec->contents, unwind_output_sec->_raw_size / 24,
+            24, elfNN_ia64_unwind_entry_compare);
+
+      if (! bfd_set_section_contents (abfd, unwind_output_sec,
+                                     unwind_output_sec->contents, 0,
+                                     unwind_output_sec->_raw_size))
+       return false;
     }
 
   return true;
@@ -3360,6 +3287,7 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section,
            {
              unsigned int dyn_r_type;
              long dynindx;
+             bfd_vma addend;
 
              BFD_ASSERT (srel != NULL);
 
@@ -3367,7 +3295,11 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section,
                 matching RELATIVE relocation.  */
              dyn_r_type = r_type;
              if (dynamic_symbol_p)
-               dynindx = h->dynindx;
+               {
+                 dynindx = h->dynindx;
+                 addend = rel->r_addend;
+                 value = 0;
+               }
              else
                {
                  switch (r_type)
@@ -3399,11 +3331,12 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section,
                      continue;
                    }
                  dynindx = 0;
+                 addend = value;
                }
 
              elfNN_ia64_install_dyn_reloc (output_bfd, info, input_section,
                                            srel, rel->r_offset, dyn_r_type,
-                                           dynindx, rel->r_addend);
+                                           dynindx, addend);
            }
          /* FALLTHRU */
 
@@ -3672,23 +3605,49 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section,
          r = elfNN_ia64_install_value (output_bfd, hit_addr, value, r_type);
          break;
 
-       case R_IA64_SEGBASE:
-
-       case R_IA64_REL32MSB:
-       case R_IA64_REL32LSB:
-       case R_IA64_REL64MSB:
-       case R_IA64_REL64LSB:
-
        case R_IA64_IPLTMSB:
        case R_IA64_IPLTLSB:
-       case R_IA64_EPLTMSB:
-       case R_IA64_EPLTLSB:
-       case R_IA64_COPY:
+         /* Install a dynamic relocation for this reloc.  */
+         if ((dynamic_symbol_p || info->shared)
+             && (input_section->flags & SEC_ALLOC) != 0)
+           {
+             BFD_ASSERT (srel != NULL);
+
+             /* If we don't need dynamic symbol lookup, install two
+                RELATIVE relocations.  */
+             if (! dynamic_symbol_p)
+               {
+                 unsigned int dyn_r_type;
+               
+                 if (r_type == R_IA64_IPLTMSB)
+                   dyn_r_type = R_IA64_REL64MSB;
+                 else
+                   dyn_r_type = R_IA64_REL64LSB;
+
+                 elfNN_ia64_install_dyn_reloc (output_bfd, info,
+                                               input_section,
+                                               srel, rel->r_offset,
+                                               dyn_r_type, 0, value);
+                 elfNN_ia64_install_dyn_reloc (output_bfd, info,
+                                               input_section,
+                                               srel, rel->r_offset + 8,
+                                               dyn_r_type, 0, gp_val);
+               }
+             else
+               elfNN_ia64_install_dyn_reloc (output_bfd, info, input_section,
+                                             srel, rel->r_offset, r_type,
+                                             h->dynindx, rel->r_addend);
+           }
+
+         if (r_type == R_IA64_IPLTMSB)
+           r_type = R_IA64_DIR64MSB;
+         else
+           r_type = R_IA64_DIR64LSB;
+         elfNN_ia64_install_value (output_bfd, hit_addr, value, r_type);
+         r = elfNN_ia64_install_value (output_bfd, hit_addr + 8, gp_val,
+                                       r_type);
+         break;
 
-       case R_IA64_TPREL22:
-       case R_IA64_TPREL64MSB:
-       case R_IA64_TPREL64LSB:
-       case R_IA64_LTOFF_TP22:
        default:
          r = bfd_reloc_notsupported;
          break;
@@ -3885,8 +3844,6 @@ elfNN_ia64_finish_dynamic_sections (abfd, info)
       for (; dyncon < dynconend; dyncon++)
        {
          Elf_Internal_Dyn dyn;
-         const char *name;
-         asection *s;
 
          bfd_elfNN_swap_dyn_in (dynobj, dyncon, &dyn);
 
@@ -3920,25 +3877,6 @@ elfNN_ia64_finish_dynamic_sections (abfd, info)
              dyn.d_un.d_val -= (ia64_info->minplt_entries
                                 * sizeof (ElfNN_External_Rela));
              break;
-
-           case DT_INIT:
-           case DT_FINI:
-             {
-               struct elf_link_hash_entry *h;
-               struct elfNN_ia64_dyn_sym_info *dyn_i;
-               const char *which;
-               if (dyn.d_tag == DT_INIT)
-                 which = info->init_function;
-               else
-                 which = info->fini_function;
-
-               h = elf_link_hash_lookup (elf_hash_table (info), which,
-                                         false, false, false);
-               dyn_i = get_dyn_sym_info (ia64_info, h, NULL, NULL, false);
-               dyn.d_un.d_ptr = set_pltoff_entry (abfd, info, dyn_i,
-                                                  dyn.d_un.d_ptr, 0);
-             }
            }
 
          bfd_elfNN_swap_dyn_out (abfd, &dyn, dyncon);
This page took 0.030441 seconds and 4 git commands to generate.