static bool
 ecoff_collect_shuffle (struct shuffle *l, bfd_byte *buff)
 {
-  unsigned long total;
-
-  total = 0;
   for (; l != (struct shuffle *) NULL; l = l->next)
     {
       if (! l->filep)
                  != l->size))
            return false;
        }
-      total += l->size;
       buff += l->size;
     }
 
 {
   struct accumulate *ainfo = (struct accumulate *) handle;
   struct string_hash_entry *sh;
-  unsigned long total;
 
   /* The string table is written out from the hash table if this is a
      final link.  */
   BFD_ASSERT (ainfo->ss == (struct shuffle *) NULL);
   *buff++ = '\0';
-  total = 1;
   BFD_ASSERT (ainfo->ss_hash == NULL || ainfo->ss_hash->val == 1);
   for (sh = ainfo->ss_hash;
        sh != (struct string_hash_entry *) NULL;
 
       len = strlen (sh->root.string);
       memcpy (buff, sh->root.string, len + 1);
-      total += len + 1;
       buff += len + 1;
     }
 
 
       if (ELF32_R_TYPE (irel->r_info) == (int) R_MN10200_PCREL8)
        {
          Elf_Internal_Rela *nrel;
-         bfd_vma value = symval;
          unsigned char code;
 
-         /* Deal with pc-relative gunk.  */
-         value -= (sec->output_section->vma + sec->output_offset);
-         value -= (irel->r_offset + 1);
-         value += irel->r_addend;
-
          /* Do nothing if this reloc is the last byte in the section.  */
          if (irel->r_offset == sec->size)
            continue;
 
       if (ELF32_R_TYPE (irel->r_info) == (int) R_MN10300_PCREL8)
        {
          Elf_Internal_Rela *nrel;
-         bfd_vma value = symval;
          unsigned char code;
 
-         /* Deal with pc-relative gunk.  */
-         value -= (sec->output_section->vma + sec->output_offset);
-         value -= irel->r_offset;
-         value += irel->r_addend;
-
          /* Do nothing if this reloc is the last byte in the section.  */
          if (irel->r_offset == sec->size)
            continue;
 
                                   bool *changed)
 {
   Elf_Internal_Shdr *symtab_hdr;
-  struct elf_link_hash_entry **sym_hashes, **sym_hashes_end;
+  struct elf_link_hash_entry **sym_hashes;
   Elf_Internal_Rela *rel, *erel;
 
   if ((sec->flags & SEC_RELOC) == 0
 
   symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
   sym_hashes = elf_sym_hashes (abfd);
-  sym_hashes_end = sym_hashes + symtab_hdr->sh_size/sizeof(Elf32_External_Sym);
-  if (!elf_bad_symtab (abfd))
-    sym_hashes_end -= symtab_hdr->sh_info;
 
   rel = elf_section_data (sec)->relocs;
 
 
 {
   Elf_Internal_Shdr *symtab_hdr;
   Elf_Internal_Sym * isymbuf = NULL;
-  struct elf_link_hash_entry **sym_hashes, **sym_hashes_end;
+  struct elf_link_hash_entry **sym_hashes;
   const Elf_Internal_Rela *rel;
   const Elf_Internal_Rela *rel_end;
   bfd *      dynobj;
 
   symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
   sym_hashes = elf_sym_hashes (abfd);
-  sym_hashes_end = sym_hashes + symtab_hdr->sh_size/sizeof (Elf32_External_Sym);
-  if (!elf_bad_symtab (abfd))
-    sym_hashes_end -= symtab_hdr->sh_info;
 
   dynobj = elf_hash_table (info)->dynobj;
   local_got_offsets = elf_local_got_offsets (abfd);
 
                       const Elf_Internal_Rela *relocs)
 {
   Elf_Internal_Shdr *symtab_hdr;
-  struct elf_link_hash_entry **sym_hashes, **sym_hashes_end;
+  struct elf_link_hash_entry **sym_hashes;
   const Elf_Internal_Rela *rel;
   const Elf_Internal_Rela *rel_end;
   struct elf_lm32_link_hash_table *htab;
 
   symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
   sym_hashes = elf_sym_hashes (abfd);
-  sym_hashes_end = sym_hashes + symtab_hdr->sh_size/sizeof (Elf32_External_Sym);
-  if (!elf_bad_symtab (abfd))
-    sym_hashes_end -= symtab_hdr->sh_info;
 
   htab = lm32_elf_hash_table (info);
   if (htab == NULL)
 
                  if (isym->st_shndx == shndx
                      && (ELF32_ST_TYPE (isym->st_info) == STT_SECTION))
                    {
-                     bfd_vma immediate;
-
                      if (ocontents == NULL)
                        {
                          if (elf_section_data (o)->this_hdr.contents != NULL)
                              elf_section_data (o)->this_hdr.contents = ocontents;
                            }
                        }
-         unsigned long instr_hi =  bfd_get_32 (abfd, ocontents
-                                               + irelscan->r_offset);
-         unsigned long instr_lo =  bfd_get_32 (abfd, ocontents
-                                               + irelscan->r_offset
-                                               + INST_WORD_SIZE);
-         immediate = (instr_hi & 0x0000ffff) << 16;
-         immediate |= (instr_lo & 0x0000ffff);
                      offset = calc_fixup (irelscan->r_addend, 0, sec);
-                     immediate -= offset;
                      irelscan->r_addend -= offset;
                    }
                }
 {
   Elf_Internal_Shdr *          symtab_hdr;
   struct elf_link_hash_entry ** sym_hashes;
-  struct elf_link_hash_entry ** sym_hashes_end;
   const Elf_Internal_Rela *    rel;
   const Elf_Internal_Rela *    rel_end;
   struct elf32_mb_link_hash_table *htab;
 
   symtab_hdr = & elf_tdata (abfd)->symtab_hdr;
   sym_hashes = elf_sym_hashes (abfd);
-  sym_hashes_end = sym_hashes + symtab_hdr->sh_size / sizeof (Elf32_External_Sym);
-  if (!elf_bad_symtab (abfd))
-    sym_hashes_end -= symtab_hdr->sh_info;
 
   rel_end = relocs + sec->reloc_count;
 
 
                        asection *sec, const Elf_Internal_Rela *relocs)
 {
   Elf_Internal_Shdr *symtab_hdr;
-  struct elf_link_hash_entry **sym_hashes, **sym_hashes_end;
+  struct elf_link_hash_entry **sym_hashes;
   const Elf_Internal_Rela *rel;
   const Elf_Internal_Rela *rel_end;
   struct elf_link_hash_table *ehtab;
 
   symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
   sym_hashes = elf_sym_hashes (abfd);
-  sym_hashes_end =
-    sym_hashes + symtab_hdr->sh_size / sizeof (Elf32_External_Sym);
-  if (!elf_bad_symtab (abfd))
-    sym_hashes_end -= symtab_hdr->sh_info;
 
   ehtab = elf_hash_table (info);
   htab = nds32_elf_hash_table (info);
   relax_group_list_t chain = { .id = -1, .next = NULL, .next_sibling = NULL };
 
   Elf_Internal_Shdr *symtab_hdr = &elf_tdata (inbfd)->symtab_hdr;
-  struct elf_link_hash_entry **sym_hashes, **sym_hashes_end;
+  struct elf_link_hash_entry **sym_hashes;
   sym_hashes = elf_sym_hashes (inbfd);
-  sym_hashes_end =
-    sym_hashes + symtab_hdr->sh_size / sizeof (Elf32_External_Sym);
-  if (!elf_bad_symtab (inbfd))
-    sym_hashes_end -= symtab_hdr->sh_info;
 
   /* Reorder RELAX_GROUP when command line option '-r' is applied.  */
   if (bfd_link_relocatable (lnkinfo))
 
                          asection *sec, const Elf_Internal_Rela *relocs)
 {
   Elf_Internal_Shdr *symtab_hdr;
-  struct elf_link_hash_entry **sym_hashes, **sym_hashes_end;
+  struct elf_link_hash_entry **sym_hashes;
   const Elf_Internal_Rela *rel;
   const Elf_Internal_Rela *rel_end;
   struct elf32_nios2_link_hash_table *htab;
 
   symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
   sym_hashes = elf_sym_hashes (abfd);
-  sym_hashes_end = (sym_hashes
-                   + symtab_hdr->sh_size / sizeof (Elf32_External_Sym));
-  if (!elf_bad_symtab (abfd))
-    sym_hashes_end -= symtab_hdr->sh_info;
   local_got_refcounts = elf_local_got_refcounts (abfd);
 
   htab = elf32_nios2_hash_table (info);
 
 
 static bfd_reloc_status_type
 score_elf_gprel15_with_gp (bfd *abfd,
-                          asymbol *symbol,
                           arelent *reloc_entry,
                           asection *input_section,
                           bool relocateable,
                           void * data,
                           bfd_vma gp ATTRIBUTE_UNUSED)
 {
-  bfd_vma relocation;
   unsigned long insn;
 
-  if (bfd_is_com_section (symbol->section))
-    relocation = 0;
-  else
-    relocation = symbol->value;
-
-  relocation += symbol->section->output_section->vma;
-  relocation += symbol->section->output_offset;
   if (reloc_entry->address > input_section->size)
     return bfd_reloc_outofrange;
 
   if (ret != bfd_reloc_ok)
     return ret;
 
-  return score_elf_gprel15_with_gp (abfd, symbol, reloc_entry,
-                                        input_section, relocateable, data, gp);
+  return score_elf_gprel15_with_gp (abfd, reloc_entry,
+                                   input_section, relocateable, data, gp);
 }
 
 /* Do a R_SCORE_GPREL32 relocation.  This is a 32 bit value which must
 
 
 static bfd_reloc_status_type
 score_elf_gprel15_with_gp (bfd *abfd,
-                          asymbol *symbol,
                           arelent *reloc_entry,
                           asection *input_section,
                           bool relocateable,
                           void * data,
                           bfd_vma gp ATTRIBUTE_UNUSED)
 {
-  bfd_vma relocation;
   unsigned long insn;
 
-  if (bfd_is_com_section (symbol->section))
-    relocation = 0;
-  else
-    relocation = symbol->value;
-
-  relocation += symbol->section->output_section->vma;
-  relocation += symbol->section->output_offset;
   if (reloc_entry->address > input_section->size)
     return bfd_reloc_outofrange;
 
   if (ret != bfd_reloc_ok)
     return ret;
 
-  return score_elf_gprel15_with_gp (abfd, symbol, reloc_entry,
+  return score_elf_gprel15_with_gp (abfd, reloc_entry,
                                    input_section, relocateable, data, gp);
 }
 
 
 
   for (rent = dyn_i->reloc_entries; rent; rent = rent->next)
     {
-      int count = rent->count;
-
       switch (rent->type)
        {
        case R_IA64_FPTR32LSB:
        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;
        case R_IA64_DTPREL32LSB:
        case R_IA64_TPREL64LSB: