This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

fix build when using gcc-4.6


gcc-4.6 warns when variables are set but not otherwise used.  Of
course this warning triggers all over the place in binutils, due to
our habit of copying functions then editing.

bfd/
	* bout.c (aligncode): Delete set but unused variables.
	* coff-mcore.c (coff_mcore_relocate_section): Likewise.
	* coff-ppc.c (ppc_record_toc_entry): Likewise.
	(coff_ppc_relocate_section): Likewise.
	* coff-rs6000.c (xcoff_complain_overflow_bitfield_func): Likewise.
	* elf-m10200.c (mn10200_elf_relax_delete_bytes): Likewise.
	* elf-m10300.c (mn10300_elf_final_link_relocate): Likewise.
	(mn10300_elf_relax_section): Likewise.
	* elf32-arm.c (arm_build_one_stub, arm_size_one_stub): Likewise.
	(record_vfp11_erratum_veneer): Likewise.
	(bfd_elf32_arm_vfp11_erratum_scan): Likewise.
	(elf32_arm_final_link_relocate): Likewise.
	(elf32_arm_check_relocs, arm_map_one_stub): Likewise.
	* elf32-avr.c (elf32_avr_relax_delete_bytes): Likewise.
	(elf32_avr_relax_section): Likewise.
	(avr_mark_stub_not_to_be_necessary): Likewise.
	* elf32-bfin.c (_bfin_create_got_section): Likewise.
	* elf32-cr16.c (cr16_elf_final_link_relocate): Likewise.
	(elf32_cr16_relax_delete_bytes): Likewise.
	* elf32-cr16c.c (cr16c_elf_final_link_relocate): Likewise.
	* elf32-cris.c (elf_cris_finish_dynamic_symbol): Likewise.
	* elf32-crx.c (elf32_crx_relax_delete_bytes): Likewise.
	* elf32-h8300.c (elf32_h8_relax_section): Likewise.
	(elf32_h8_relax_delete_bytes): Likewise.
	* elf32-hppa.c (elf32_hppa_check_relocs): Likewise.
	* elf32-i370.c (i370_elf_check_relocs): Likewise.
	(elf_relocate_section): Likewise.
	* elf32-ip2k.c (adjust_all_relocations): Likewise.
	(ip2k_elf_relax_section): Likewise.
	* elf32-lm32.c (lm32_elf_relocate_section): Likewise.
	(lm32_elf_check_relocs): Likewise.
	(lm32_elf_finish_dynamic_sections): Likewise.
	(lm32_elf_finish_dynamic_symbol): Likewise.
	* elf32-m32c.c (m32c_offset_for_reloc): Likewise.
	(m32c_elf_relax_delete_bytes): Likewise.
	* elf32-m32r.c (m32r_elf_finish_dynamic_symbol): Likewise.
	(m32r_elf_finish_dynamic_sections): Likewise.
	(m32r_elf_check_relocs, m32r_elf_fake_sections): Likewise.
	* elf32-m68hc11.c (m68hc11_elf_relax_section): Likewise.
	* elf32-m68hc1x.c (elf32_m68hc11_relocate_section): Likewise.
	* elf32-m68k.c (elf_m68k_gc_sweep_hook): Likewise.
	* elf32-microblaze.c (microblaze_elf_relocate_section): Likewise.
	(microblaze_elf_check_relocs): Likewise.
	(microblaze_elf_finish_dynamic_symbol): Likewise.
	* elf32-msp430.c (msp430_elf_relax_delete_bytes): Likewise.
	* elf32-ppc.c (ppc_elf_tls_optimize): Likewise.
	* elf32-rx.c (rx_elf_relocate_section): Likewise.
	(elf32_rx_relax_delete_bytes, rx_offset_for_reloc): Likewise.
	(elf32_rx_relax_section): Likewise.
	* elf32-score.c (score_elf_got_offset_from_index): Likewise.
	(score_elf_final_link_relocate): Likewise.
	(s3_bfd_score_elf_relocate_section): Likewise.
	* elf32-score7.c (score_elf_got_offset_from_index): Likewise.
	(s7_bfd_score_elf_relocate_section): Likewise.
	* elf32-sh.c (sh_elf_check_relocs): Likewise.
	* elf32-spu.c (spu_elf_relocate_section): Likewise.
	* elf32-v850.c (v850_elf_check_relocs): Likewise.
	(find_remembered_hi16s_reloc): Likewise.
	* elf32-vax.c (elf32_vax_merge_private_bfd_data): Likewise.
	(elf_vax_relocate_section): Likewise.
	* elf32-xc16x.c (elf32_xc16x_relocate_section): Likewise.
	* elf32-xtensa.c (xlate_offset_with_removed_text): Likewise.
	(move_literal): Likewise.
	* elf64-hppa.c (elf64_hppa_section_from_shdr): Likewise.
	(elf64_hppa_check_relocs): Likewise.
	(elf64_hppa_finish_dynamic_symbol): Likewise.
	(elf64_hppa_relocate_section): Likewise.
	* elf64-mmix.c (mmix_elf_reloc, mmix_elf_relax_section): Likewise.
	* elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
	(ppc64_elf_edit_opd, ppc64_elf_edit_toc): Likewise.
	* elfxx-ia64.c (elfNN_ia64_section_from_shdr): Likewise.
	(elfNN_vms_section_from_shdr): Likewise.
	* elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise.
	(_bfd_sparc_elf_relocate_section): Likewise.
	* hp300hpux.c (slurp_symbol_table): Likewise.
	* i386lynx.c (swap_std_reloc_out, swap_std_reloc_in): Likewise.
	* mach-o.c (bfd_mach_o_write_thread): Likewise.
	* mmo.c (mmo_scan, mmo_write_symbols_and_terminator): Likewise.
	* nlm32-sparc.c (nlm_sparc_read_reloc): Likewise.
	* pdp11.c (pdp11_aout_link_input_section): Likewise.
	(aout_link_input_section, aout_link_input_bfd): Likewise.
	* pe-mips.c (mips_swap_reloc_out): Likewise.
	(coff_pe_mips_relocate_section): Likewise.
	* som.c (som_bfd_ar_write_symbol_stuff): Likewise.
	* vms-alpha.c (_bfd_vms_slurp_egsd): Likewise.
	* xsym.c (bfd_sym_fetch_type_information_table_ent): Likewise.

	* coff-i860.c (i860_reloc_processing): Avoid set but unused warning.
	* coffcode.h (coff_compute_section_file_positions): Likewise.
	(coff_slurp_reloc_table): Likewise.
	* cpu-arm.c (arm_check_note): Likewise.
	* elf-bfd.h (RELOC_FOR_GLOBAL_SYMBOL): Likewise.
	* elf32-avr.c (elf32_avr_relocate_section): Likewise.
	* elf32-bfin.c (elf32_bfin_merge_private_bfd_data): Likewise.
	* elf32-ip2k.c (ip2k_elf_relocate_section): Likewise.
	* elf32-moxie.c (moxie_elf_relocate_section): Likewise.
	* elf32-msp430.c (elf32_msp430_relocate_section): Likewise.
	* elf32-sh64.c (_bfd_sh_align_load_span): Likewise.
	* ieee.c (parse_expression): Likewise.
	(ieee_slurp_external_symbols, drop_int): Likewise.
	* peXXigen.c (pe_print_pdata): Likewise.
	* versados.c (process_esd): Likewise.

opcodes/
	* arc-dis.c (arc_sprintf): Delete set but unused variables.
	(decodeInstr): Likewise.
	* dlx-dis.c (print_insn_dlx): Likewise.
	* h8300-dis.c (bfd_h8_disassemble_init): Likewise.
	* maxq-dis.c (check_move, print_insn): Likewise.
	* mep-dis.c (mep_examine_ivc2_insns): Likewise.
	* msp430-dis.c (msp430_branchinstr): Likewise.
	* bfin-dis.c (_print_insn_bfin): Avoid set but unused warning.
	* cgen-asm.in (parse_insn_normal, _cgen_assemble_insn): Likewise.
	* sparc-dis.c (print_insn_sparc): Likewise.
	* fr30-asm.c: Regenerate.
	* frv-asm.c: Regenerate.
	* ip2k-asm.c: Regenerate.
	* iq2000-asm.c: Regenerate.
	* lm32-asm.c: Regenerate.
	* m32c-asm.c: Regenerate.
	* m32r-asm.c: Regenerate.
	* mep-asm.c: Regenerate.
	* mt-asm.c: Regenerate.
	* openrisc-asm.c: Regenerate.
	* xc16x-asm.c: Regenerate.
	* xstormy16-asm.c: Regenerate.

binutils/
	* resbin.c (res_to_bin_accelerator): Delete set but unused variables.

ld/
	* pe-dll.c (fill_edata): Avoid set but unused warning.
	(pe_walk_relocs_of_symbol): Delete set but unused variables.
	(generate_reloc, pe_implied_import_dll): Likewise.
	* emultempl/aix.em (open_dynamic_archive): Likewise.
	* emultempl/xtensaelf.em (replace_insn_sec_with_prop_sec): Likewise.
	(xtensa_layout_wild): Likewise.
	(xtensa_colocate_output_literals_callback): Likewise.

Index: bfd/bout.c
===================================================================
RCS file: /cvs/src/src/bfd/bout.c,v
retrieving revision 1.35
diff -u -p -r1.35 bout.c
--- bfd/bout.c	23 Nov 2009 14:41:28 -0000	1.35
+++ bfd/bout.c	27 Jun 2010 02:51:14 -0000
@@ -1094,7 +1094,6 @@ aligncode (bfd *abfd,
 	   unsigned int shrink)
 {
   bfd_vma dot = output_addr (input_section) + r->address;
-  bfd_vma gap;
   bfd_vma old_end;
   bfd_vma new_end;
   unsigned int shrink_delta;
@@ -1110,9 +1109,6 @@ aligncode (bfd *abfd,
      than we used to be.  */
   new_end = ((dot - shrink + size) & ~size);
 
-  /* This is the new end.  */
-  gap = old_end - ((dot + size) & ~size);
-
   shrink_delta = (old_end - new_end) - shrink;
 
   if (shrink_delta)
Index: bfd/coff-i860.c
===================================================================
RCS file: /cvs/src/src/bfd/coff-i860.c,v
retrieving revision 1.23
diff -u -p -r1.23 coff-i860.c
--- bfd/coff-i860.c	18 Jul 2008 11:30:22 -0000	1.23
+++ bfd/coff-i860.c	27 Jun 2010 02:51:14 -0000
@@ -629,6 +629,7 @@ i860_reloc_processing (arelent *cache_pt
 
       /* Calculate any reloc addend by looking at the symbol.  */
       CALC_ADDEND (abfd, ptr, (*dst), cache_ptr);
+      (void) ptr;
 
       cache_ptr->address -= asect->vma;
 
Index: bfd/coff-mcore.c
===================================================================
RCS file: /cvs/src/src/bfd/coff-mcore.c,v
retrieving revision 1.39
diff -u -p -r1.39 coff-mcore.c
--- bfd/coff-mcore.c	15 Oct 2007 02:00:11 -0000	1.39
+++ bfd/coff-mcore.c	27 Jun 2010 02:51:14 -0000
@@ -370,8 +370,6 @@ coff_mcore_relocate_section (output_bfd,
 {
   struct internal_reloc * rel;
   struct internal_reloc * relend;
-  bfd_boolean hihalf;
-  bfd_vma hihalf_val;
 
   /* If we are performing a relocatable link, we don't need to do a
      thing.  The caller will take care of adjusting the reloc
@@ -393,9 +391,6 @@ coff_mcore_relocate_section (output_bfd,
       return FALSE;
     }
 
-  hihalf = FALSE;
-  hihalf_val = 0;
-
   rel = relocs;
   relend = rel + input_section->reloc_count;
 
Index: bfd/coff-ppc.c
===================================================================
RCS file: /cvs/src/src/bfd/coff-ppc.c,v
retrieving revision 1.37
diff -u -p -r1.37 coff-ppc.c
--- bfd/coff-ppc.c	3 Jan 2009 16:19:52 -0000	1.37
+++ bfd/coff-ppc.c	27 Jun 2010 02:51:15 -0000
@@ -867,8 +867,6 @@ ppc_record_toc_entry(abfd, info, sec, sy
      enum toc_type toc_kind ATTRIBUTE_UNUSED;
 {
   struct ppc_coff_link_hash_entry *h;
-  const char *name;
-
   int *local_syms;
 
   h = 0;
@@ -917,8 +915,6 @@ ppc_record_toc_entry(abfd, info, sec, sy
     }
   else
     {
-      name = h->root.root.root.string;
-
       /* Check to see if there's a toc slot allocated. If not, do it
 	 here. It will be used in relocate_section.  */
       if (IS_UNALLOCATED(h->toc_offset))
@@ -1010,8 +1006,6 @@ coff_ppc_relocate_section (output_bfd, i
 {
   struct internal_reloc *rel;
   struct internal_reloc *relend;
-  bfd_boolean hihalf;
-  bfd_vma hihalf_val;
   asection *toc_section = 0;
   bfd_vma relocation;
   reloc_howto_type *howto = 0;
@@ -1022,9 +1016,6 @@ coff_ppc_relocate_section (output_bfd, i
   if (info->relocatable)
     return TRUE;
 
-  hihalf = FALSE;
-  hihalf_val = 0;
-
   rel = relocs;
   relend = rel + input_section->reloc_count;
   for (; rel < relend; rel++)
@@ -1275,17 +1266,12 @@ coff_ppc_relocate_section (output_bfd, i
 	       appearing on the call instruction is a glue function or not.
 	       A glue function must announce itself via a IMGLUE reloc, and 
 	       the reloc contains the required toc restore instruction.  */
-	    bfd_vma x;
-	    const char *my_name;
-	    
 	    DUMP_RELOC2 (howto->name, rel);
 
 	    if (h != 0)
 	      {
-		my_name = h->root.root.root.string;
 		if (h->symbol_is_glue == 1)
 		  {
-		    x = bfd_get_32 (input_bfd, loc);
 		    bfd_put_32 (input_bfd, (bfd_vma) h->glue_insn, loc);
 		  }
 	      }
Index: bfd/coff-rs6000.c
===================================================================
RCS file: /cvs/src/src/bfd/coff-rs6000.c,v
retrieving revision 1.96
diff -u -p -r1.96 coff-rs6000.c
--- bfd/coff-rs6000.c	24 Mar 2010 15:41:58 -0000	1.96
+++ bfd/coff-rs6000.c	27 Jun 2010 02:51:17 -0000
@@ -3071,7 +3071,7 @@ xcoff_complain_overflow_bitfield_func (i
      bfd_vma relocation;
      struct reloc_howto_struct *howto;
 {
-  bfd_vma addrmask, fieldmask, signmask, ss;
+  bfd_vma fieldmask, signmask, ss;
   bfd_vma a, b, sum;
 
   /* Get the values to be added together.  For signed and unsigned
@@ -3079,7 +3079,6 @@ xcoff_complain_overflow_bitfield_func (i
      the size of an address.  For bitfields, all the bits matter.
      See also bfd_check_overflow.  */
   fieldmask = N_ONES (howto->bitsize);
-  addrmask = N_ONES (bfd_arch_bits_per_address (input_bfd)) | fieldmask;
   a = relocation;
   b = val & howto->src_mask;
 
Index: bfd/coffcode.h
===================================================================
RCS file: /cvs/src/src/bfd/coffcode.h,v
retrieving revision 1.165
diff -u -p -r1.165 coffcode.h
--- bfd/coffcode.h	11 May 2010 04:42:10 -0000	1.165
+++ bfd/coffcode.h	27 Jun 2010 02:51:19 -0000
@@ -3090,11 +3090,11 @@ static bfd_boolean
 coff_compute_section_file_positions (bfd * abfd)
 {
   asection *current;
-  asection *previous = NULL;
   file_ptr sofar = bfd_coff_filhsz (abfd);
   bfd_boolean align_adjust;
   int target_index;
 #ifdef ALIGN_SECTIONS_IN_FILE
+  asection *previous = NULL;
   file_ptr old_sofar;
 #endif
 
@@ -3408,7 +3408,9 @@ coff_compute_section_file_positions (bfd
 	bfd_set_section_vma (abfd, current, 0);
 #endif
 
+#ifdef ALIGN_SECTIONS_IN_FILE
       previous = current;
+#endif
     }
 
   /* It is now safe to write to the output file.  If we needed an
@@ -5179,6 +5181,7 @@ coff_slurp_reloc_table (bfd * abfd, sec_
 
       /* Calculate any reloc addend by looking at the symbol.  */
       CALC_ADDEND (abfd, ptr, dst, cache_ptr);
+      (void) ptr;
 
       cache_ptr->address -= asect->vma;
       /* !! cache_ptr->section = NULL;*/
Index: bfd/cpu-arm.c
===================================================================
RCS file: /cvs/src/src/bfd/cpu-arm.c,v
retrieving revision 1.27
diff -u -p -r1.27 cpu-arm.c
--- bfd/cpu-arm.c	2 Sep 2009 07:18:36 -0000	1.27
+++ bfd/cpu-arm.c	27 Jun 2010 02:51:19 -0000
@@ -262,6 +262,7 @@ arm_check_note (bfd *abfd,
     }
 
   /* FIXME: We should probably check the type as well.  */
+  (void) type;
 
   if (description_return != NULL)
     * description_return = descr;
Index: bfd/elf-bfd.h
===================================================================
RCS file: /cvs/src/src/bfd/elf-bfd.h,v
retrieving revision 1.306
diff -u -p -r1.306 elf-bfd.h
--- bfd/elf-bfd.h	16 Jun 2010 00:36:01 -0000	1.306
+++ bfd/elf-bfd.h	27 Jun 2010 02:51:21 -0000
@@ -2332,6 +2332,8 @@ extern asection _bfd_elf_large_com_secti
 	    return FALSE;						\
 	  warned = TRUE;						\
 	}								\
+      (void) unresolved_reloc;						\
+      (void) warned;							\
     }									\
   while (0)
 
Index: bfd/elf-m10200.c
===================================================================
RCS file: /cvs/src/src/bfd/elf-m10200.c,v
retrieving revision 1.35
diff -u -p -r1.35 elf-m10200.c
--- bfd/elf-m10200.c	2 Sep 2009 07:18:36 -0000	1.35
+++ bfd/elf-m10200.c	27 Jun 2010 02:51:21 -0000
@@ -1193,7 +1193,6 @@ mn10200_elf_relax_delete_bytes (abfd, se
   unsigned int sec_shndx;
   bfd_byte *contents;
   Elf_Internal_Rela *irel, *irelend;
-  Elf_Internal_Rela *irelalign;
   bfd_vma toaddr;
   Elf_Internal_Sym *isym;
   Elf_Internal_Sym *isymend;
@@ -1205,10 +1204,6 @@ mn10200_elf_relax_delete_bytes (abfd, se
 
   contents = elf_section_data (sec)->this_hdr.contents;
 
-  /* The deletion must stop at the next ALIGN reloc for an aligment
-     power larger than the number of bytes we are deleting.  */
-
-  irelalign = NULL;
   toaddr = sec->size;
 
   irel = elf_section_data (sec)->relocs;
Index: bfd/elf-m10300.c
===================================================================
RCS file: /cvs/src/src/bfd/elf-m10300.c,v
retrieving revision 1.103
diff -u -p -r1.103 elf-m10300.c
--- bfd/elf-m10300.c	4 Feb 2010 09:16:38 -0000	1.103
+++ bfd/elf-m10300.c	27 Jun 2010 02:51:23 -0000
@@ -987,14 +987,11 @@ mn10300_elf_final_link_relocate (reloc_h
   unsigned long r_type = howto->type;
   bfd_byte * hit_data = contents + offset;
   bfd *      dynobj;
-  bfd_vma *  local_got_offsets;
   asection * sgot;
   asection * splt;
   asection * sreloc;
 
   dynobj = elf_hash_table (info)->dynobj;
-  local_got_offsets = elf_local_got_offsets (input_bfd);
-
   sgot   = NULL;
   splt   = NULL;
   sreloc = NULL;
@@ -2109,7 +2106,6 @@ mn10300_elf_relax_section (bfd *abfd,
 	       section = section->next)
 	    {
 	      struct elf32_mn10300_link_hash_entry *hash;
-	      Elf_Internal_Sym *sym;
 	      asection *sym_sec = NULL;
 	      const char *sym_name;
 	      char *new_name;
@@ -2163,7 +2159,6 @@ mn10300_elf_relax_section (bfd *abfd,
 		      /* We need the name and hash table entry of the target
 			 symbol!  */
 		      hash = NULL;
-		      sym = NULL;
 		      sym_sec = NULL;
 
 		      if (r_index < symtab_hdr->sh_info)
Index: bfd/elf32-arm.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-arm.c,v
retrieving revision 1.236
diff -u -p -r1.236 elf32-arm.c
--- bfd/elf32-arm.c	15 Jun 2010 23:10:10 -0000	1.236
+++ bfd/elf32-arm.c	27 Jun 2010 02:51:28 -0000
@@ -3485,7 +3485,6 @@ arm_build_one_stub (struct bfd_hash_entr
   struct bfd_link_info *info;
   asection *stub_sec;
   bfd *stub_bfd;
-  bfd_vma stub_addr;
   bfd_byte *loc;
   bfd_vma sym_value;
   int template_size;
@@ -3518,10 +3517,6 @@ arm_build_one_stub (struct bfd_hash_entr
 
   stub_bfd = stub_sec->owner;
 
-  /* This is the address of the start of the stub.  */
-  stub_addr = stub_sec->output_section->vma + stub_sec->output_offset
-    + stub_entry->stub_offset;
-
   /* This is the address of the stub destination.  */
   sym_value = (stub_entry->target_value
 	       + stub_entry->target_section->output_offset
@@ -3719,16 +3714,14 @@ find_stub_size_and_template (enum elf32_
 
 static bfd_boolean
 arm_size_one_stub (struct bfd_hash_entry *gen_entry,
-		   void * in_arg)
+		   void *in_arg ATTRIBUTE_UNUSED)
 {
   struct elf32_arm_stub_hash_entry *stub_entry;
-  struct elf32_arm_link_hash_table *htab;
   const insn_sequence *template_sequence;
   int template_size, size;
 
   /* Massage our args to the form they really have.  */
   stub_entry = (struct elf32_arm_stub_hash_entry *) gen_entry;
-  htab = (struct elf32_arm_link_hash_table *) in_arg;
 
   BFD_ASSERT((stub_entry->stub_type > arm_stub_none)
 	     && stub_entry->stub_type < ARRAY_SIZE(stub_definitions));
@@ -5244,7 +5237,6 @@ record_vfp11_erratum_veneer (struct bfd_
   struct bfd_link_hash_entry *bh;
   bfd_vma val;
   struct _arm_elf_section_data *sec_data;
-  int errcount;
   elf32_vfp11_erratum_list *newerr;
 
   hash_table = elf32_arm_hash_table (link_info);
@@ -5282,7 +5274,7 @@ record_vfp11_erratum_veneer (struct bfd_
   myh->forced_local = 1;
 
   /* Link veneer back to calling location.  */
-  errcount = ++(sec_data->erratumcount);
+  sec_data->erratumcount += 1;
   newerr = (elf32_vfp11_erratum_list *)
       bfd_zmalloc (sizeof (elf32_vfp11_erratum_list));
 
@@ -6138,9 +6130,8 @@ bfd_elf32_arm_vfp11_erratum_scan (bfd *a
                 {
                   elf32_vfp11_erratum_list *newerr =(elf32_vfp11_erratum_list *)
                       bfd_zmalloc (sizeof (elf32_vfp11_erratum_list));
-                  int errcount;
 
-                  errcount = ++(elf32_arm_section_data (sec)->erratumcount);
+                  elf32_arm_section_data (sec)->erratumcount += 1;
 
                   newerr->u.b.vfp_insn = veneer_of_insn;
 
@@ -6852,8 +6843,6 @@ elf32_arm_final_link_relocate (reloc_how
   unsigned long                 r_symndx;
   bfd_byte *                    hit_data = contents + rel->r_offset;
   bfd *                         dynobj = NULL;
-  Elf_Internal_Shdr *           symtab_hdr;
-  struct elf_link_hash_entry ** sym_hashes;
   bfd_vma *                     local_got_offsets;
   asection *                    sgot = NULL;
   asection *                    splt = NULL;
@@ -6892,8 +6881,6 @@ elf32_arm_final_link_relocate (reloc_how
       sgot = bfd_get_section_by_name (dynobj, ".got");
       splt = bfd_get_section_by_name (dynobj, ".plt");
     }
-  symtab_hdr = & elf_symtab_hdr (input_bfd);
-  sym_hashes = elf_sym_hashes (input_bfd);
   local_got_offsets = elf_local_got_offsets (input_bfd);
   r_symndx = ELF32_R_SYM (rel->r_info);
 
@@ -10838,7 +10825,6 @@ elf32_arm_check_relocs (bfd *abfd, struc
   const Elf_Internal_Rela *rel_end;
   bfd *dynobj;
   asection *sreloc;
-  bfd_vma *local_got_offsets;
   struct elf32_arm_link_hash_table *htab;
   bfd_boolean needs_plt;
   unsigned long nsyms;
@@ -10864,8 +10850,6 @@ elf32_arm_check_relocs (bfd *abfd, struc
     }
 
   dynobj = elf_hash_table (info)->dynobj;
-  local_got_offsets = elf_local_got_offsets (abfd);
-
   symtab_hdr = & elf_symtab_hdr (abfd);
   sym_hashes = elf_sym_hashes (abfd);
   nsyms = NUM_SHDR_ENTRIES (symtab_hdr);
@@ -13008,7 +12992,6 @@ arm_map_one_stub (struct bfd_hash_entry 
 		  void * in_arg)
 {
   struct elf32_arm_stub_hash_entry *stub_entry;
-  struct bfd_link_info *info;
   asection *stub_sec;
   bfd_vma addr;
   char *stub_name;
@@ -13023,8 +13006,6 @@ arm_map_one_stub (struct bfd_hash_entry 
   stub_entry = (struct elf32_arm_stub_hash_entry *) gen_entry;
   osi = (output_arch_syminfo *) in_arg;
 
-  info = osi->info;
-
   stub_sec = stub_entry->stub_sec;
 
   /* Ensure this stub is attached to the current section being
Index: bfd/elf32-avr.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-avr.c,v
retrieving revision 1.45
diff -u -p -r1.45 elf32-avr.c
--- bfd/elf32-avr.c	23 Feb 2010 11:38:35 -0000	1.45
+++ bfd/elf32-avr.c	27 Jun 2010 02:51:29 -0000
@@ -1204,7 +1204,7 @@ elf32_avr_relocate_section (bfd *output_
 
       r_type = ELF32_R_TYPE (rel->r_info);
       r_symndx = ELF32_R_SYM (rel->r_info);
-      howto  = elf_avr_howto_table + ELF32_R_TYPE (rel->r_info);
+      howto  = elf_avr_howto_table + r_type;
       h      = NULL;
       sym    = NULL;
       sec    = NULL;
@@ -1431,7 +1431,6 @@ elf32_avr_relax_delete_bytes (bfd *abfd,
   unsigned int sec_shndx;
   bfd_byte *contents;
   Elf_Internal_Rela *irel, *irelend;
-  Elf_Internal_Rela *irelalign;
   Elf_Internal_Sym *isym;
   Elf_Internal_Sym *isymbuf = NULL;
   bfd_vma toaddr;
@@ -1443,10 +1442,6 @@ elf32_avr_relax_delete_bytes (bfd *abfd,
   sec_shndx = _bfd_elf_section_from_bfd_section (abfd, sec);
   contents = elf_section_data (sec)->this_hdr.contents;
 
-  /* The deletion must stop at the next ALIGN reloc for an aligment
-     power larger than the number of bytes we are deleting.  */
-
-  irelalign = NULL;
   toaddr = sec->size;
 
   irel = elf_section_data (sec)->relocs;
@@ -1462,12 +1457,9 @@ elf32_avr_relax_delete_bytes (bfd *abfd,
   for (irel = elf_section_data (sec)->relocs; irel < irelend; irel++)
     {
       bfd_vma old_reloc_address;
-      bfd_vma shrinked_insn_address;
 
       old_reloc_address = (sec->output_section->vma
                            + sec->output_offset + irel->r_offset);
-      shrinked_insn_address = (sec->output_section->vma
-                              + sec->output_offset + addr - count);
 
       /* Get the new reloc address.  */
       if ((irel->r_offset > addr
@@ -1648,8 +1640,6 @@ elf32_avr_relax_section (bfd *abfd,
   Elf_Internal_Rela *irel, *irelend;
   bfd_byte *contents = NULL;
   Elf_Internal_Sym *isymbuf = NULL;
-  static asection *last_input_section = NULL;
-  static Elf_Internal_Rela *last_reloc = NULL;
   struct elf32_avr_link_hash_table *htab;
 
   if (link_info->relocatable)
@@ -1709,11 +1699,6 @@ elf32_avr_relax_section (bfd *abfd,
   if (internal_relocs == NULL)
     goto error_return;
 
-  if (sec != last_input_section)
-    last_reloc = NULL;
-
-  last_input_section = sec;
-
   /* Walk through the relocs looking for relaxing opportunities.  */
   irelend = internal_relocs + sec->reloc_count;
   for (irel = internal_relocs; irel < irelend; irel++)
@@ -2509,12 +2494,10 @@ avr_build_one_stub (struct bfd_hash_entr
 
 static bfd_boolean
 avr_mark_stub_not_to_be_necessary (struct bfd_hash_entry *bh,
-                                   void *in_arg)
+                                   void *in_arg ATTRIBUTE_UNUSED)
 {
   struct elf32_avr_stub_hash_entry *hsh;
-  struct elf32_avr_link_hash_table *htab;
 
-  htab = in_arg;
   hsh = avr_stub_hash_entry (bh);
   hsh->is_actually_needed = FALSE;
 
Index: bfd/elf32-bfin.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-bfin.c,v
retrieving revision 1.46
diff -u -p -r1.46 elf32-bfin.c
--- bfd/elf32-bfin.c	4 Feb 2010 09:16:39 -0000	1.46
+++ bfd/elf32-bfin.c	27 Jun 2010 02:51:31 -0000
@@ -3379,7 +3379,6 @@ _bfin_create_got_section (bfd *abfd, str
   struct elf_link_hash_entry *h;
   const struct elf_backend_data *bed = get_elf_backend_data (abfd);
   int ptralign;
-  int offset;
 
   /* This function may be called more than once.  */
   s = bfd_get_section_by_name (abfd, ".got");
@@ -3457,12 +3456,10 @@ _bfin_create_got_section (bfd *abfd, str
 	return FALSE;
 
       bfinfdpic_gotfixup_section (info) = s;
-      offset = -2048;
       flags = BSF_GLOBAL;
     }
   else
     {
-      offset = 2048;
       flags = BSF_GLOBAL | BSF_WEAK;
     }
 
@@ -5107,11 +5104,12 @@ elf32_bfin_merge_private_bfd_data (bfd *
   if (new_flags & EF_BFIN_FDPIC)
     new_flags &= ~EF_BFIN_PIC;
 
-#ifdef DEBUG
+#ifndef DEBUG
+  if (0)
+#endif
   (*_bfd_error_handler) ("old_flags = 0x%.8lx, new_flags = 0x%.8lx, init = %s, filename = %s",
 			 old_flags, new_flags, elf_flags_init (obfd) ? "yes" : "no",
 			 bfd_get_filename (ibfd));
-#endif
 
   if (!elf_flags_init (obfd))			/* First call, no flags set.  */
     {
Index: bfd/elf32-cr16.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-cr16.c,v
retrieving revision 1.14
diff -u -p -r1.14 elf32-cr16.c
--- bfd/elf32-cr16.c	4 Feb 2010 09:16:39 -0000	1.14
+++ bfd/elf32-cr16.c	27 Jun 2010 02:51:33 -0000
@@ -862,10 +862,8 @@ cr16_elf_final_link_relocate (reloc_howt
   bfd_byte *hit_data = contents + offset;
   bfd_vma reloc_bits, check, Rvalue1;
   bfd *      dynobj;
-  bfd_vma *  local_got_offsets;
 
   dynobj = elf_hash_table (info)->dynobj;
-  local_got_offsets = elf_local_got_offsets (input_bfd);
 
   switch (r_type)
     {
@@ -1262,7 +1260,6 @@ elf32_cr16_relax_delete_bytes (struct bf
   unsigned int sec_shndx;
   bfd_byte *contents;
   Elf_Internal_Rela *irel, *irelend;
-  Elf_Internal_Rela *irelalign;
   bfd_vma toaddr;
   Elf_Internal_Sym *isym;
   Elf_Internal_Sym *isymend;
@@ -1275,9 +1272,6 @@ elf32_cr16_relax_delete_bytes (struct bf
 
   contents = elf_section_data (sec)->this_hdr.contents;
 
-  /* The deletion must stop at the next ALIGN reloc for an aligment
-     power larger than the number of bytes we are deleting.  */
-  irelalign = NULL;
   toaddr = sec->size;
 
   irel = elf_section_data (sec)->relocs;
Index: bfd/elf32-cr16c.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-cr16c.c,v
retrieving revision 1.14
diff -u -p -r1.14 elf32-cr16c.c
--- bfd/elf32-cr16c.c	2 Sep 2009 07:18:36 -0000	1.14
+++ bfd/elf32-cr16c.c	27 Jun 2010 02:51:33 -0000
@@ -204,7 +204,6 @@ cr16c_elf_final_link_relocate (reloc_how
   unsigned long format, addr_type, code_factor;
   unsigned short size;
   unsigned short r_type;
-  asymbol *symbol = NULL;
 
   unsigned long disp20_opcod;
   char neg = 0;
@@ -224,9 +223,6 @@ cr16c_elf_final_link_relocate (reloc_how
   addr_type = r_type & R_ADDRTYPE;
   code_factor = ((addr_type == R_CODE_ADDR) ? 1 : 0);
 
-  if (sym_sec)
-    symbol = sym_sec->symbol;
-
   switch (format)
     {
     case R_NUMBER:
Index: bfd/elf32-cris.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-cris.c,v
retrieving revision 1.109
diff -u -p -r1.109 elf32-cris.c
--- bfd/elf32-cris.c	31 Mar 2010 22:44:49 -0000	1.109
+++ bfd/elf32-cris.c	27 Jun 2010 02:51:35 -0000
@@ -2157,7 +2157,6 @@ elf_cris_finish_dynamic_symbol (bfd *out
     {
       asection *splt;
       asection *sgotplt;
-      asection *sgot;
       asection *srela;
       bfd_vma got_base;
 
@@ -2197,7 +2196,6 @@ elf_cris_finish_dynamic_symbol (bfd *out
       BFD_ASSERT (h->dynindx != -1);
 
       splt = bfd_get_section_by_name (dynobj, ".plt");
-      sgot = bfd_get_section_by_name (dynobj, ".got");
       sgotplt = bfd_get_section_by_name (dynobj, ".got.plt");
       srela = bfd_get_section_by_name (dynobj, ".rela.plt");
       BFD_ASSERT (splt != NULL && sgotplt != NULL
Index: bfd/elf32-crx.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-crx.c,v
retrieving revision 1.14
diff -u -p -r1.14 elf32-crx.c
--- bfd/elf32-crx.c	2 Sep 2009 07:18:36 -0000	1.14
+++ bfd/elf32-crx.c	27 Jun 2010 02:51:35 -0000
@@ -591,7 +591,6 @@ elf32_crx_relax_delete_bytes (struct bfd
   unsigned int sec_shndx;
   bfd_byte *contents;
   Elf_Internal_Rela *irel, *irelend;
-  Elf_Internal_Rela *irelalign;
   bfd_vma toaddr;
   Elf_Internal_Sym *isym;
   Elf_Internal_Sym *isymend;
@@ -604,10 +603,6 @@ elf32_crx_relax_delete_bytes (struct bfd
 
   contents = elf_section_data (sec)->this_hdr.contents;
 
-  /* The deletion must stop at the next ALIGN reloc for an aligment
-     power larger than the number of bytes we are deleting.  */
-
-  irelalign = NULL;
   toaddr = sec->size;
 
   irel = elf_section_data (sec)->relocs;
Index: bfd/elf32-h8300.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-h8300.c,v
retrieving revision 1.56
diff -u -p -r1.56 elf32-h8300.c
--- bfd/elf32-h8300.c	14 Jun 2010 18:43:46 -0000	1.56
+++ bfd/elf32-h8300.c	27 Jun 2010 02:51:36 -0000
@@ -724,10 +724,8 @@ elf32_h8_relax_section (bfd *abfd, asect
 
       {
 	arelent bfd_reloc;
-	reloc_howto_type *h;
 
 	elf32_h8_info_to_howto (abfd, &bfd_reloc, irel);
-	h = bfd_reloc.howto;
       }
       /* Keep track of the previous reloc so that we can delete
 	 some long jumps created by the compiler.  */
@@ -1386,7 +1384,6 @@ elf32_h8_relax_delete_bytes (bfd *abfd, 
   unsigned int sec_shndx;
   bfd_byte *contents;
   Elf_Internal_Rela *irel, *irelend;
-  Elf_Internal_Rela *irelalign;
   Elf_Internal_Sym *isym;
   Elf_Internal_Sym *isymend;
   bfd_vma toaddr;
@@ -1398,10 +1395,6 @@ elf32_h8_relax_delete_bytes (bfd *abfd, 
 
   contents = elf_section_data (sec)->this_hdr.contents;
 
-  /* The deletion must stop at the next ALIGN reloc for an aligment
-     power larger than the number of bytes we are deleting.  */
-
-  irelalign = NULL;
   toaddr = sec->size;
 
   irel = elf_section_data (sec)->relocs;
Index: bfd/elf32-hppa.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-hppa.c,v
retrieving revision 1.171
diff -u -p -r1.171 elf32-hppa.c
--- bfd/elf32-hppa.c	4 Feb 2010 09:16:39 -0000	1.171
+++ bfd/elf32-hppa.c	27 Jun 2010 02:51:37 -0000
@@ -1160,7 +1160,6 @@ elf32_hppa_check_relocs (bfd *abfd,
   const Elf_Internal_Rela *rela_end;
   struct elf32_hppa_link_hash_table *htab;
   asection *sreloc;
-  asection *stubreloc;
   int tls_type = GOT_UNKNOWN, old_tls_type = GOT_UNKNOWN;
 
   if (info->relocatable)
@@ -1172,7 +1171,6 @@ elf32_hppa_check_relocs (bfd *abfd,
   symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
   eh_syms = elf_sym_hashes (abfd);
   sreloc = NULL;
-  stubreloc = NULL;
 
   rela_end = relocs + sec->reloc_count;
   for (rela = relocs; rela < rela_end; rela++)
Index: bfd/elf32-i370.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-i370.c,v
retrieving revision 1.64
diff -u -p -r1.64 elf32-i370.c
--- bfd/elf32-i370.c	18 May 2010 03:31:05 -0000	1.64
+++ bfd/elf32-i370.c	27 Jun 2010 02:51:38 -0000
@@ -804,7 +804,6 @@ i370_elf_check_relocs (bfd *abfd,
   struct elf_link_hash_entry **sym_hashes;
   const Elf_Internal_Rela *rel;
   const Elf_Internal_Rela *rel_end;
-  bfd_vma *local_got_offsets;
   asection *sreloc;
 
   if (info->relocatable)
@@ -818,7 +817,6 @@ i370_elf_check_relocs (bfd *abfd,
   dynobj = elf_hash_table (info)->dynobj;
   symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
   sym_hashes = elf_sym_hashes (abfd);
-  local_got_offsets = elf_local_got_offsets (abfd);
 
   sreloc = NULL;
 
@@ -1042,7 +1040,6 @@ i370_elf_relocate_section (bfd *output_b
   Elf_Internal_Rela *rel = relocs;
   Elf_Internal_Rela *relend = relocs + input_section->reloc_count;
   asection *sreloc = NULL;
-  bfd_vma *local_got_offsets;
   bfd_boolean ret = TRUE;
 
 #ifdef DEBUG
@@ -1056,8 +1053,6 @@ i370_elf_relocate_section (bfd *output_b
     /* Initialize howto table if needed.  */
     i370_elf_howto_init ();
 
-  local_got_offsets = elf_local_got_offsets (input_bfd);
-
   for (; rel < relend; rel++)
     {
       enum i370_reloc_type r_type    = (enum i370_reloc_type) ELF32_R_TYPE (rel->r_info);
Index: bfd/elf32-ip2k.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-ip2k.c,v
retrieving revision 1.26
diff -u -p -r1.26 elf32-ip2k.c
--- bfd/elf32-ip2k.c	11 Dec 2009 13:42:02 -0000	1.26
+++ bfd/elf32-ip2k.c	27 Jun 2010 02:51:39 -0000
@@ -577,7 +577,6 @@ adjust_all_relocations (bfd *abfd,
   Elf_Internal_Shdr *symtab_hdr;
   Elf_Internal_Sym *isymbuf, *isym, *isymend;
   unsigned int shndx;
-  bfd_byte *contents;
   Elf_Internal_Rela *irel, *irelend, *irelbase;
   struct elf_link_hash_entry **sym_hashes;
   struct elf_link_hash_entry **end_hashes;
@@ -589,8 +588,6 @@ adjust_all_relocations (bfd *abfd,
 
   shndx = _bfd_elf_section_from_bfd_section (abfd, sec);
 
-  contents = elf_section_data (sec)->this_hdr.contents;
-
   irelbase = elf_section_data (sec)->relocs;
   irelend = irelbase + sec->reloc_count;
 
@@ -669,9 +666,7 @@ adjust_all_relocations (bfd *abfd,
 		  if (sym_sec == sec)
 		    {
 		      const char *name;
-		      unsigned long strx;
-		      unsigned char type, other;
-		      unsigned short desc;
+		      unsigned char type;
 		      bfd_vma value;
 		      bfd_vma baseaddr = BASEADDR (sec);
 		      bfd_vma symval = BASEADDR (sym_sec) + isym->st_value
@@ -685,10 +680,7 @@ adjust_all_relocations (bfd *abfd,
 		      stabp = stabcontents + irel->r_offset - 8; 
 
 		      /* Go pullout the stab entry.  */
-		      strx  = bfd_h_get_32 (abfd, stabp + STRDXOFF);
 		      type  = bfd_h_get_8 (abfd, stabp + TYPEOFF);
-		      other = bfd_h_get_8 (abfd, stabp + OTHEROFF);
-		      desc  = bfd_h_get_16 (abfd, stabp + DESCOFF);
 		      value = bfd_h_get_32 (abfd, stabp + VALOFF);
 		      
 		      name = bfd_get_stab_name (type);
@@ -706,10 +698,7 @@ adjust_all_relocations (bfd *abfd,
 			  for (;stabp < stabend; stabp += STABSIZE)
 			    {
 			      /* Go pullout the stab entry.  */
-			      strx  = bfd_h_get_32 (abfd, stabp + STRDXOFF);
 			      type  = bfd_h_get_8 (abfd, stabp + TYPEOFF);
-			      other = bfd_h_get_8 (abfd, stabp + OTHEROFF);
-			      desc  = bfd_h_get_16 (abfd, stabp + DESCOFF);
 			      value = bfd_h_get_32 (abfd, stabp + VALOFF);
 
 			      name = bfd_get_stab_name (type);
@@ -1089,7 +1078,6 @@ ip2k_elf_relax_section (bfd *abfd,
   static bfd_boolean new_pass = FALSE;
   static bfd_boolean changed = FALSE;
   struct misc misc;
-  asection *stab;
 
   /* Assume nothing changes.  */
   *again = FALSE;
@@ -1122,18 +1110,6 @@ ip2k_elf_relax_section (bfd *abfd,
   if (internal_relocs == NULL)
     goto error_return;
 
-  /* Make sure the stac.rela stuff gets read in.  */
-  stab = bfd_get_section_by_name (abfd, ".stab");
-
-  if (stab)
-    {
-      /* So stab does exits.  */
-      Elf_Internal_Rela * irelbase;
-
-      irelbase = _bfd_elf_link_read_relocs (abfd, stab, NULL, NULL,
-					    link_info->keep_memory);
-    }
-
   /* Get section contents cached copy if it exists.  */
   if (contents == NULL)
     {
@@ -1432,7 +1408,7 @@ ip2k_elf_relocate_section (bfd *output_b
 
       r_type = ELF32_R_TYPE (rel->r_info);
       r_symndx = ELF32_R_SYM (rel->r_info);
-      howto  = ip2k_elf_howto_table + ELF32_R_TYPE (rel->r_info);
+      howto  = ip2k_elf_howto_table + r_type;
       h      = NULL;
       sym    = NULL;
       sec    = NULL;
Index: bfd/elf32-lm32.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-lm32.c,v
retrieving revision 1.5
diff -u -p -r1.5 elf32-lm32.c
--- bfd/elf32-lm32.c	4 Feb 2010 09:16:39 -0000	1.5
+++ bfd/elf32-lm32.c	27 Jun 2010 02:51:40 -0000
@@ -829,7 +829,7 @@ lm32_elf_relocate_section (bfd *output_b
   struct elf_lm32_link_hash_table *htab = lm32_elf_hash_table (info);
   bfd *dynobj;
   bfd_vma *local_got_offsets;
-  asection *sgot, *splt, *sreloc;
+  asection *sgot;
 
   if (htab == NULL)
     return FALSE;
@@ -838,8 +838,6 @@ lm32_elf_relocate_section (bfd *output_b
   local_got_offsets = elf_local_got_offsets (input_bfd);
 
   sgot = htab->sgot;
-  splt = htab->splt;
-  sreloc = NULL;
 
   symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
   sym_hashes = elf_sym_hashes (input_bfd);
@@ -858,7 +856,6 @@ lm32_elf_relocate_section (bfd *output_b
       bfd_vma gp;
       bfd_reloc_status_type r;
       const char *name = NULL;
-      asection *osec;
 
       r_symndx = ELF32_R_SYM (rel->r_info);
       r_type = ELF32_R_TYPE (rel->r_info);
@@ -877,7 +874,7 @@ lm32_elf_relocate_section (bfd *output_b
         {
           /* It's a local symbol.  */
           sym = local_syms + r_symndx;
-          osec = sec = local_sections[r_symndx];
+          sec = local_sections[r_symndx];
           relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
           name = bfd_elf_string_from_elf_section
 	    (input_bfd, symtab_hdr->sh_link, sym->st_name);
@@ -893,7 +890,6 @@ lm32_elf_relocate_section (bfd *output_b
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
 				   unresolved_reloc, warned);
-	  osec = sec;
 	  name = h->root.root.string;
         }
 
@@ -1291,14 +1287,10 @@ lm32_elf_check_relocs (bfd *abfd,
   const Elf_Internal_Rela *rel_end;
   struct elf_lm32_link_hash_table *htab;
   bfd *dynobj;
-  bfd_vma *local_got_offsets;
-  asection *sgot, *srelgot, *sreloc;
 
   if (info->relocatable)
     return TRUE;
 
-  sgot = srelgot = sreloc = NULL;
-
   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);
@@ -1310,7 +1302,6 @@ lm32_elf_check_relocs (bfd *abfd,
     return FALSE;
 
   dynobj = htab->root.dynobj;
-  local_got_offsets = elf_local_got_offsets (abfd);
 
   rel_end = relocs + sec->reloc_count;
   for (rel = relocs; rel < rel_end; rel++)
@@ -1458,7 +1449,6 @@ lm32_elf_finish_dynamic_sections (bfd *o
       for (; dyncon < dynconend; dyncon++)
         {
           Elf_Internal_Dyn dyn;
-          const char *name;
           asection *s;
 
           bfd_elf32_swap_dyn_in (dynobj, dyncon, &dyn);
@@ -1469,11 +1459,9 @@ lm32_elf_finish_dynamic_sections (bfd *o
               break;
 
             case DT_PLTGOT:
-              name = ".got";
               s = htab->sgot->output_section;
               goto get_vma;
             case DT_JMPREL:
-              name = ".rela.plt";
               s = htab->srelplt->output_section;
             get_vma:
               BFD_ASSERT (s != NULL);
@@ -1615,15 +1603,12 @@ lm32_elf_finish_dynamic_symbol (bfd *out
 				Elf_Internal_Sym *sym)
 {
   struct elf_lm32_link_hash_table *htab;
-  bfd *dynobj;
   bfd_byte *loc;
 
   htab = lm32_elf_hash_table (info);
   if (htab == NULL)
     return FALSE;
 
-  dynobj = htab->root.dynobj;
-
   if (h->plt.offset != (bfd_vma) -1)
     {
       asection *splt;
Index: bfd/elf32-m32c.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-m32c.c,v
retrieving revision 1.20
diff -u -p -r1.20 elf32-m32c.c
--- bfd/elf32-m32c.c	2 Sep 2009 07:18:36 -0000	1.20
+++ bfd/elf32-m32c.c	27 Jun 2010 02:51:41 -0000
@@ -1188,7 +1188,7 @@ static bfd_vma
 m32c_offset_for_reloc (bfd *abfd,
 		       Elf_Internal_Rela *rel,
 		       Elf_Internal_Shdr *symtab_hdr,
-		       Elf_External_Sym_Shndx *shndx_buf,
+		       Elf_External_Sym_Shndx *shndx_buf ATTRIBUTE_UNUSED,
 		       Elf_Internal_Sym *intsyms)
 {
   bfd_vma symval;
@@ -1198,14 +1198,10 @@ m32c_offset_for_reloc (bfd *abfd,
     {
       /* A local symbol.  */
       Elf_Internal_Sym *isym;
-      Elf_External_Sym_Shndx *shndx;
       asection *ssec;
 
-
       isym = intsyms + ELF32_R_SYM (rel->r_info);
       ssec = bfd_section_from_elf_index (abfd, isym->st_shndx);
-      shndx = shndx_buf + (shndx_buf ? ELF32_R_SYM (rel->r_info) : 0);
-
       symval = isym->st_value;
       if (ssec)
 	symval += ssec->output_section->vma
@@ -1870,7 +1866,6 @@ m32c_elf_relax_delete_bytes
   bfd_byte *contents;
   Elf_Internal_Rela *irel;
   Elf_Internal_Rela *irelend;
-  Elf_Internal_Rela *irelalign;
   bfd_vma toaddr;
   Elf_Internal_Sym *isym;
   Elf_Internal_Sym *isymend;
@@ -1883,9 +1878,6 @@ m32c_elf_relax_delete_bytes
 
   contents   = elf_section_data (sec)->this_hdr.contents;
 
-  /* The deletion must stop at the next ALIGN reloc for an aligment
-     power larger than the number of bytes we are deleting.  */
-  irelalign = NULL;
   toaddr = sec->size;
 
   irel = elf_section_data (sec)->relocs;
Index: bfd/elf32-m32r.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-m32r.c,v
retrieving revision 1.96
diff -u -p -r1.96 elf32-m32r.c
--- bfd/elf32-m32r.c	4 Feb 2010 09:16:39 -0000	1.96
+++ bfd/elf32-m32r.c	27 Jun 2010 02:51:42 -0000
@@ -3153,7 +3153,6 @@ m32r_elf_finish_dynamic_symbol (bfd *out
 				Elf_Internal_Sym *sym)
 {
   struct elf_m32r_link_hash_table *htab;
-  bfd *dynobj;
   bfd_byte *loc;
 
 #ifdef DEBUG_PIC
@@ -3164,8 +3163,6 @@ m32r_elf_finish_dynamic_symbol (bfd *out
   if (htab == NULL)
     return FALSE;
 
-  dynobj = htab->root.dynobj;
-
   if (h->plt.offset != (bfd_vma) -1)
     {
       asection *splt;
@@ -3387,7 +3384,6 @@ m32r_elf_finish_dynamic_sections (bfd *o
       for (; dyncon < dynconend; dyncon++)
         {
           Elf_Internal_Dyn dyn;
-          const char *name;
           asection *s;
 
           bfd_elf32_swap_dyn_in (dynobj, dyncon, &dyn);
@@ -3398,11 +3394,9 @@ m32r_elf_finish_dynamic_sections (bfd *o
               break;
 
             case DT_PLTGOT:
-              name = ".got";
               s = htab->sgot->output_section;
               goto get_vma;
             case DT_JMPREL:
-              name = ".rela.plt";
               s = htab->srelplt->output_section;
             get_vma:
               BFD_ASSERT (s != NULL);
@@ -3774,14 +3768,12 @@ m32r_elf_check_relocs (bfd *abfd,
   const Elf_Internal_Rela *rel_end;
   struct elf_m32r_link_hash_table *htab;
   bfd *dynobj;
-  bfd_vma *local_got_offsets;
-  asection *sgot, *srelgot, *sreloc;
+  asection *sreloc;
 
   if (info->relocatable)
     return TRUE;
 
-  sgot = srelgot = sreloc = NULL;
-
+  sreloc = NULL;
   symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
   sym_hashes = elf_sym_hashes (abfd);
 
@@ -3790,7 +3782,6 @@ m32r_elf_check_relocs (bfd *abfd,
     return FALSE;
 
   dynobj = htab->root.dynobj;
-  local_got_offsets = elf_local_got_offsets (abfd);
 
   rel_end = relocs + sec->reloc_count;
   for (rel = relocs; rel < rel_end; rel++)
@@ -4048,10 +4039,6 @@ m32r_elf_fake_sections (bfd *abfd,
 			Elf_Internal_Shdr *hdr ATTRIBUTE_UNUSED,
 			asection *sec)
 {
-  const char *name;
-
-  name = bfd_get_section_name (abfd, sec);
-
   /* The generic elf_fake_sections will set up REL_HDR using the
      default kind of relocations.  But, we may actually need both
      kinds of relocations, so we set up the second header here.
Index: bfd/elf32-m68hc11.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-m68hc11.c,v
retrieving revision 1.38
diff -u -p -r1.38 elf32-m68hc11.c
--- bfd/elf32-m68hc11.c	4 Feb 2010 09:16:39 -0000	1.38
+++ bfd/elf32-m68hc11.c	27 Jun 2010 02:51:43 -0000
@@ -676,7 +676,6 @@ m68hc11_elf_relax_section (bfd *abfd, as
                            struct bfd_link_info *link_info, bfd_boolean *again)
 {
   Elf_Internal_Shdr *symtab_hdr;
-  Elf_Internal_Shdr *shndx_hdr;
   Elf_Internal_Rela *internal_relocs;
   Elf_Internal_Rela *free_relocs = NULL;
   Elf_Internal_Rela *irel, *irelend;
@@ -701,7 +700,6 @@ m68hc11_elf_relax_section (bfd *abfd, as
     return TRUE;
 
   symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
-  shndx_hdr = &elf_tdata (abfd)->symtab_shndx_hdr;
 
   /* Get a copy of the native relocations.  */
   internal_relocs = (_bfd_elf_link_read_relocs
Index: bfd/elf32-m68hc1x.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-m68hc1x.c,v
retrieving revision 1.37
diff -u -p -r1.37 elf32-m68hc1x.c
--- bfd/elf32-m68hc1x.c	4 Feb 2010 09:16:39 -0000	1.37
+++ bfd/elf32-m68hc1x.c	27 Jun 2010 02:51:43 -0000
@@ -935,7 +935,6 @@ elf32_m68hc11_relocate_section (bfd *out
       bfd_vma insn_page;
       bfd_boolean is_far = FALSE;
       struct elf_link_hash_entry *h;
-      const char* stub_name = 0;
 
       r_symndx = ELF32_R_SYM (rel->r_info);
       r_type = ELF32_R_TYPE (rel->r_info);
@@ -958,10 +957,6 @@ elf32_m68hc11_relocate_section (bfd *out
 			+ sec->output_offset
 			+ sym->st_value);
 	  is_far = (sym && (sym->st_other & STO_M68HC12_FAR));
-	  if (is_far)
-	    stub_name = (bfd_elf_string_from_elf_section
-			 (input_bfd, symtab_hdr->sh_link,
-			  sym->st_name));
 	}
       else
 	{
@@ -973,7 +968,6 @@ elf32_m68hc11_relocate_section (bfd *out
 				   warned);
 
 	  is_far = (h && (h->other & STO_M68HC12_FAR));
-	  stub_name = h->root.root.string;
 	}
 
       if (sec != NULL && elf_discarded_section (sec))
Index: bfd/elf32-m68k.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-m68k.c,v
retrieving revision 1.118
diff -u -p -r1.118 elf32-m68k.c
--- bfd/elf32-m68k.c	4 Feb 2010 09:16:39 -0000	1.118
+++ bfd/elf32-m68k.c	27 Jun 2010 02:51:45 -0000
@@ -2968,8 +2968,6 @@ elf_m68k_gc_sweep_hook (bfd *abfd,
   struct elf_link_hash_entry **sym_hashes;
   const Elf_Internal_Rela *rel, *relend;
   bfd *dynobj;
-  asection *sgot;
-  asection *srelgot;
   struct elf_m68k_got *got;
 
   if (info->relocatable)
@@ -2981,9 +2979,6 @@ elf_m68k_gc_sweep_hook (bfd *abfd,
 
   symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
   sym_hashes = elf_sym_hashes (abfd);
-
-  sgot = bfd_get_section_by_name (dynobj, ".got");
-  srelgot = bfd_get_section_by_name (dynobj, ".rela.got");
   got = NULL;
 
   relend = relocs + sec->reloc_count;
Index: bfd/elf32-microblaze.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-microblaze.c,v
retrieving revision 1.5
diff -u -p -r1.5 elf32-microblaze.c
--- bfd/elf32-microblaze.c	4 Feb 2010 09:16:39 -0000	1.5
+++ bfd/elf32-microblaze.c	27 Jun 2010 02:51:46 -0000
@@ -1109,7 +1109,7 @@ microblaze_elf_relocate_section (bfd *ou
 		  {
 		    Elf_Internal_Rela outrel;
 		    bfd_byte *loc;
-		    bfd_boolean skip, relocate = FALSE;
+		    bfd_boolean skip;
 
 		    /* When generating a shared object, these relocations
 		       are copied into the output file to be resolved at run
@@ -1125,7 +1125,7 @@ microblaze_elf_relocate_section (bfd *ou
 		    if (outrel.r_offset == (bfd_vma) -1)
 		      skip = TRUE;
 		    else if (outrel.r_offset == (bfd_vma) -2)
-		      skip = TRUE, relocate = TRUE;
+		      skip = TRUE;
 		    outrel.r_offset += (input_section->output_section->vma
 					+ input_section->output_offset);
 
@@ -1907,7 +1907,6 @@ microblaze_elf_check_relocs (bfd * abfd,
   const Elf_Internal_Rela *     rel;
   const Elf_Internal_Rela *     rel_end;
   struct elf32_mb_link_hash_table *htab;
-  bfd_vma *local_got_offsets;
   asection *sreloc = NULL;
 
   if (info->relocatable)
@@ -1917,7 +1916,6 @@ microblaze_elf_check_relocs (bfd * abfd,
   if (htab == NULL)
     return FALSE;
 
-  local_got_offsets = elf_local_got_offsets (abfd);
   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);
@@ -2747,15 +2745,12 @@ microblaze_elf_finish_dynamic_symbol (bf
 				      struct elf_link_hash_entry *h,
 				      Elf_Internal_Sym *sym)
 {
-  bfd *dynobj;
   struct elf32_mb_link_hash_table *htab;
 
   htab = elf32_mb_hash_table (info);
   if (htab == NULL)
     return FALSE;
 
-  dynobj = htab->elf.dynobj;
-
   if (h->plt.offset != (bfd_vma) -1)
     {
       asection *splt;
Index: bfd/elf32-moxie.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-moxie.c,v
retrieving revision 1.2
diff -u -p -r1.2 elf32-moxie.c
--- bfd/elf32-moxie.c	11 Jun 2009 11:27:57 -0000	1.2
+++ bfd/elf32-moxie.c	27 Jun 2010 02:51:46 -0000
@@ -222,10 +222,8 @@ moxie_elf_relocate_section (bfd *output_
       int r_type;
 
       r_type = ELF32_R_TYPE (rel->r_info);
-
       r_symndx = ELF32_R_SYM (rel->r_info);
-
-      howto  = moxie_elf_howto_table + ELF32_R_TYPE (rel->r_info);
+      howto  = moxie_elf_howto_table + r_type;
       h      = NULL;
       sym    = NULL;
       sec    = NULL;
Index: bfd/elf32-msp430.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-msp430.c,v
retrieving revision 1.20
diff -u -p -r1.20 elf32-msp430.c
--- bfd/elf32-msp430.c	28 Sep 2007 08:43:45 -0000	1.20
+++ bfd/elf32-msp430.c	27 Jun 2010 02:51:46 -0000
@@ -429,7 +429,7 @@ elf32_msp430_relocate_section (bfd * out
 
       r_type = ELF32_R_TYPE (rel->r_info);
       r_symndx = ELF32_R_SYM (rel->r_info);
-      howto = elf_msp430_howto_table + ELF32_R_TYPE (rel->r_info);
+      howto = elf_msp430_howto_table + r_type;
       h = NULL;
       sym = NULL;
       sec = NULL;
@@ -841,7 +841,6 @@ msp430_elf_relax_delete_bytes (bfd * abf
   bfd_byte *contents;
   Elf_Internal_Rela *irel;
   Elf_Internal_Rela *irelend;
-  Elf_Internal_Rela *irelalign;
   bfd_vma toaddr;
   Elf_Internal_Sym *isym;
   Elf_Internal_Sym *isymend;
@@ -854,10 +853,6 @@ msp430_elf_relax_delete_bytes (bfd * abf
 
   contents = elf_section_data (sec)->this_hdr.contents;
 
-  /* The deletion must stop at the next ALIGN reloc for an aligment
-     power larger than the number of bytes we are deleting.  */
-
-  irelalign = NULL;
   toaddr = sec->size;
 
   irel = elf_section_data (sec)->relocs;
Index: bfd/elf32-ppc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-ppc.c,v
retrieving revision 1.282
diff -u -p -r1.282 elf32-ppc.c
--- bfd/elf32-ppc.c	18 May 2010 03:31:05 -0000	1.282
+++ bfd/elf32-ppc.c	27 Jun 2010 02:51:49 -0000
@@ -4788,7 +4788,6 @@ ppc_elf_tls_optimize (bfd *obfd ATTRIBUT
 		    }
 		  else
 		    {
-		      Elf_Internal_Sym *sym;
 		      bfd_signed_vma *lgot_refs;
 		      struct plt_entry **local_plt;
 		      char *lgot_masks;
@@ -4807,7 +4806,6 @@ ppc_elf_tls_optimize (bfd *obfd ATTRIBUT
 			      return FALSE;
 			    }
 			}
-		      sym = locsyms + r_symndx;
 		      lgot_refs = elf_local_got_refcounts (ibfd);
 		      if (lgot_refs == NULL)
 			abort ();
Index: bfd/elf32-rx.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-rx.c,v
retrieving revision 1.2
diff -u -p -r1.2 elf32-rx.c
--- bfd/elf32-rx.c	11 Dec 2009 13:42:03 -0000	1.2
+++ bfd/elf32-rx.c	27 Jun 2010 02:51:51 -0000
@@ -453,18 +453,10 @@ rx_elf_relocate_section
   struct elf_link_hash_entry ** sym_hashes;
   Elf_Internal_Rela *           rel;
   Elf_Internal_Rela *           relend;
-  bfd *				dynobj;
-  asection *			splt;
 
   symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr;
   sym_hashes = elf_sym_hashes (input_bfd);
   relend     = relocs + input_section->reloc_count;
-
-  dynobj = elf_hash_table (info)->dynobj;
-  splt = NULL;
-  if (dynobj != NULL)
-    splt = bfd_get_section_by_name (dynobj, ".plt");
-
   for (rel = relocs; rel < relend; rel ++)
     {
       reloc_howto_type *           howto;
@@ -1372,7 +1364,6 @@ elf32_rx_relax_delete_bytes (bfd *abfd, 
   bfd_byte *          contents;
   Elf_Internal_Rela * irel;
   Elf_Internal_Rela * irelend;
-  Elf_Internal_Rela * irelalign;
   Elf_Internal_Sym *  isym;
   Elf_Internal_Sym *  isymend;
   bfd_vma             toaddr;
@@ -1389,7 +1380,6 @@ elf32_rx_relax_delete_bytes (bfd *abfd, 
 
   /* The deletion must stop at the next alignment boundary, if
      ALIGNMENT_REL is non-NULL.  */
-  irelalign = NULL;
   toaddr = sec->size;
   if (alignment_rel)
     toaddr = alignment_rel->r_offset;
@@ -1545,7 +1535,7 @@ static bfd_vma
 rx_offset_for_reloc (bfd *                    abfd,
 		     Elf_Internal_Rela *      rel,
 		     Elf_Internal_Shdr *      symtab_hdr,
-		     Elf_External_Sym_Shndx * shndx_buf,
+		     Elf_External_Sym_Shndx * shndx_buf ATTRIBUTE_UNUSED,
 		     Elf_Internal_Sym *       intsyms,
 		     Elf_Internal_Rela **     lrel,
 		     bfd *                    input_bfd,
@@ -1570,7 +1560,6 @@ rx_offset_for_reloc (bfd *              
 	{
 	  /* A local symbol.  */
 	  Elf_Internal_Sym *isym;
-	  Elf_External_Sym_Shndx *shndx;
 	  asection *ssec;
 
 	  isym = intsyms + ELF32_R_SYM (rel->r_info);
@@ -1585,8 +1574,6 @@ rx_offset_for_reloc (bfd *              
 	    ssec = bfd_section_from_elf_index (abfd,
 					       isym->st_shndx);
 
-	  shndx = shndx_buf + (shndx_buf ? ELF32_R_SYM (rel->r_info) : 0);
-
 	  /* Initial symbol value.  */
 	  symval = isym->st_value;
 
@@ -1817,7 +1804,6 @@ elf32_rx_relax_section (bfd *           
   Elf_External_Sym_Shndx * shndx_buf = NULL;
   bfd_vma pc;
   bfd_vma sec_start;
-  bfd_vma sec_end;
   bfd_vma symval = 0;
   int pcrel = 0;
   int code = 0;
@@ -1841,7 +1827,6 @@ elf32_rx_relax_section (bfd *           
   shndx_hdr = &elf_tdata (abfd)->symtab_shndx_hdr;
 
   sec_start = sec->output_section->vma + sec->output_offset;
-  sec_end   = sec->output_section->vma + sec->output_offset + sec->size;
 
   /* Get the section contents.  */
   if (elf_section_data (sec)->this_hdr.contents != NULL)
Index: bfd/elf32-score.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-score.c,v
retrieving revision 1.17
diff -u -p -r1.17 elf32-score.c
--- bfd/elf32-score.c	4 Feb 2010 09:16:40 -0000	1.17
+++ bfd/elf32-score.c	27 Jun 2010 02:51:52 -0000
@@ -1774,9 +1774,8 @@ score_elf_got_offset_from_index (bfd *dy
 {
   asection *sgot;
   bfd_vma gp;
-  struct score_got_info *g;
 
-  g = score_elf_got_info (dynobj, &sgot);
+  score_elf_got_info (dynobj, &sgot);
   gp = _bfd_get_gp_value (output_bfd);
 
   return sgot->output_section->vma + sgot->output_offset + got_index - gp;
@@ -1987,8 +1986,6 @@ score_elf_final_link_relocate (reloc_how
   bfd_vma gp = MINUS_ONE;
   /* The place (section offset or address) of the storage unit being relocated.  */
   bfd_vma rel_addr;
-  /* The value of GP used to create the relocatable object.  */
-  bfd_vma gp0 = MINUS_ONE;
   /* The offset into the global offset table at which the address of the relocation entry
      symbol, adjusted by the addend, resides during execution.  */
   bfd_vma g = MINUS_ONE;
@@ -2107,7 +2104,6 @@ score_elf_final_link_relocate (reloc_how
     case R_SCORE_HI16:
     case R_SCORE_LO16:
     case R_SCORE_GPREL32:
-      gp0 = _bfd_get_gp_value (input_bfd);
       gp = _bfd_get_gp_value (output_bfd);
       break;
 
@@ -2408,7 +2404,6 @@ s3_bfd_score_elf_relocate_section (bfd *
                                    asection **local_sections)
 {
   Elf_Internal_Shdr *symtab_hdr;
-  struct elf_link_hash_entry **sym_hashes;
   Elf_Internal_Rela *rel;
   Elf_Internal_Rela *relend;
   const char *name;
@@ -2439,7 +2434,6 @@ s3_bfd_score_elf_relocate_section (bfd *
 
   symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
   extsymoff = (elf_bad_symtab (input_bfd)) ? 0 : symtab_hdr->sh_info;
-  sym_hashes = elf_sym_hashes (input_bfd);
   rel = relocs;
   relend = relocs + input_section->reloc_count;
   for (; rel < relend; rel++)
Index: bfd/elf32-score7.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-score7.c,v
retrieving revision 1.4
diff -u -p -r1.4 elf32-score7.c
--- bfd/elf32-score7.c	4 Feb 2010 09:16:40 -0000	1.4
+++ bfd/elf32-score7.c	27 Jun 2010 02:51:54 -0000
@@ -1638,9 +1638,8 @@ score_elf_got_offset_from_index (bfd *dy
 {
   asection *sgot;
   bfd_vma gp;
-  struct score_got_info *g;
 
-  g = score_elf_got_info (dynobj, &sgot);
+  score_elf_got_info (dynobj, &sgot);
   gp = _bfd_get_gp_value (output_bfd);
 
   return sgot->output_section->vma + sgot->output_offset + got_index - gp;
@@ -2243,7 +2242,6 @@ s7_bfd_score_elf_relocate_section (bfd *
                                    asection **local_sections)
 {
   Elf_Internal_Shdr *symtab_hdr;
-  struct elf_link_hash_entry **sym_hashes;
   Elf_Internal_Rela *rel;
   Elf_Internal_Rela *relend;
   const char *name;
@@ -2274,7 +2272,6 @@ s7_bfd_score_elf_relocate_section (bfd *
 
   symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
   extsymoff = (elf_bad_symtab (input_bfd)) ? 0 : symtab_hdr->sh_info;
-  sym_hashes = elf_sym_hashes (input_bfd);
   rel = relocs;
   relend = relocs + input_section->reloc_count;
   for (; rel < relend; rel++)
Index: bfd/elf32-sh.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-sh.c,v
retrieving revision 1.164
diff -u -p -r1.164 elf32-sh.c
--- bfd/elf32-sh.c	25 May 2010 14:12:37 -0000	1.164
+++ bfd/elf32-sh.c	27 Jun 2010 02:51:57 -0000
@@ -6092,15 +6092,10 @@ sh_elf_check_relocs (bfd *abfd, struct b
   struct elf_sh_link_hash_table *htab;
   const Elf_Internal_Rela *rel;
   const Elf_Internal_Rela *rel_end;
-  bfd_vma *local_got_offsets;
-  asection *sgot;
-  asection *srelgot;
   asection *sreloc;
   unsigned int r_type;
   int got_type, old_got_type;
 
-  sgot = NULL;
-  srelgot = NULL;
   sreloc = NULL;
 
   if (info->relocatable)
@@ -6115,8 +6110,6 @@ sh_elf_check_relocs (bfd *abfd, struct b
   if (htab == NULL)
     return FALSE;
 
-  local_got_offsets = elf_local_got_offsets (abfd);
-
   rel_end = relocs + sec->reloc_count;
   for (rel = relocs; rel < rel_end; rel++)
     {
Index: bfd/elf32-sh64.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-sh64.c,v
retrieving revision 1.45
diff -u -p -r1.45 elf32-sh64.c
--- bfd/elf32-sh64.c	2 Sep 2009 07:18:36 -0000	1.45
+++ bfd/elf32-sh64.c	27 Jun 2010 02:51:57 -0000
@@ -104,7 +104,8 @@ static void sh64_find_section_for_addres
 /* This COFF-only function (only compiled with COFF support, making
    ELF-only chains problematic) returns TRUE early for SH4, so let's just
    define it TRUE here.  */
-#define _bfd_sh_align_load_span(a,b,c,d,e,f,g,h,i,j) TRUE
+#define _bfd_sh_align_load_span(a,b,c,d,e,f,g,h,i,j) \
+  ((void) f, (void) h, (void) i, TRUE)
 
 #define GOT_BIAS (-((long)-32768))
 #define INCLUDE_SHMEDIA
Index: bfd/elf32-spu.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-spu.c,v
retrieving revision 1.95
diff -u -p -r1.95 elf32-spu.c
--- bfd/elf32-spu.c	24 Apr 2010 01:05:24 -0000	1.95
+++ bfd/elf32-spu.c	27 Jun 2010 02:51:59 -0000
@@ -4827,14 +4827,12 @@ spu_elf_relocate_section (bfd *output_bf
       bfd_vma addend;
       bfd_reloc_status_type r;
       bfd_boolean unresolved_reloc;
-      bfd_boolean warned;
       enum _stub_type stub_type;
 
       r_symndx = ELF32_R_SYM (rel->r_info);
       r_type = ELF32_R_TYPE (rel->r_info);
       howto = elf_howto_table + r_type;
       unresolved_reloc = FALSE;
-      warned = FALSE;
       h = NULL;
       sym = NULL;
       sec = NULL;
@@ -4890,7 +4888,6 @@ spu_elf_relocate_section (bfd *output_bf
 						      input_section,
 						      rel->r_offset, err))
 		return FALSE;
-	      warned = TRUE;
 	    }
 	  sym_name = h->root.root.string;
 	}
Index: bfd/elf32-v850.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-v850.c,v
retrieving revision 1.77
diff -u -p -r1.77 elf32-v850.c
--- bfd/elf32-v850.c	11 Jan 2010 14:19:40 -0000	1.77
+++ bfd/elf32-v850.c	27 Jun 2010 02:52:00 -0000
@@ -47,7 +47,6 @@ v850_elf_check_relocs (bfd *abfd,
 		       const Elf_Internal_Rela *relocs)
 {
   bfd_boolean ret = TRUE;
-  bfd *dynobj;
   Elf_Internal_Shdr *symtab_hdr;
   struct elf_link_hash_entry **sym_hashes;
   const Elf_Internal_Rela *rel;
@@ -64,7 +63,6 @@ v850_elf_check_relocs (bfd *abfd,
 		      sec, abfd);
 #endif
 
-  dynobj = elf_hash_table (info)->dynobj;
   symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
   sym_hashes = elf_sym_hashes (abfd);
 
@@ -273,8 +271,6 @@ find_remembered_hi16s_reloc (bfd_vma add
 {
   hi16s_location *match = NULL;
   hi16s_location *entry;
-  hi16s_location *previous = NULL;
-  hi16s_location *prev;
   bfd_byte *addr;
 
   /* Search the table.  Record the most recent entry that matches.  */
@@ -283,11 +279,8 @@ find_remembered_hi16s_reloc (bfd_vma add
       if (entry->addend == addend
 	  && (match == NULL || match->counter < entry->counter))
 	{
-	  previous = prev;
 	  match    = entry;
 	}
-
-      prev = entry;
     }
 
   if (match == NULL)
Index: bfd/elf32-vax.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-vax.c,v
retrieving revision 1.60
diff -u -p -r1.60 elf32-vax.c
--- bfd/elf32-vax.c	4 Feb 2010 09:16:40 -0000	1.60
+++ bfd/elf32-vax.c	27 Jun 2010 02:52:01 -0000
@@ -494,7 +494,6 @@ elf32_vax_set_private_flags (bfd *abfd, 
 static bfd_boolean
 elf32_vax_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
 {
-  flagword out_flags;
   flagword in_flags;
 
   if (   bfd_get_flavour (ibfd) != bfd_target_elf_flavour
@@ -502,7 +501,6 @@ elf32_vax_merge_private_bfd_data (bfd *i
     return TRUE;
 
   in_flags  = elf_elfheader (ibfd)->e_flags;
-  out_flags = elf_elfheader (obfd)->e_flags;
 
   if (!elf_flags_init (obfd))
     {
@@ -1362,7 +1360,6 @@ elf_vax_relocate_section (bfd *output_bf
   bfd *dynobj;
   Elf_Internal_Shdr *symtab_hdr;
   struct elf_link_hash_entry **sym_hashes;
-  bfd_vma *local_got_offsets;
   bfd_vma plt_index;
   bfd_vma got_offset;
   asection *sgot;
@@ -1375,7 +1372,6 @@ elf_vax_relocate_section (bfd *output_bf
   dynobj = elf_hash_table (info)->dynobj;
   symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
   sym_hashes = elf_sym_hashes (input_bfd);
-  local_got_offsets = elf_local_got_offsets (input_bfd);
 
   sgot = NULL;
   splt = NULL;
Index: bfd/elf32-xc16x.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-xc16x.c,v
retrieving revision 1.7
diff -u -p -r1.7 elf32-xc16x.c
--- bfd/elf32-xc16x.c	2 Sep 2009 07:18:36 -0000	1.7
+++ bfd/elf32-xc16x.c	27 Jun 2010 02:52:01 -0000
@@ -358,7 +358,6 @@ elf32_xc16x_relocate_section (bfd *outpu
       asection *sec;
       struct elf_link_hash_entry *h;
       bfd_vma relocation;
-      bfd_reloc_status_type r;
 
       /* This is a final link.  */
       r_symndx = ELF32_R_SYM (rel->r_info);
@@ -398,11 +397,11 @@ elf32_xc16x_relocate_section (bfd *outpu
       if (info->relocatable)
 	continue;
 
-      r = elf32_xc16x_final_link_relocate (r_type, input_bfd, output_bfd,
-					   input_section,
-					   contents, rel->r_offset,
-					   relocation, rel->r_addend,
-					   info, sec, h == NULL);
+      elf32_xc16x_final_link_relocate (r_type, input_bfd, output_bfd,
+				       input_section,
+				       contents, rel->r_offset,
+				       relocation, rel->r_addend,
+				       info, sec, h == NULL);
     }
 
   return TRUE;
Index: bfd/elf32-xtensa.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-xtensa.c,v
retrieving revision 1.122
diff -u -p -r1.122 elf32-xtensa.c
--- bfd/elf32-xtensa.c	28 May 2010 18:10:45 -0000	1.122
+++ bfd/elf32-xtensa.c	27 Jun 2010 02:52:08 -0000
@@ -7829,7 +7829,6 @@ xlate_offset_with_removed_text (const xl
 				text_action_list *action_list,
 				bfd_vma offset)
 {
-  xlate_map_entry_t tmp;
   void *r;
   xlate_map_entry_t *e;
 
@@ -7839,10 +7838,6 @@ xlate_offset_with_removed_text (const xl
   if (map->entry_count == 0)
     return offset;
 
-  tmp.orig_address = offset;
-  tmp.new_address = offset;
-  tmp.size = 1;
-
   r = bsearch (&offset, map->entry, map->entry_count,
 	       sizeof (xlate_map_entry_t), &xlate_compare);
   e = (xlate_map_entry_t *) r;
@@ -9660,12 +9655,10 @@ move_literal (bfd *abfd,
     {
       int r_type;
       unsigned i;
-      asection *target_sec;
       reloc_bfd_fix *fix;
       unsigned insert_at;
 
       r_type = ELF32_R_TYPE (r_rel->rela.r_info);
-      target_sec = r_reloc_get_section (r_rel);
 
       /* This is the difficult case.  We have to create a fix up.  */
       this_rela.r_offset = offset;
Index: bfd/elf64-hppa.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-hppa.c,v
retrieving revision 1.95
diff -u -p -r1.95 elf64-hppa.c
--- bfd/elf64-hppa.c	4 Feb 2010 09:16:41 -0000	1.95
+++ bfd/elf64-hppa.c	27 Jun 2010 02:52:08 -0000
@@ -371,8 +371,6 @@ elf64_hppa_section_from_shdr (bfd *abfd,
 			      const char *name,
 			      int shindex)
 {
-  asection *newsect;
-
   switch (hdr->sh_type)
     {
     case SHT_PARISC_EXT:
@@ -391,7 +389,6 @@ elf64_hppa_section_from_shdr (bfd *abfd,
 
   if (! _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex))
     return FALSE;
-  newsect = hdr->bfd_section;
 
   return TRUE;
 }
@@ -515,9 +512,6 @@ elf64_hppa_check_relocs (bfd *abfd,
   const Elf_Internal_Rela *relend;
   Elf_Internal_Shdr *symtab_hdr;
   const Elf_Internal_Rela *rel;
-  asection *dlt, *plt, *stubs;
-  char *buf;
-  size_t buf_len;
   unsigned int sec_symndx;
 
   if (info->relocatable)
@@ -630,10 +624,6 @@ elf64_hppa_check_relocs (bfd *abfd,
   else
     sec_symndx = 0;
 
-  dlt = plt = stubs = NULL;
-  buf = NULL;
-  buf_len = 0;
-
   relend = relocs + sec->reloc_count;
   for (rel = relocs; rel < relend; ++rel)
     {
@@ -907,13 +897,9 @@ elf64_hppa_check_relocs (bfd *abfd,
 	}
     }
 
-  if (buf)
-    free (buf);
   return TRUE;
 
  err_out:
-  if (buf)
-    free (buf);
   return FALSE;
 }
 
@@ -1979,7 +1965,7 @@ elf64_hppa_finish_dynamic_symbol (bfd *o
 				  Elf_Internal_Sym *sym)
 {
   struct elf64_hppa_link_hash_entry *hh = hppa_elf_hash_entry (eh);
-  asection *stub, *splt, *sdlt, *sopd, *spltrel, *sdltrel;
+  asection *stub, *splt, *sopd, *spltrel;
   struct elf64_hppa_link_hash_table *hppa_info;
 
   hppa_info = hppa_link_hash_table (info);
@@ -1988,10 +1974,8 @@ elf64_hppa_finish_dynamic_symbol (bfd *o
 
   stub = hppa_info->stub_sec;
   splt = hppa_info->plt_sec;
-  sdlt = hppa_info->dlt_sec;
   sopd = hppa_info->opd_sec;
   spltrel = hppa_info->plt_rel_sec;
-  sdltrel = hppa_info->dlt_rel_sec;
 
   /* Incredible.  It is actually necessary to NOT use the symbol's real
      value when building the dynamic symbol table for a shared library.
@@ -3870,7 +3854,6 @@ elf64_hppa_relocate_section (bfd *output
       asection *sym_sec;
       bfd_vma relocation;
       bfd_reloc_status_type r;
-      bfd_boolean warned_undef;
 
       r_type = ELF_R_TYPE (rel->r_info);
       if (r_type < 0 || r_type >= (int) R_PARISC_UNIMPLEMENTED)
@@ -3887,7 +3870,6 @@ elf64_hppa_relocate_section (bfd *output
       eh = NULL;
       sym = NULL;
       sym_sec = NULL;
-      warned_undef = FALSE;
       if (r_symndx < symtab_hdr->sh_info)
 	{
 	  /* This is a local symbol, hh defaults to NULL.  */
@@ -3898,7 +3880,6 @@ elf64_hppa_relocate_section (bfd *output
       else
 	{
 	  /* This is not a local symbol.  */
-	  bfd_boolean unresolved_reloc;
 	  struct elf_link_hash_entry **sym_hashes = elf_sym_hashes (input_bfd);
 
 	  /* It seems this can happen with erroneous or unsupported 
@@ -3912,21 +3893,13 @@ elf64_hppa_relocate_section (bfd *output
 		 || eh->root.type == bfd_link_hash_warning)
 	    eh = (struct elf_link_hash_entry *) eh->root.u.i.link;
 
-	  warned_undef = FALSE;
-	  unresolved_reloc = FALSE;
 	  relocation = 0;
 	  if (eh->root.type == bfd_link_hash_defined
 	      || eh->root.type == bfd_link_hash_defweak)
 	    {
 	      sym_sec = eh->root.u.def.section;
-	      if (sym_sec == NULL
-		  || sym_sec->output_section == NULL)
-		/* Set a flag that will be cleared later if we find a
-		   relocation value for this symbol.  output_section
-		   is typically NULL for symbols satisfied by a shared
-		   library.  */
-		unresolved_reloc = TRUE;
-	      else
+	      if (sym_sec != NULL
+		  && sym_sec->output_section != NULL)
 		relocation = (eh->root.u.def.value
 			      + sym_sec->output_section->vma
 			      + sym_sec->output_offset);
@@ -3950,7 +3923,6 @@ elf64_hppa_relocate_section (bfd *output
 						      input_section,
 						      rel->r_offset, err))
 		return FALSE;
-	      warned_undef = TRUE;
 	    }
 
           if (!info->relocatable
@@ -3967,7 +3939,6 @@ elf64_hppa_relocate_section (bfd *output
                       (info, eh_name (eh), input_bfd,
                        input_section, rel->r_offset, FALSE))
                     return FALSE;
-                  warned_undef = TRUE;
                 }
             }
 	}
Index: bfd/elf64-mmix.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-mmix.c,v
retrieving revision 1.61
diff -u -p -r1.61 elf64-mmix.c
--- bfd/elf64-mmix.c	2 Sep 2009 07:18:36 -0000	1.61
+++ bfd/elf64-mmix.c	27 Jun 2010 02:52:08 -0000
@@ -1267,7 +1267,6 @@ mmix_elf_reloc (abfd, reloc_entry, symbo
   asection *reloc_target_output_section;
   bfd_reloc_status_type flag = bfd_reloc_ok;
   bfd_vma output_base = 0;
-  bfd_vma addr;
 
   r = bfd_elf_generic_reloc (abfd, reloc_entry, symbol, data,
 			     input_section, output_bfd, error_message);
@@ -1306,9 +1305,6 @@ mmix_elf_reloc (abfd, reloc_entry, symbo
 
   relocation += output_base + symbol->section->output_offset;
 
-  /* Get position of relocation.  */
-  addr = (reloc_entry->address + input_section->output_section->vma
-	  + input_section->output_offset);
   if (output_bfd != (bfd *) NULL)
     {
       /* Add in supplied addend.  */
@@ -2581,7 +2577,6 @@ mmix_elf_relax_section (abfd, sec, link_
      spot a missing actual initialization.  */
   size_t bpono = (size_t) -1;
   size_t pjsno = 0;
-  bfd *bpo_greg_owner;
   Elf_Internal_Sym *isymbuf = NULL;
   bfd_size_type size = sec->rawsize ? sec->rawsize : sec->size;
 
@@ -2604,8 +2599,6 @@ mmix_elf_relax_section (abfd, sec, link_
 
   symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
 
-  bpo_greg_owner = (bfd *) link_info->base_file;
-
   if (bpodata != NULL)
     {
       bpo_gregs_section = bpodata->bpo_greg_section;
Index: bfd/elf64-ppc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-ppc.c,v
retrieving revision 1.328
diff -u -p -r1.328 elf64-ppc.c
--- bfd/elf64-ppc.c	25 Jun 2010 05:20:55 -0000	1.328
+++ bfd/elf64-ppc.c	27 Jun 2010 02:52:13 -0000
@@ -4844,7 +4844,7 @@ ppc64_elf_check_relocs (bfd *abfd, struc
 {
   struct ppc_link_hash_table *htab;
   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;
   asection *sreloc;
@@ -4874,12 +4874,7 @@ ppc64_elf_check_relocs (bfd *abfd, struc
   dottga = elf_link_hash_lookup (&htab->elf, ".__tls_get_addr",
 				 FALSE, FALSE, TRUE);
   symtab_hdr = &elf_symtab_hdr (abfd);
-
   sym_hashes = elf_sym_hashes (abfd);
-  sym_hashes_end = (sym_hashes
-		    + symtab_hdr->sh_size / sizeof (Elf64_External_Sym)
-		    - symtab_hdr->sh_info);
-
   sreloc = NULL;
   opd_sym_map = NULL;
   if (strcmp (sec->name, ".opd") == 0)
@@ -6926,7 +6921,6 @@ ppc64_elf_edit_opd (struct bfd_link_info
       Elf_Internal_Rela *relstart, *rel, *relend;
       Elf_Internal_Shdr *symtab_hdr;
       Elf_Internal_Sym *local_syms;
-      struct elf_link_hash_entry **sym_hashes;
       bfd_vma offset;
       struct _opd_sec_data *opd;
       bfd_boolean need_edit, add_aux_fields;
@@ -6951,7 +6945,6 @@ ppc64_elf_edit_opd (struct bfd_link_info
 
       local_syms = NULL;
       symtab_hdr = &elf_symtab_hdr (ibfd);
-      sym_hashes = elf_sym_hashes (ibfd);
 
       /* Read the relocations.  */
       relstart = _bfd_elf_link_read_relocs (ibfd, sec, NULL, NULL,
@@ -7912,7 +7905,6 @@ ppc64_elf_edit_toc (struct bfd_link_info
       asection *toc, *sec;
       Elf_Internal_Shdr *symtab_hdr;
       Elf_Internal_Sym *local_syms;
-      struct elf_link_hash_entry **sym_hashes;
       Elf_Internal_Rela *relstart, *rel;
       unsigned long *skip, *drop;
       unsigned char *used;
@@ -7930,7 +7922,6 @@ ppc64_elf_edit_toc (struct bfd_link_info
 
       local_syms = NULL;
       symtab_hdr = &elf_symtab_hdr (ibfd);
-      sym_hashes = elf_sym_hashes (ibfd);
 
       /* Look at sections dropped from the final link.  */
       skip = NULL;
Index: bfd/elfxx-ia64.c
===================================================================
RCS file: /cvs/src/src/bfd/elfxx-ia64.c,v
retrieving revision 1.223
diff -u -p -r1.223 elfxx-ia64.c
--- bfd/elfxx-ia64.c	8 Jun 2010 08:26:01 -0000	1.223
+++ bfd/elfxx-ia64.c	27 Jun 2010 02:52:15 -0000
@@ -1409,8 +1409,6 @@ elfNN_ia64_section_from_shdr (bfd *abfd,
 			      const char *name,
 			      int shindex)
 {
-  asection *newsect;
-
   /* There ought to be a place to keep ELF backend specific flags, but
      at the moment there isn't one.  We just keep track of the
      sections by their name, instead.  Fortunately, the ABI gives
@@ -1433,7 +1431,6 @@ elfNN_ia64_section_from_shdr (bfd *abfd,
 
   if (! _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex))
     return FALSE;
-  newsect = hdr->bfd_section;
 
   return TRUE;
 }
@@ -5740,8 +5737,6 @@ elfNN_vms_section_from_shdr (bfd *abfd,
 			     const char *name,
 			     int shindex)
 {
-  asection *newsect;
-
   switch (hdr->sh_type)
     {
     case SHT_IA_64_VMS_TRACE:
@@ -5755,7 +5750,6 @@ elfNN_vms_section_from_shdr (bfd *abfd,
 
   if (! _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex))
     return FALSE;
-  newsect = hdr->bfd_section;
 
   return TRUE;
 }
Index: bfd/elfxx-sparc.c
===================================================================
RCS file: /cvs/src/src/bfd/elfxx-sparc.c,v
retrieving revision 1.53
diff -u -p -r1.53 elfxx-sparc.c
--- bfd/elfxx-sparc.c	2 Mar 2010 07:42:37 -0000	1.53
+++ bfd/elfxx-sparc.c	27 Jun 2010 02:52:17 -0000
@@ -1326,7 +1326,6 @@ _bfd_sparc_elf_check_relocs (bfd *abfd, 
   struct _bfd_sparc_elf_link_hash_table *htab;
   Elf_Internal_Shdr *symtab_hdr;
   struct elf_link_hash_entry **sym_hashes;
-  bfd_vma *local_got_offsets;
   const Elf_Internal_Rela *rel;
   const Elf_Internal_Rela *rel_end;
   asection *sreloc;
@@ -1340,7 +1339,6 @@ _bfd_sparc_elf_check_relocs (bfd *abfd, 
   BFD_ASSERT (htab != NULL);
   symtab_hdr = &elf_symtab_hdr (abfd);
   sym_hashes = elf_sym_hashes (abfd);
-  local_got_offsets = elf_local_got_offsets (abfd);
 
   sreloc = NULL;
 
@@ -3642,7 +3640,7 @@ _bfd_sparc_elf_relocate_section (bfd *ou
 	  if (info->shared)
 	    {
 	      Elf_Internal_Rela outrel;
-	      bfd_boolean skip, relocate = FALSE;
+	      bfd_boolean skip;
 
 	      BFD_ASSERT (sreloc != NULL);
 	      skip = FALSE;
@@ -3652,7 +3650,7 @@ _bfd_sparc_elf_relocate_section (bfd *ou
 	      if (outrel.r_offset == (bfd_vma) -1)
 		skip = TRUE;
 	      else if (outrel.r_offset == (bfd_vma) -2)
-		skip = TRUE, relocate = TRUE;
+		skip = TRUE;
 	      outrel.r_offset += (input_section->output_section->vma
 				  + input_section->output_offset);
 	      if (skip)
Index: bfd/hp300hpux.c
===================================================================
RCS file: /cvs/src/src/bfd/hp300hpux.c,v
retrieving revision 1.18
diff -u -p -r1.18 hp300hpux.c
--- bfd/hp300hpux.c	2 Sep 2009 07:18:37 -0000	1.18
+++ bfd/hp300hpux.c	27 Jun 2010 02:52:17 -0000
@@ -592,7 +592,6 @@ MY (slurp_symbol_table) (abfd)
   /* OK, now walk the new symtable, caching symbol properties */
   {
     aout_symbol_type *cache_ptr = cached;
-    aout_symbol_type cache_save;
     /* Run through table and copy values */
     for (sym_pointer = syms, cache_ptr = cached;
 	 sym_pointer < sym_end; sym_pointer++, cache_ptr++)
@@ -606,7 +605,6 @@ MY (slurp_symbol_table) (abfd)
 	length = bfd_get_8 (abfd, sym_pointer->e_length);
 	cache_ptr->other = length;	/* other not used, save length here */
 
-	cache_save = *cache_ptr;
 	convert_sym_type (sym_pointer, cache_ptr, abfd);
 	if (!translate_from_native_sym_flags (abfd, cache_ptr))
 	  return FALSE;
Index: bfd/i386lynx.c
===================================================================
RCS file: /cvs/src/src/bfd/i386lynx.c,v
retrieving revision 1.16
diff -u -p -r1.16 i386lynx.c
--- bfd/i386lynx.c	2 Oct 2009 14:40:41 -0000	1.16
+++ bfd/i386lynx.c	27 Jun 2010 02:52:17 -0000
@@ -136,7 +136,6 @@ NAME(lynx,swap_std_reloc_out) (abfd, g, 
   unsigned int r_length;
   int r_pcrel;
   int r_baserel, r_jmptable, r_relative;
-  unsigned int r_addend;
   asection *output_section = sym->section->output_section;
 
   PUT_WORD (abfd, g->address, natptr->r_address);
@@ -148,8 +147,6 @@ NAME(lynx,swap_std_reloc_out) (abfd, g, 
   r_jmptable = 0;
   r_relative = 0;
 
-  r_addend = g->addend + (*(g->sym_ptr_ptr))->section->output_section->vma;
-
   /* name was clobbered by aout_write_syms to be symbol index */
 
   /* If this relocation is relative to a symbol then set the
@@ -373,7 +370,6 @@ NAME(lynx,swap_std_reloc_in) (abfd, byte
   int r_extern;
   unsigned int r_length;
   int r_pcrel;
-  int r_baserel, r_jmptable, r_relative;
   struct aoutdata *su = &(abfd->tdata.aout_data->a);
 
   cache_ptr->address = H_GET_32 (abfd, bytes->r_address);
@@ -381,9 +377,6 @@ NAME(lynx,swap_std_reloc_in) (abfd, byte
   r_index = bytes->r_index[1];
   r_extern = (0 != (bytes->r_index[0] & RELOC_STD_BITS_EXTERN_BIG));
   r_pcrel = (0 != (bytes->r_index[0] & RELOC_STD_BITS_PCREL_BIG));
-  r_baserel = (0 != (bytes->r_index[0] & RELOC_STD_BITS_BASEREL_BIG));
-  r_jmptable = (0 != (bytes->r_index[0] & RELOC_STD_BITS_JMPTABLE_BIG));
-  r_relative = (0 != (bytes->r_index[0] & RELOC_STD_BITS_RELATIVE_BIG));
   r_length = (bytes->r_index[0] & RELOC_STD_BITS_LENGTH_BIG)
     >> RELOC_STD_BITS_LENGTH_SH_BIG;
 
Index: bfd/ieee.c
===================================================================
RCS file: /cvs/src/src/bfd/ieee.c,v
retrieving revision 1.69
diff -u -p -r1.69 ieee.c
--- bfd/ieee.c	24 Mar 2010 15:41:59 -0000	1.69
+++ bfd/ieee.c	27 Jun 2010 02:52:18 -0000
@@ -533,6 +533,7 @@ parse_expression (ieee_data_type *ieee,
 	    next_byte (&(ieee->h));
 	    *pcrel = TRUE;
 	    section_n = must_parse_int (&(ieee->h));
+	    (void) section_n;
 	    PUSH (NOSYMBOL, bfd_abs_section_ptr, 0);
 	    break;
 	  }
@@ -637,6 +638,8 @@ parse_expression (ieee_data_type *ieee,
       ieee_symbol_index_type sy1;
 
       POP (sy1, section1, *extra);
+      (void) section1;
+      (void) sy1;
     }
 
   POP (*symbol, dummy, *value);
@@ -776,6 +779,7 @@ ieee_slurp_external_symbols (bfd *abfd)
 	      case ieee_attribute_record_enum:
 		symbol_name_index = must_parse_int (&(ieee->h));
 		symbol_type_index = must_parse_int (&(ieee->h));
+		(void) symbol_type_index;
 		symbol_attribute_def = must_parse_int (&(ieee->h));
 		switch (symbol_attribute_def)
 		  {
@@ -850,6 +854,7 @@ ieee_slurp_external_symbols (bfd *abfd)
 	    next_byte (&(ieee->h));
 
 	    symbol_name_index = must_parse_int (&(ieee->h));
+	    (void) symbol_name_index;
 	    parse_expression (ieee,
 			      &symbol->symbol.value,
 			      &symbol_ignore,
@@ -2669,6 +2674,7 @@ drop_int (struct output_buffer_struct *b
 	  break;
 	}
     }
+  (void) ch;
   OUT (0x84);
   buf->ptrp = output_ptr;
   buf->buffer = output_buffer;
Index: bfd/mach-o.c
===================================================================
RCS file: /cvs/src/src/bfd/mach-o.c,v
retrieving revision 1.55
diff -u -p -r1.55 mach-o.c
--- bfd/mach-o.c	24 Mar 2010 15:41:59 -0000	1.55
+++ bfd/mach-o.c	27 Jun 2010 02:52:22 -0000
@@ -630,13 +630,11 @@ bfd_mach_o_write_thread (bfd *abfd, bfd_
   unsigned int i;
   unsigned char buf[8];
   unsigned int offset;
-  unsigned int nflavours;
 
   BFD_ASSERT ((command->type == BFD_MACH_O_LC_THREAD)
 	      || (command->type == BFD_MACH_O_LC_UNIXTHREAD));
 
   offset = 8;
-  nflavours = 0;
   for (i = 0; i < cmd->nflavours; i++)
     {
       BFD_ASSERT ((cmd->flavours[i].size % 4) == 0);
Index: bfd/mmo.c
===================================================================
RCS file: /cvs/src/src/bfd/mmo.c,v
retrieving revision 1.40
diff -u -p -r1.40 mmo.c
--- bfd/mmo.c	23 Nov 2009 14:41:30 -0000	1.40
+++ bfd/mmo.c	27 Jun 2010 02:52:22 -0000
@@ -1530,7 +1530,6 @@ mmo_scan (bfd *abfd)
   asection *sec = bfd_make_section_old_way (abfd, MMO_TEXT_SECTION_NAME);
   asection *non_spec_sec = NULL;
   bfd_vma non_spec_vma = 0;
-  char *current_filename = NULL;
   bfd_size_type nbytes_read = 0;
   /* Buffer with room to read a 64-bit value.  */
   bfd_byte buf[8];
@@ -1789,7 +1788,6 @@ mmo_scan (bfd *abfd)
 		  goto error_return;
 		}
 
-	      current_filename = file_names[y];
 	      lineno = 0;
 	      break;
 
@@ -2827,7 +2825,6 @@ static bfd_boolean
 mmo_write_symbols_and_terminator (bfd *abfd)
 {
   int count = bfd_get_symcount (abfd);
-  asymbol *maintable[2];
   asymbol **table;
   asymbol **orig_table = bfd_get_outsymbols (abfd);
   int serno;
@@ -2843,8 +2840,6 @@ mmo_write_symbols_and_terminator (bfd *a
   fakemain->value = bfd_get_start_address (abfd);
   fakemain->name = MMIX_START_SYMBOL_NAME;
   fakemain->section = bfd_abs_section_ptr;
-  maintable[0] = fakemain;
-  maintable[1] = NULL;
 
   memset (&root, 0, sizeof (root));
 
Index: bfd/nlm32-sparc.c
===================================================================
RCS file: /cvs/src/src/bfd/nlm32-sparc.c,v
retrieving revision 1.19
diff -u -p -r1.19 nlm32-sparc.c
--- bfd/nlm32-sparc.c	11 Dec 2009 13:42:04 -0000	1.19
+++ bfd/nlm32-sparc.c	27 Jun 2010 02:52:22 -0000
@@ -96,14 +96,12 @@ nlm_sparc_read_reloc (bfd *abfd,
   unsigned int howto_index;
   unsigned int type;
   struct nlm32_sparc_reloc_ext tmp_reloc;
-  asection *code_sec, *data_sec;
+  asection *code_sec;
 
   if (bfd_bread (&tmp_reloc, (bfd_size_type) 12, abfd) != 12)
     return FALSE;
 
   code_sec = bfd_get_section_by_name (abfd, NLM_CODE_NAME);
-  data_sec = bfd_get_section_by_name (abfd, NLM_INITIALIZED_DATA_NAME);
-
   *secp = code_sec;
 
   val = bfd_get_32 (abfd, tmp_reloc.offset);
Index: bfd/pdp11.c
===================================================================
RCS file: /cvs/src/src/bfd/pdp11.c,v
retrieving revision 1.43
diff -u -p -r1.43 pdp11.c
--- bfd/pdp11.c	11 Dec 2009 13:42:04 -0000	1.43
+++ bfd/pdp11.c	27 Jun 2010 02:52:23 -0000
@@ -3214,7 +3214,6 @@ pdp11_aout_link_input_section (struct ao
   char *strings;
   struct aout_link_hash_entry **sym_hashes;
   int *symbol_map;
-  bfd_size_type reloc_count;
   bfd_byte *rel;
   bfd_byte *rel_end;
 
@@ -3231,7 +3230,6 @@ pdp11_aout_link_input_section (struct ao
   sym_hashes = obj_aout_sym_hashes (input_bfd);
   symbol_map = finfo->symbol_map;
 
-  reloc_count = rel_size / RELOC_SIZE;
   rel = relocs;
   rel_end = rel + rel_size;
   for (; rel < rel_end; rel += RELOC_SIZE)
@@ -3568,8 +3566,6 @@ aout_link_input_section (struct aout_fin
 static bfd_boolean
 aout_link_input_bfd (struct aout_final_link_info *finfo, bfd *input_bfd)
 {
-  bfd_size_type sym_count;
-
   BFD_ASSERT (bfd_get_format (input_bfd) == bfd_object);
 
   /* If this is a dynamic object, it may need special handling.  */
@@ -3583,8 +3579,6 @@ aout_link_input_bfd (struct aout_final_l
   if (! aout_get_external_symbols (input_bfd))
     return FALSE;
 
-  sym_count = obj_aout_external_sym_count (input_bfd);
-
   /* Write out the symbols and get a map of the new indices.  The map
      is placed into finfo->symbol_map.  */
   if (! aout_link_write_symbols (finfo, input_bfd))
Index: bfd/pe-mips.c
===================================================================
RCS file: /cvs/src/src/bfd/pe-mips.c,v
retrieving revision 1.23
diff -u -p -r1.23 pe-mips.c
--- bfd/pe-mips.c	18 Feb 2009 18:23:07 -0000	1.23
+++ bfd/pe-mips.c	27 Jun 2010 02:52:24 -0000
@@ -552,7 +552,6 @@ mips_swap_reloc_in (bfd * abfd, void * s
 static unsigned int
 mips_swap_reloc_out (bfd * abfd, void * src, void * dst)
 {
-  static int prev_offset = 1;
   static bfd_vma prev_addr = 0;
   struct internal_reloc *reloc_src = (struct internal_reloc *)src;
   struct external_reloc *reloc_dst = (struct external_reloc *)dst;
@@ -561,7 +560,6 @@ mips_swap_reloc_out (bfd * abfd, void * 
     {
     case MIPS_R_REFHI:
       prev_addr = reloc_src->r_vaddr;
-      prev_offset = reloc_src->r_offset;
       break;
     case MIPS_R_REFLO:
       if (reloc_src->r_vaddr == prev_addr)
@@ -599,13 +597,9 @@ coff_pe_mips_relocate_section (bfd *outp
 			       struct internal_syment *syms,
 			       asection **sections)
 {
-  bfd_vma gp;
-  bfd_boolean gp_undefined;
-  size_t adjust;
   struct internal_reloc *rel;
   struct internal_reloc *rel_end;
   unsigned int i;
-  bfd_boolean got_lo;
 
   if (info->relocatable)
     {
@@ -618,10 +612,6 @@ coff_pe_mips_relocate_section (bfd *outp
   BFD_ASSERT (input_bfd->xvec->byteorder
 	      == output_bfd->xvec->byteorder);
 
-  gp = _bfd_get_gp_value (output_bfd);
-  gp_undefined = (gp == 0) ? TRUE : FALSE;
-  got_lo = FALSE;
-  adjust = 0;
   rel = relocs;
   rel_end = rel + input_section->reloc_count;
 
Index: bfd/peXXigen.c
===================================================================
RCS file: /cvs/src/src/bfd/peXXigen.c,v
retrieving revision 1.63
diff -u -p -r1.63 peXXigen.c
--- bfd/peXXigen.c	9 Apr 2010 14:40:16 -0000	1.63
+++ bfd/peXXigen.c	27 Jun 2010 02:52:25 -0000
@@ -1650,7 +1650,9 @@ pe_print_pdata (bfd * abfd, void * vfile
       bfd_vma eh_handler;
       bfd_vma eh_data;
       bfd_vma prolog_end_addr;
+#if !defined(COFF_WITH_pep) || defined(COFF_WITH_pex64)
       int em_data;
+#endif
 
       if (i + PDATA_ROW_SIZE > stop)
 	break;
@@ -1666,7 +1668,9 @@ pe_print_pdata (bfd * abfd, void * vfile
 	/* We are probably into the padding of the section now.  */
 	break;
 
+#if !defined(COFF_WITH_pep) || defined(COFF_WITH_pex64)
       em_data = ((eh_handler & 0x1) << 2) | (prolog_end_addr & 0x3);
+#endif
       eh_handler &= ~(bfd_vma) 0x3;
       prolog_end_addr &= ~(bfd_vma) 0x3;
 
Index: bfd/som.c
===================================================================
RCS file: /cvs/src/src/bfd/som.c,v
retrieving revision 1.81
diff -u -p -r1.81 som.c
--- bfd/som.c	10 Jun 2010 08:51:44 -0000	1.81
+++ bfd/som.c	27 Jun 2010 02:52:27 -0000
@@ -6294,7 +6294,6 @@ som_bfd_ar_write_symbol_stuff (bfd *abfd
 			       struct som_external_lst_header lst,
 			       unsigned elength)
 {
-  file_ptr lst_filepos;
   char *strings = NULL, *p;
   struct som_external_lst_symbol_record *lst_syms = NULL, *curr_lst_sym;
   bfd *curr_bfd;
@@ -6323,10 +6322,6 @@ som_bfd_ar_write_symbol_stuff (bfd *abfd
   if (last_hash_entry == NULL && hash_size != 0)
     goto error_return;
 
-  /* Lots of fields are file positions relative to the start
-     of the lst record.  So save its location.  */
-  lst_filepos = bfd_tell (abfd) - sizeof (struct som_external_lst_header);
-
   /* Symbols have som_index fields, so we have to keep track of the
      index of each SOM in the archive.
 
Index: bfd/versados.c
===================================================================
RCS file: /cvs/src/src/bfd/versados.c,v
retrieving revision 1.38
diff -u -p -r1.38 versados.c
--- bfd/versados.c	11 Dec 2009 13:42:04 -0000	1.38
+++ bfd/versados.c	27 Jun 2010 02:52:28 -0000
@@ -277,7 +277,9 @@ process_esd (bfd *abfd, struct ext_esd *
 
 	case ESD_ABS:
 	  size = get_4 (&ptr);
+	  (void) size;
 	  start = get_4 (&ptr);
+	  (void) start;
 	  break;
 	case ESD_STD_REL_SEC:
 	case ESD_SHRT_REL_SEC:
Index: bfd/vms-alpha.c
===================================================================
RCS file: /cvs/src/src/bfd/vms-alpha.c,v
retrieving revision 1.28
diff -u -p -r1.28 vms-alpha.c
--- bfd/vms-alpha.c	25 Jun 2010 15:37:43 -0000	1.28
+++ bfd/vms-alpha.c	27 Jun 2010 02:52:31 -0000
@@ -1241,15 +1241,10 @@ _bfd_vms_slurp_egsd (bfd *abfd)
 
 	case EGSD__C_SYMG:
 	  {
-            int nameoff;
             struct vms_symbol_entry *entry;
             struct vms_egst *egst = (struct vms_egst *)vms_rec;
 
 	    old_flags = bfd_getl16 (egst->header.flags);
-	    if (old_flags & EGSY__V_DEF)
-              nameoff = ESDF__B_NAMLNG;
-            else
-              nameoff = ESRF__B_NAMLNG;
 
             entry = add_symbol (abfd, &egst->namlng);
 
Index: bfd/xsym.c
===================================================================
RCS file: /cvs/src/src/bfd/xsym.c,v
retrieving revision 1.27
diff -u -p -r1.27 xsym.c
--- bfd/xsym.c	11 Dec 2009 13:42:04 -0000	1.27
+++ bfd/xsym.c	27 Jun 2010 02:52:34 -0000
@@ -1082,10 +1082,8 @@ bfd_sym_fetch_type_information_table_ent
 					    unsigned long offset)
 {
   unsigned char buf[4];
-  bfd_sym_data_struct *sdata = NULL;
 
   BFD_ASSERT (bfd_sym_valid (abfd));
-  sdata = abfd->tdata.sym_data;
 
   if (offset == 0)
     return -1;
Index: opcodes/arc-dis.c
===================================================================
RCS file: /cvs/src/src/opcodes/arc-dis.c,v
retrieving revision 1.14
diff -u -p -r1.14 arc-dis.c
--- opcodes/arc-dis.c	25 Sep 2009 19:13:27 -0000	1.14
+++ opcodes/arc-dis.c	27 Jun 2010 02:52:35 -0000
@@ -238,7 +238,6 @@ arc_sprintf (struct arcDisState *state, 
   char *bp;
   const char *p;
   int size, leading_zero, regMap[2];
-  long auxNum;
   va_list ap;
 
   va_start (ap, format);
@@ -246,7 +245,6 @@ arc_sprintf (struct arcDisState *state, 
   bp = buf;
   *bp = 0;
   p = format;
-  auxNum = -1;
   regMap[0] = 0;
   regMap[1] = 0;
 
@@ -1170,7 +1168,6 @@ decodeInstr (bfd_vma            address,
   struct arcDisState s;		/* ARC Disassembler state.  */
   void *stream = info->stream; 	/* Output stream.  */
   fprintf_ftype func = info->fprintf_func;
-  int bytes;
 
   memset (&s, 0, sizeof(struct arcDisState));
 
@@ -1201,7 +1198,7 @@ decodeInstr (bfd_vma            address,
   s.instName = _instName;
 
   /* Disassemble.  */
-  bytes = dsmOneArcInst (address, & s);
+  dsmOneArcInst (address, & s);
 
   /* Display the disassembly instruction.  */
   (*func) (stream, "%08lx ", s.words[0]);
Index: opcodes/bfin-dis.c
===================================================================
RCS file: /cvs/src/src/opcodes/bfin-dis.c,v
retrieving revision 1.15
diff -u -p -r1.15 bfin-dis.c
--- opcodes/bfin-dis.c	24 Mar 2010 05:16:29 -0000	1.15
+++ opcodes/bfin-dis.c	27 Jun 2010 02:52:36 -0000
@@ -4629,7 +4629,11 @@ _print_insn_bfin (bfd_vma pc, disassembl
   int rv = 0;
 
   status = (*outf->read_memory_func) (pc & ~0x1, buf, 2, outf);
+  /* FIXME */
+  (void) status;
   status = (*outf->read_memory_func) ((pc + 2) & ~0x1, buf + 2, 2, outf);
+  /* FIXME */
+  (void) status;
 
   iw0 = bfd_getl16 (buf);
   iw1 = bfd_getl16 (buf + 2);
@@ -4729,6 +4733,8 @@ print_insn_bfin (bfd_vma pc, disassemble
   int count = 0;
 
   status = (*outf->read_memory_func) (pc & ~0x01, buf, 2, outf);
+  /* FIXME */
+  (void) status;
   iw0 = bfd_getl16 (buf);
 
   count += _print_insn_bfin (pc, outf);
Index: opcodes/cgen-asm.in
===================================================================
RCS file: /cvs/src/src/opcodes/cgen-asm.in,v
retrieving revision 1.18
diff -u -p -r1.18 cgen-asm.in
--- opcodes/cgen-asm.in	2 Jan 2010 18:50:57 -0000	1.18
+++ opcodes/cgen-asm.in	27 Jun 2010 02:52:36 -0000
@@ -274,9 +274,11 @@ parse_insn_normal (CGEN_CPU_DESC cd,
 	  continue;
 	}
 
+#ifdef CGEN_MNEMONIC_OPERANDS
+      (void) past_opcode_p;
+#endif
       /* We have an operand of some sort.  */
-      errmsg = cd->parse_operand (cd, CGEN_SYNTAX_FIELD (*syn),
-					  &str, fields);
+      errmsg = cd->parse_operand (cd, CGEN_SYNTAX_FIELD (*syn), &str, fields);
       if (errmsg)
 	return errmsg;
 
@@ -393,31 +395,39 @@ const CGEN_INSN *
 
   {
     static char errbuf[150];
-#ifdef CGEN_VERBOSE_ASSEMBLER_ERRORS
     const char *tmp_errmsg;
-
-    /* If requesting verbose error messages, use insert_errmsg.
-       Failing that, use parse_errmsg.  */
-    tmp_errmsg = (insert_errmsg ? insert_errmsg :
-		  parse_errmsg ? parse_errmsg :
-		  recognized_mnemonic ?
-		  _("unrecognized form of instruction") :
-		  _("unrecognized instruction"));
-
-    if (strlen (start) > 50)
-      /* xgettext:c-format */
-      sprintf (errbuf, "%s `%.50s...'", tmp_errmsg, start);
-    else 
-      /* xgettext:c-format */
-      sprintf (errbuf, "%s `%.50s'", tmp_errmsg, start);
+#ifdef CGEN_VERBOSE_ASSEMBLER_ERRORS
+#define be_verbose 1
 #else
-    if (strlen (start) > 50)
-      /* xgettext:c-format */
-      sprintf (errbuf, _("bad instruction `%.50s...'"), start);
-    else 
-      /* xgettext:c-format */
-      sprintf (errbuf, _("bad instruction `%.50s'"), start);
+#define be_verbose 0
 #endif
+
+    if (be_verbose)
+      {
+	/* If requesting verbose error messages, use insert_errmsg.
+	   Failing that, use parse_errmsg.  */
+	tmp_errmsg = (insert_errmsg ? insert_errmsg :
+		      parse_errmsg ? parse_errmsg :
+		      recognized_mnemonic ?
+		      _("unrecognized form of instruction") :
+		      _("unrecognized instruction"));
+
+	if (strlen (start) > 50)
+	  /* xgettext:c-format */
+	  sprintf (errbuf, "%s `%.50s...'", tmp_errmsg, start);
+	else 
+	  /* xgettext:c-format */
+	  sprintf (errbuf, "%s `%.50s'", tmp_errmsg, start);
+      }
+    else
+      {
+	if (strlen (start) > 50)
+	  /* xgettext:c-format */
+	  sprintf (errbuf, _("bad instruction `%.50s...'"), start);
+	else 
+	  /* xgettext:c-format */
+	  sprintf (errbuf, _("bad instruction `%.50s'"), start);
+      }
       
     *errmsg = errbuf;
     return NULL;
Index: opcodes/dlx-dis.c
===================================================================
RCS file: /cvs/src/src/opcodes/dlx-dis.c,v
retrieving revision 1.4
diff -u -p -r1.4 dlx-dis.c
--- opcodes/dlx-dis.c	5 Jul 2007 09:49:00 -0000	1.4
+++ opcodes/dlx-dis.c	27 Jun 2010 02:52:36 -0000
@@ -437,7 +437,6 @@ print_insn_dlx (bfd_vma memaddr, struct 
   bfd_byte buffer[4];
   int insn_idx;
   unsigned long insn_word;
-  unsigned char rtn_code;
   unsigned long dlx_insn_type[] =
   {
     (unsigned long) dlx_r_type,
@@ -481,7 +480,6 @@ print_insn_dlx (bfd_vma memaddr, struct 
 #endif
 
   /* Scan through all the insn type and print the insn out.  */
-  rtn_code = 0;
   current_insn_addr = (unsigned long) memaddr;
 
   for (insn_idx = 0; dlx_insn_type[insn_idx] != 0x0; insn_idx++)
Index: opcodes/h8300-dis.c
===================================================================
RCS file: /cvs/src/src/opcodes/h8300-dis.c,v
retrieving revision 1.23
diff -u -p -r1.23 h8300-dis.c
--- opcodes/h8300-dis.c	5 Jul 2007 09:49:00 -0000	1.23
+++ opcodes/h8300-dis.c	27 Jun 2010 02:52:36 -0000
@@ -53,19 +53,6 @@ bfd_h8_disassemble_init (void)
 
   for (p = h8_opcodes, pi = h8_instructions; p->name; p++, pi++)
     {
-      int n1 = 0;
-      int n2 = 0;
-
-      if ((int) p->data.nib[0] < 16)
-	n1 = (int) p->data.nib[0];
-      else
-	n1 = 0;
-
-      if ((int) p->data.nib[1] < 16)
-	n2 = (int) p->data.nib[1];
-      else
-	n2 = 0;
-
       /* Just make sure there are an even number of nibbles in it, and
 	 that the count is the same as the length.  */
       for (i = 0; p->data.nib[i] != (op_type) E; i++)
Index: opcodes/maxq-dis.c
===================================================================
RCS file: /cvs/src/src/opcodes/maxq-dis.c,v
retrieving revision 1.7
diff -u -p -r1.7 maxq-dis.c
--- opcodes/maxq-dis.c	11 Dec 2009 13:42:17 -0000	1.7
+++ opcodes/maxq-dis.c	27 Jun 2010 02:52:37 -0000
@@ -205,8 +205,6 @@ check_move (unsigned char insn0, unsigne
 {
   bfd_boolean first = FALSE;
   bfd_boolean second = FALSE;
-  char *first_reg;
-  char *second_reg;
   reg_entry const *reg_x;
   const unsigned char module1 = insn0 & MASK_LOW_BYTE;
   const unsigned char index1 = ((insn0 & 0x70) >> 4);
@@ -241,7 +239,6 @@ check_move (unsigned char insn0, unsigne
 	      /* A[AP] not allowed.  */
 	      if ((reg_x->Mod_name == 0x0A) && (reg_x->Mod_index == 0x01))
 		continue;
-	      first_reg = reg_x->reg_name;
 	      first = TRUE;
 	      break;
 	    }
@@ -277,7 +274,6 @@ check_move (unsigned char insn0, unsigne
 		  && (reg_x->Mod_index == (((insn8 & 0xf0) >> 4))))
 		{
 		  second = TRUE;
-		  second_reg = reg_x->reg_name;
 		  break;
 		}
 	    }
@@ -552,7 +548,7 @@ print_insn (bfd_vma memaddr, struct disa
 	    enum bfd_endian endianess)
 {
   /* The raw instruction.  */
-  unsigned char insn[2], insn0, insn8, derived_code;
+  unsigned char insn[2], derived_code;
   unsigned int format;
   unsigned int actual_operands;
   unsigned int i;
@@ -571,9 +567,6 @@ print_insn (bfd_vma memaddr, struct disa
       return -1;
     }
 
-  insn8 = insn[1];
-  insn0 = insn[0];
-
   /* FIXME: Endianness always little.  */
   if (endianess == BFD_ENDIAN_BIG)
     get_insn_opcode (((insn[0] << 8) | (insn[1])), &grp);
@@ -588,7 +581,7 @@ print_insn (bfd_vma memaddr, struct disa
       return 2;
     }
 
-  /* The opcode is always in insn0.  */
+  /* The opcode is always in insn[0].  */
   for (opcode = &op_table[0]; opcode->name != NULL; ++opcode)
     {
       if (opcode->instr_id == derived_code)
Index: opcodes/mep-dis.c
===================================================================
RCS file: /cvs/src/src/opcodes/mep-dis.c,v
retrieving revision 1.11
diff -u -p -r1.11 mep-dis.c
--- opcodes/mep-dis.c	12 Feb 2010 04:42:28 -0000	1.11
+++ opcodes/mep-dis.c	27 Jun 2010 02:52:37 -0000
@@ -534,14 +534,12 @@ mep_examine_ivc2_insns (CGEN_CPU_DESC cd
 {
   int status;
   int buflength;
-  int cop2buflength;
   bfd_byte buf[8];
   bfd_byte insn[8];
   int e;
 
   /* At this time we're not supporting internally parallel
      coprocessors, so cop2buflength will always be 0.  */
-  cop2buflength = 0;
 
   /* Read in 64 bits.  */
   buflength = 8; /* VLIW insn spans 8 bytes.  */
Index: opcodes/msp430-dis.c
===================================================================
RCS file: /cvs/src/src/opcodes/msp430-dis.c,v
retrieving revision 1.6
diff -u -p -r1.6 msp430-dis.c
--- opcodes/msp430-dis.c	2 Sep 2009 07:20:30 -0000	1.6
+++ opcodes/msp430-dis.c	27 Jun 2010 02:52:38 -0000
@@ -546,14 +546,13 @@ msp430_branchinstr (disassemble_info *in
 		    int *cycles)
 {
   int regs = 0, regd = 0;
-  int ad = 0, as = 0;
+  int as = 0;
   int cmd_len = 2;
   short dst = 0;
 
   regd = insn & 0x0f;
   regs = (insn & 0x0f00) >> 8;
   as = (insn & 0x0030) >> 4;
-  ad = (insn & 0x0080) >> 7;
 
   if (regd != 0)	/* Destination register is not a PC.  */
     return 0;
Index: opcodes/sparc-dis.c
===================================================================
RCS file: /cvs/src/src/opcodes/sparc-dis.c,v
retrieving revision 1.16
diff -u -p -r1.16 sparc-dis.c
--- opcodes/sparc-dis.c	2 Sep 2009 07:20:30 -0000	1.16
+++ opcodes/sparc-dis.c	27 Jun 2010 02:52:38 -0000
@@ -995,7 +995,8 @@ print_insn_sparc (bfd_vma memaddr, disas
 
 	  if (opcode->flags & (F_UNBR|F_CONDBR|F_JSR))
 	    {
-		/* FIXME -- check is_annulled flag.  */
+	      /* FIXME -- check is_annulled flag.  */
+	      (void) is_annulled;
 	      if (opcode->flags & F_UNBR)
 		info->insn_type = dis_branch;
 	      if (opcode->flags & F_CONDBR)
Index: binutils/resbin.c
===================================================================
RCS file: /cvs/src/src/binutils/resbin.c,v
retrieving revision 1.15
diff -u -p -r1.15 resbin.c
--- binutils/resbin.c	11 Dec 2009 13:42:06 -0000	1.15
+++ binutils/resbin.c	27 Jun 2010 02:52:34 -0000
@@ -1357,12 +1357,8 @@ static rc_uint_type
 res_to_bin_accelerator (windres_bfd *wrbfd, rc_uint_type off,
 			const rc_accelerator *accelerators)
 {
-  bindata *first, **pp;
   const rc_accelerator *a;
 
-  first = NULL;
-  pp = &first;
-
   for (a = accelerators; a != NULL; a = a->next)
     {
       if (wrbfd)
Index: ld/pe-dll.c
===================================================================
RCS file: /cvs/src/src/ld/pe-dll.c,v
retrieving revision 1.132
diff -u -p -r1.132 pe-dll.c
--- ld/pe-dll.c	9 Jun 2010 18:17:10 -0000	1.132
+++ ld/pe-dll.c	27 Jun 2010 02:52:34 -0000
@@ -1154,7 +1154,7 @@ fill_edata (bfd *abfd, struct bfd_link_i
 
   /* Note use of array pointer math here.  */
   edirectory = edata_d;
-  eaddresses = edata_d + 40;
+  eaddresses = edirectory + 40;
   enameptrs = eaddresses + 4 * export_table_size;
   eordinals = enameptrs + 4 * count_exported_byname;
   enamestr = (char *) eordinals + 2 * count_exported_byname;
@@ -1247,7 +1247,6 @@ pe_walk_relocs_of_symbol (struct bfd_lin
   for (b = info->input_bfds; b; b = b->link_next)
     {
       asymbol **symbols;
-      int nsyms;
 
       if (!bfd_generic_link_read_symbols (b))
 	{
@@ -1256,7 +1255,6 @@ pe_walk_relocs_of_symbol (struct bfd_lin
 	}
 
       symbols = bfd_get_outsymbols (b);
-      nsyms = bfd_get_symcount (b);
 
       for (s = b->sections; s; s = s->next)
 	{
@@ -1326,7 +1324,6 @@ generate_reloc (bfd *abfd, struct bfd_li
 	{
 	  bfd_vma sec_vma = s->output_section->vma + s->output_offset;
 	  asymbol **symbols;
-	  int nsyms;
 
 	  /* If it's not loaded, we don't need to relocate it this way.  */
 	  if (!(s->output_section->flags & SEC_LOAD))
@@ -1353,7 +1350,6 @@ generate_reloc (bfd *abfd, struct bfd_li
 	    }
 
 	  symbols = bfd_get_outsymbols (b);
-	  nsyms = bfd_get_symcount (b);
 	  relsize = bfd_get_reloc_upper_bound (b, s);
 	  relocs = xmalloc (relsize);
 	  nrelocs = bfd_canonicalize_reloc (b, s, relocs, symbols);
@@ -1368,7 +1364,6 @@ generate_reloc (bfd *abfd, struct bfd_li
 	      if (!relocs[i]->howto->pc_relative
 		  && relocs[i]->howto->type != pe_details->imagebase_reloc)
 		{
-		  bfd_vma sym_vma;
 		  struct bfd_symbol *sym = *relocs[i]->sym_ptr_ptr;
 
 		  /* Don't create relocs for undefined weak symbols.  */
@@ -1400,11 +1395,6 @@ generate_reloc (bfd *abfd, struct bfd_li
 			continue;
 		    }
 
-		  sym_vma = (relocs[i]->addend
-			     + sym->value
-			     + sym->section->vma
-			     + sym->section->output_offset
-			     + sym->section->output_section->vma);
 		  reloc_data[total_relocs].vma = sec_vma + relocs[i]->address;
 
 #define BITS_AND_SHIFT(bits, shift) (bits * 1000 | shift)
@@ -2992,7 +2982,7 @@ pe_implied_import_dll (const char *filen
   bfd_vma exp_funcbase;
   unsigned char *expdata;
   char *erva;
-  bfd_vma name_rvas, ordinals, nexp, ordbase;
+  bfd_vma name_rvas, nexp;
   const char *dllname;
   /* Initialization with start > end guarantees that is_data
      will not be set by mistake, and avoids compiler warning.  */
@@ -3126,8 +3116,6 @@ pe_implied_import_dll (const char *filen
 
   nexp = pe_as32 (expdata + 24);
   name_rvas = pe_as32 (expdata + 32);
-  ordinals = pe_as32 (expdata + 36);
-  ordbase = pe_as32 (expdata + 16);
   exp_funcbase = pe_as32 (expdata + 28);
 
   /* Use internal dll name instead of filename
Index: ld/emultempl/aix.em
===================================================================
RCS file: /cvs/src/src/ld/emultempl/aix.em,v
retrieving revision 1.53
diff -u -p -r1.53 aix.em
--- ld/emultempl/aix.em	2 Sep 2009 07:25:35 -0000	1.53
+++ ld/emultempl/aix.em	27 Jun 2010 02:52:34 -0000
@@ -1424,13 +1424,11 @@ gld${EMULATION_NAME}_open_dynamic_archiv
 					   search_dirs_type *search,
 					   lang_input_statement_type *entry)
 {
-  const char *filename;
   char *path;
 
   if (!entry->is_archive)
     return FALSE;
 
-  filename = entry->filename;
   path = concat (search->name, "/lib", entry->filename, arch, ".a", NULL);
   if (!ldfile_try_open_bfd (path, entry))
     {
Index: ld/emultempl/xtensaelf.em
===================================================================
RCS file: /cvs/src/src/ld/emultempl/xtensaelf.em,v
retrieving revision 1.24
diff -u -p -r1.24 xtensaelf.em
--- ld/emultempl/xtensaelf.em	26 Nov 2009 13:45:25 -0000	1.24
+++ ld/emultempl/xtensaelf.em	27 Jun 2010 02:52:34 -0000
@@ -98,7 +98,6 @@ replace_insn_sec_with_prop_sec (bfd *abf
   bfd_byte *insn_contents = NULL;
   unsigned entry_count;
   unsigned entry;
-  Elf_Internal_Shdr *symtab_hdr;
   Elf_Internal_Rela *internal_relocs = NULL;
   unsigned reloc_count;
 
@@ -206,7 +205,6 @@ replace_insn_sec_with_prop_sec (bfd *abf
   if (internal_relocs)
     {
       unsigned i;
-      symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
 
       for (i = 0; i < reloc_count; i++)
 	{
@@ -1669,7 +1667,6 @@ xtensa_layout_wild (const reloc_deps_gra
 static void
 xtensa_colocate_output_literals_callback (lang_statement_union_type *statement)
 {
-  lang_output_section_statement_type *os;
   reloc_deps_graph *deps;
   if (statement->header.type == lang_output_section_statement_enum)
     {
@@ -1691,8 +1688,6 @@ xtensa_colocate_output_literals_callback
 #endif
       bfd_boolean no_reorder = FALSE;
 
-      os = &statement->output_section_statement;
-
 #if EXTRA_VALIDATION
       old_child_count = ld_count_children (statement);
 #endif

-- 
Alan Modra
Australia Development Lab, IBM


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]