diff options
author | Alan Modra <amodra@gmail.com> | 2010-06-27 04:07:55 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2010-06-27 04:07:55 +0000 |
commit | c7e2358a8849d7540212543e1a2acbac648cb973 (patch) | |
tree | a882f5a804c7dca6bde423d24e5b13b1a3eeff32 | |
parent | 1addfd92eb085db42013c4d45e3df8bf2053cde4 (diff) | |
download | binutils-gdb-c7e2358a8849d7540212543e1a2acbac648cb973.tar.gz |
fix set but unused variable warnings
88 files changed, 701 insertions, 789 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index ce1b7b7f0c7..2369ad24380 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,108 @@ +2010-06-27 Alan Modra <amodra@gmail.com> + + * 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. + 2010-06-25 Tristan Gingold <gingold@adacore.com> * vms-alpha.c (_bfd_vms_write_egsd): Check absolute section with diff --git a/bfd/bout.c b/bfd/bout.c index ad53d8fc320..34c1a6bdc4e 100644 --- a/bfd/bout.c +++ b/bfd/bout.c @@ -1,6 +1,6 @@ /* BFD back-end for Intel 960 b.out binaries. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 + 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. Written by Cygnus Support. @@ -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) diff --git a/bfd/coff-i860.c b/bfd/coff-i860.c index e5ca0c17bc5..b7ada164747 100644 --- a/bfd/coff-i860.c +++ b/bfd/coff-i860.c @@ -1,6 +1,6 @@ /* BFD back-end for Intel i860 COFF files. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1999, 2000, 2001, 2002, - 2003, 2004, 2005, 2007, 2008 Free Software Foundation, Inc. + 2003, 2004, 2005, 2007, 2008, 2010 Free Software Foundation, Inc. Created mostly by substituting "860" for "386" in coff-i386.c Harry Dolan <dolan@ssd.intel.com>, October 1995 @@ -629,6 +629,7 @@ i860_reloc_processing (arelent *cache_ptr, struct internal_reloc *dst, /* Calculate any reloc addend by looking at the symbol. */ CALC_ADDEND (abfd, ptr, (*dst), cache_ptr); + (void) ptr; cache_ptr->address -= asect->vma; diff --git a/bfd/coff-mcore.c b/bfd/coff-mcore.c index 1d617488581..8b2f9d7dc77 100644 --- a/bfd/coff-mcore.c +++ b/bfd/coff-mcore.c @@ -1,5 +1,5 @@ /* BFD back-end for Motorola MCore COFF/PE - Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007 + Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2010 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -370,8 +370,6 @@ coff_mcore_relocate_section (output_bfd, info, input_bfd, input_section, { 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, info, input_bfd, input_section, return FALSE; } - hihalf = FALSE; - hihalf_val = 0; - rel = relocs; relend = rel + input_section->reloc_count; diff --git a/bfd/coff-ppc.c b/bfd/coff-ppc.c index 307b7c70648..06eed247c35 100644 --- a/bfd/coff-ppc.c +++ b/bfd/coff-ppc.c @@ -1,6 +1,6 @@ /* BFD back-end for PowerPC Microsoft Portable Executable files. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 + 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. Original version pieced together by Kim Knuttila (krk@cygnus.com) @@ -867,8 +867,6 @@ ppc_record_toc_entry(abfd, info, sec, sym, toc_kind) 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, sym, toc_kind) } 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, info, input_bfd, input_section, { 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, info, input_bfd, input_section, 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, info, input_bfd, input_section, 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); } } diff --git a/bfd/coff-rs6000.c b/bfd/coff-rs6000.c index 680a2e5d1d9..37d668c97bd 100644 --- a/bfd/coff-rs6000.c +++ b/bfd/coff-rs6000.c @@ -3071,7 +3071,7 @@ xcoff_complain_overflow_bitfield_func (input_bfd, val, relocation, howto) 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 (input_bfd, val, relocation, howto) 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; diff --git a/bfd/coffcode.h b/bfd/coffcode.h index 1cf2b4e35f7..734dde9f0e4 100644 --- a/bfd/coffcode.h +++ b/bfd/coffcode.h @@ -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 * abfd) 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_ptr asect, asymbol ** symbols) /* 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;*/ diff --git a/bfd/cpu-arm.c b/bfd/cpu-arm.c index 61d4bbdb349..2238720e54a 100644 --- a/bfd/cpu-arm.c +++ b/bfd/cpu-arm.c @@ -1,6 +1,6 @@ /* BFD support for the ARM processor - Copyright 1994, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, 2007, 2009 - Free Software Foundation, Inc. + Copyright 1994, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, 2007, + 2009, 2010 Free Software Foundation, Inc. Contributed by Richard Earnshaw (rwe@pegasus.esprit.ec.org) This file is part of BFD, the Binary File Descriptor library. @@ -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; diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h index 0b21e2aa95b..754e7335b65 100644 --- a/bfd/elf-bfd.h +++ b/bfd/elf-bfd.h @@ -2332,6 +2332,8 @@ extern asection _bfd_elf_large_com_section; return FALSE; \ warned = TRUE; \ } \ + (void) unresolved_reloc; \ + (void) warned; \ } \ while (0) diff --git a/bfd/elf-m10200.c b/bfd/elf-m10200.c index 5a6ff5f74b9..0fafe556883 100644 --- a/bfd/elf-m10200.c +++ b/bfd/elf-m10200.c @@ -1,5 +1,6 @@ /* Matsushita 10200 specific support for 32-bit ELF - Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007 + Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, + 2007, 2010 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -1193,7 +1194,6 @@ mn10200_elf_relax_delete_bytes (abfd, sec, addr, count) 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 +1205,6 @@ mn10200_elf_relax_delete_bytes (abfd, sec, addr, count) 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; diff --git a/bfd/elf-m10300.c b/bfd/elf-m10300.c index 8520335d34c..f151c21d278 100644 --- a/bfd/elf-m10300.c +++ b/bfd/elf-m10300.c @@ -987,14 +987,11 @@ mn10300_elf_final_link_relocate (reloc_howto_type *howto, 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) diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c index 53a084665dc..f6115bd24e3 100644 --- a/bfd/elf32-arm.c +++ b/bfd/elf32-arm.c @@ -3485,7 +3485,6 @@ arm_build_one_stub (struct bfd_hash_entry *gen_entry, 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_entry *gen_entry, 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_arm_stub_type stub_type, 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_link_info *link_info, 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_link_info *link_info, 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 *abfd, struct bfd_link_info *link_info) { 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_howto_type * howto, 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_howto_type * howto, 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, struct bfd_link_info *info, 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, struct bfd_link_info *info, } 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 * gen_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 * gen_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 diff --git a/bfd/elf32-avr.c b/bfd/elf32-avr.c index 92c5be9d17d..a9b41fab25f 100644 --- a/bfd/elf32-avr.c +++ b/bfd/elf32-avr.c @@ -1204,7 +1204,7 @@ elf32_avr_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED, 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_entry *bh, void *in_arg) 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; diff --git a/bfd/elf32-bfin.c b/bfd/elf32-bfin.c index d208f353c52..e8cdf22d868 100644 --- a/bfd/elf32-bfin.c +++ b/bfd/elf32-bfin.c @@ -3379,7 +3379,6 @@ _bfin_create_got_section (bfd *abfd, struct bfd_link_info *info) 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, struct bfd_link_info *info) 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 *ibfd, bfd *obfd) 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. */ { diff --git a/bfd/elf32-cr16.c b/bfd/elf32-cr16.c index 354cbd91f76..4c6e3c00e80 100644 --- a/bfd/elf32-cr16.c +++ b/bfd/elf32-cr16.c @@ -862,10 +862,8 @@ cr16_elf_final_link_relocate (reloc_howto_type *howto, 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 bfd_link_info *link_info, bfd *abfd, 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 bfd_link_info *link_info, 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; diff --git a/bfd/elf32-cr16c.c b/bfd/elf32-cr16c.c index 18d4ade82df..5016c6e66a9 100644 --- a/bfd/elf32-cr16c.c +++ b/bfd/elf32-cr16c.c @@ -1,5 +1,6 @@ /* BFD back-end for National Semiconductor's CR16C ELF - Copyright 2004, 2005, 2006, 2007, 2009 Free Software Foundation, Inc. + Copyright 2004, 2005, 2006, 2007, 2009, 2010 + Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -204,7 +205,6 @@ cr16c_elf_final_link_relocate (reloc_howto_type *howto, 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 +224,6 @@ cr16c_elf_final_link_relocate (reloc_howto_type *howto, 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: diff --git a/bfd/elf32-cris.c b/bfd/elf32-cris.c index 8abb09e2fd5..1783ae3b66c 100644 --- a/bfd/elf32-cris.c +++ b/bfd/elf32-cris.c @@ -2157,7 +2157,6 @@ elf_cris_finish_dynamic_symbol (bfd *output_bfd, { asection *splt; asection *sgotplt; - asection *sgot; asection *srela; bfd_vma got_base; @@ -2197,7 +2196,6 @@ elf_cris_finish_dynamic_symbol (bfd *output_bfd, 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 diff --git a/bfd/elf32-crx.c b/bfd/elf32-crx.c index 71a3f6bdb70..11c1f564b32 100644 --- a/bfd/elf32-crx.c +++ b/bfd/elf32-crx.c @@ -1,5 +1,6 @@ /* BFD back-end for National Semiconductor's CRX ELF - Copyright 2004, 2005, 2006, 2007, 2009 Free Software Foundation, Inc. + Copyright 2004, 2005, 2006, 2007, 2009, 2010 + Free Software Foundation, Inc. Written by Tomer Levi, NSC, Israel. This file is part of BFD, the Binary File Descriptor library. @@ -591,7 +592,6 @@ elf32_crx_relax_delete_bytes (struct bfd_link_info *link_info, bfd *abfd, 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 +604,6 @@ elf32_crx_relax_delete_bytes (struct bfd_link_info *link_info, 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; diff --git a/bfd/elf32-h8300.c b/bfd/elf32-h8300.c index 92c0a165b81..e05efbdba93 100644 --- a/bfd/elf32-h8300.c +++ b/bfd/elf32-h8300.c @@ -1,6 +1,6 @@ /* BFD back-end for Renesas H8/300 ELF binaries. Copyright 1993, 1995, 1998, 1999, 2001, 2002, 2003, 2004, 2005, 2006, - 2007, 2009 Free Software Foundation, Inc. + 2007, 2009, 2010 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -724,10 +724,8 @@ elf32_h8_relax_section (bfd *abfd, asection *sec, { 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, asection *sec, bfd_vma addr, int count) 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, asection *sec, bfd_vma addr, int count) 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; diff --git a/bfd/elf32-hppa.c b/bfd/elf32-hppa.c index 5142d3cf21c..32a374fbc51 100644 --- a/bfd/elf32-hppa.c +++ b/bfd/elf32-hppa.c @@ -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++) diff --git a/bfd/elf32-i370.c b/bfd/elf32-i370.c index ff0208ee3e3..67e65985236 100644 --- a/bfd/elf32-i370.c +++ b/bfd/elf32-i370.c @@ -1,6 +1,6 @@ /* i370-specific support for 32-bit ELF Copyright 1994, 1995, 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2004, - 2005, 2006, 2007, 2008 Free Software Foundation, Inc. + 2005, 2006, 2007, 2008, 2010 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. Hacked by Linas Vepstas for i370 linas@linas.org @@ -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_bfd, 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_bfd, /* 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); diff --git a/bfd/elf32-ip2k.c b/bfd/elf32-ip2k.c index 40c2205d38f..2ef22b680a9 100644 --- a/bfd/elf32-ip2k.c +++ b/bfd/elf32-ip2k.c @@ -1,5 +1,5 @@ /* Ubicom IP2xxx specific support for 32-bit ELF - Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009 + Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -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_bfd ATTRIBUTE_UNUSED, 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; diff --git a/bfd/elf32-lm32.c b/bfd/elf32-lm32.c index 68195c3bf2d..727fc7a3569 100644 --- a/bfd/elf32-lm32.c +++ b/bfd/elf32-lm32.c @@ -829,7 +829,7 @@ lm32_elf_relocate_section (bfd *output_bfd, 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_bfd, 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_bfd, 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_bfd, { /* 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_bfd, 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 *output_bfd, 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 *output_bfd, 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 *output_bfd, 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; diff --git a/bfd/elf32-m32c.c b/bfd/elf32-m32c.c index 4de500a1c4e..a706ac31175 100644 --- a/bfd/elf32-m32c.c +++ b/bfd/elf32-m32c.c @@ -1,5 +1,5 @@ /* M16C/M32C specific support for 32-bit ELF. - Copyright (C) 2005, 2006, 2007, 2008, 2009 + Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -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; diff --git a/bfd/elf32-m32r.c b/bfd/elf32-m32r.c index 4c683ed183a..e079c4a1005 100644 --- a/bfd/elf32-m32r.c +++ b/bfd/elf32-m32r.c @@ -3153,7 +3153,6 @@ m32r_elf_finish_dynamic_symbol (bfd *output_bfd, 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 *output_bfd, 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 *output_bfd, 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 *output_bfd, 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. diff --git a/bfd/elf32-m68hc11.c b/bfd/elf32-m68hc11.c index 5e5b890d289..79a19440444 100644 --- a/bfd/elf32-m68hc11.c +++ b/bfd/elf32-m68hc11.c @@ -676,7 +676,6 @@ m68hc11_elf_relax_section (bfd *abfd, asection *sec, 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, asection *sec, 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 diff --git a/bfd/elf32-m68hc1x.c b/bfd/elf32-m68hc1x.c index 9199f69361b..21074868868 100644 --- a/bfd/elf32-m68hc1x.c +++ b/bfd/elf32-m68hc1x.c @@ -935,7 +935,6 @@ elf32_m68hc11_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED, 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 *output_bfd ATTRIBUTE_UNUSED, + 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 *output_bfd ATTRIBUTE_UNUSED, warned); is_far = (h && (h->other & STO_M68HC12_FAR)); - stub_name = h->root.root.string; } if (sec != NULL && elf_discarded_section (sec)) diff --git a/bfd/elf32-m68k.c b/bfd/elf32-m68k.c index 0eb4133b060..ff37a3c06e0 100644 --- a/bfd/elf32-m68k.c +++ b/bfd/elf32-m68k.c @@ -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; diff --git a/bfd/elf32-microblaze.c b/bfd/elf32-microblaze.c index da80c853589..e4c319d2d4d 100644 --- a/bfd/elf32-microblaze.c +++ b/bfd/elf32-microblaze.c @@ -1109,7 +1109,7 @@ microblaze_elf_relocate_section (bfd *output_bfd, { 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 *output_bfd, 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 (bfd *output_bfd, 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; diff --git a/bfd/elf32-moxie.c b/bfd/elf32-moxie.c index 23a16ffe447..b43f396d61f 100644 --- a/bfd/elf32-moxie.c +++ b/bfd/elf32-moxie.c @@ -1,5 +1,5 @@ /* moxie-specific support for 32-bit ELF. - Copyright 2009 Free Software Foundation, Inc. + Copyright 2009, 2010 Free Software Foundation, Inc. Copied from elf32-fr30.c which is.. Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 @@ -222,10 +222,8 @@ moxie_elf_relocate_section (bfd *output_bfd, 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; diff --git a/bfd/elf32-msp430.c b/bfd/elf32-msp430.c index 7a570243d8b..285475cf0cc 100644 --- a/bfd/elf32-msp430.c +++ b/bfd/elf32-msp430.c @@ -1,5 +1,5 @@ /* MSP430-specific support for 32-bit ELF - Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 + Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2010 Free Software Foundation, Inc. Contributed by Dmitry Diky <diwil@mail.ru> @@ -429,7 +429,7 @@ elf32_msp430_relocate_section (bfd * output_bfd ATTRIBUTE_UNUSED, 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 * abfd, asection * sec, bfd_vma addr, 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 * abfd, asection * sec, bfd_vma addr, 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; diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c index 1580599fe11..bf182c961cc 100644 --- a/bfd/elf32-ppc.c +++ b/bfd/elf32-ppc.c @@ -4788,7 +4788,6 @@ ppc_elf_tls_optimize (bfd *obfd ATTRIBUTE_UNUSED, } 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 ATTRIBUTE_UNUSED, return FALSE; } } - sym = locsyms + r_symndx; lgot_refs = elf_local_got_refcounts (ibfd); if (lgot_refs == NULL) abort (); diff --git a/bfd/elf32-rx.c b/bfd/elf32-rx.c index cab7a145ac9..7d9dbc125f7 100644 --- a/bfd/elf32-rx.c +++ b/bfd/elf32-rx.c @@ -1,5 +1,5 @@ /* Renesas RX specific support for 32-bit ELF. - Copyright (C) 2008, 2009 + Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -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, asection *sec, bfd_vma addr, int count, 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, asection *sec, bfd_vma addr, int count, /* 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 * abfd, { /* 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 * abfd, 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 * abfd, 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 * abfd, 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) diff --git a/bfd/elf32-score.c b/bfd/elf32-score.c index 61c9c08126d..b443b601afc 100644 --- a/bfd/elf32-score.c +++ b/bfd/elf32-score.c @@ -1774,9 +1774,8 @@ score_elf_got_offset_from_index (bfd *dynobj, { 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_howto_type *howto, 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_howto_type *howto, 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 *output_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 *output_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++) diff --git a/bfd/elf32-score7.c b/bfd/elf32-score7.c index cd87ff34669..31784105f95 100644 --- a/bfd/elf32-score7.c +++ b/bfd/elf32-score7.c @@ -1638,9 +1638,8 @@ score_elf_got_offset_from_index (bfd *dynobj, { 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 *output_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 *output_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++) diff --git a/bfd/elf32-sh.c b/bfd/elf32-sh.c index 1b0daf96bba..bde565ee469 100644 --- a/bfd/elf32-sh.c +++ b/bfd/elf32-sh.c @@ -6092,15 +6092,10 @@ sh_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec, 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 bfd_link_info *info, asection *sec, 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++) { diff --git a/bfd/elf32-sh64.c b/bfd/elf32-sh64.c index 2f2b853db42..2848f19b488 100644 --- a/bfd/elf32-sh64.c +++ b/bfd/elf32-sh64.c @@ -1,5 +1,5 @@ /* SuperH SH64-specific support for 32-bit ELF - Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009 + Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -104,7 +104,8 @@ static void sh64_find_section_for_address /* 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 diff --git a/bfd/elf32-spu.c b/bfd/elf32-spu.c index bf1adba1447..fb3a4faa411 100644 --- a/bfd/elf32-spu.c +++ b/bfd/elf32-spu.c @@ -1,6 +1,6 @@ /* SPU specific support for 32-bit ELF - Copyright 2006, 2007, 2008, 2009 Free Software Foundation, Inc. + Copyright 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -4827,14 +4827,12 @@ spu_elf_relocate_section (bfd *output_bfd, 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_bfd, input_section, rel->r_offset, err)) return FALSE; - warned = TRUE; } sym_name = h->root.root.string; } diff --git a/bfd/elf32-v850.c b/bfd/elf32-v850.c index d7aaed49f7d..0ab7de8c10f 100644 --- a/bfd/elf32-v850.c +++ b/bfd/elf32-v850.c @@ -1,6 +1,6 @@ /* V850-specific support for 32-bit ELF Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, - 2006, 2007, 2008, 2009 Free Software Foundation, Inc. + 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -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 addend, bfd_boolean *already_found) { 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 addend, bfd_boolean *already_found) if (entry->addend == addend && (match == NULL || match->counter < entry->counter)) { - previous = prev; match = entry; } - - prev = entry; } if (match == NULL) diff --git a/bfd/elf32-vax.c b/bfd/elf32-vax.c index 2c29179da2f..1582ac764d5 100644 --- a/bfd/elf32-vax.c +++ b/bfd/elf32-vax.c @@ -494,7 +494,6 @@ elf32_vax_set_private_flags (bfd *abfd, flagword flags) 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 *ibfd, bfd *obfd) 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_bfd, 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_bfd, 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; diff --git a/bfd/elf32-xc16x.c b/bfd/elf32-xc16x.c index 826b6aac6f7..4d7ee99162f 100644 --- a/bfd/elf32-xc16x.c +++ b/bfd/elf32-xc16x.c @@ -1,5 +1,5 @@ /* Infineon XC16X-specific support for 16-bit ELF. - Copyright 2006, 2007, 2009 Free Software Foundation, Inc. + Copyright 2006, 2007, 2009, 2010 Free Software Foundation, Inc. Contributed by KPIT Cummins Infosystems This file is part of BFD, the Binary File Descriptor library. @@ -358,7 +358,6 @@ elf32_xc16x_relocate_section (bfd *output_bfd, 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 *output_bfd, 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; diff --git a/bfd/elf32-xtensa.c b/bfd/elf32-xtensa.c index 888a801868e..770d9a82d43 100644 --- a/bfd/elf32-xtensa.c +++ b/bfd/elf32-xtensa.c @@ -7829,7 +7829,6 @@ xlate_offset_with_removed_text (const xlate_map_t *map, 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 xlate_map_t *map, 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; diff --git a/bfd/elf64-hppa.c b/bfd/elf64-hppa.c index 957e61a000c..9ccb518dbb7 100644 --- a/bfd/elf64-hppa.c +++ b/bfd/elf64-hppa.c @@ -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 *output_bfd, 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 *output_bfd, 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_bfd, 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_bfd, 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_bfd, 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_bfd, || 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_bfd, input_section, rel->r_offset, err)) return FALSE; - warned_undef = TRUE; } if (!info->relocatable @@ -3967,7 +3939,6 @@ elf64_hppa_relocate_section (bfd *output_bfd, (info, eh_name (eh), input_bfd, input_section, rel->r_offset, FALSE)) return FALSE; - warned_undef = TRUE; } } } diff --git a/bfd/elf64-mmix.c b/bfd/elf64-mmix.c index b090f23bee4..3ac4950b5b2 100644 --- a/bfd/elf64-mmix.c +++ b/bfd/elf64-mmix.c @@ -1,5 +1,5 @@ /* MMIX-specific support for 64-bit ELF. - Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009 + Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010 Free Software Foundation, Inc. Contributed by Hans-Peter Nilsson <hp@bitrange.com> @@ -1267,7 +1267,6 @@ mmix_elf_reloc (abfd, reloc_entry, symbol, data, input_section, 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, symbol, data, input_section, 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_info, again) 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_info, again) 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; diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c index 116d4196b68..90a2518f8dc 100644 --- a/bfd/elf64-ppc.c +++ b/bfd/elf64-ppc.c @@ -4844,7 +4844,7 @@ ppc64_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, { 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, struct bfd_link_info *info, 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 *info, bfd_boolean non_overlapping) 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 *info, bfd_boolean non_overlapping) 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 *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 *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; diff --git a/bfd/elfxx-ia64.c b/bfd/elfxx-ia64.c index 5cb1a20ccc0..0646ed1a8fc 100644 --- a/bfd/elfxx-ia64.c +++ b/bfd/elfxx-ia64.c @@ -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; } diff --git a/bfd/elfxx-sparc.c b/bfd/elfxx-sparc.c index 900653c4557..58b18904a61 100644 --- a/bfd/elfxx-sparc.c +++ b/bfd/elfxx-sparc.c @@ -1326,7 +1326,6 @@ _bfd_sparc_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, 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, struct bfd_link_info *info, 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 *output_bfd, 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 *output_bfd, 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) diff --git a/bfd/hp300hpux.c b/bfd/hp300hpux.c index 3ca56429e7b..7779fef1ec9 100644 --- a/bfd/hp300hpux.c +++ b/bfd/hp300hpux.c @@ -1,6 +1,6 @@ /* BFD backend for hp-ux 9000/300 Copyright 1990, 1991, 1993, 1994, 1995, 1997, 1999, 2000, 2001, 2002, - 2003, 2004, 2005, 2007 Free Software Foundation, Inc. + 2003, 2004, 2005, 2007, 2010 Free Software Foundation, Inc. Written by Glenn Engel. This file is part of BFD, the Binary File Descriptor library. @@ -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; diff --git a/bfd/i386lynx.c b/bfd/i386lynx.c index 45909bf603c..0a1b854849d 100644 --- a/bfd/i386lynx.c +++ b/bfd/i386lynx.c @@ -1,6 +1,6 @@ /* BFD back-end for i386 a.out binaries under LynxOS. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1999, 2001, 2002, - 2003, 2005, 2007, 2009 Free Software Foundation, Inc. + 2003, 2005, 2007, 2009, 2010 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -136,7 +136,6 @@ NAME(lynx,swap_std_reloc_out) (abfd, g, natptr) 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, natptr) 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, bytes, cache_ptr, symbols, symcount) 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, bytes, cache_ptr, symbols, symcount) 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; diff --git a/bfd/ieee.c b/bfd/ieee.c index b600766b255..bb986c4a975 100644 --- a/bfd/ieee.c +++ b/bfd/ieee.c @@ -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 *buf) break; } } + (void) ch; OUT (0x84); buf->ptrp = output_ptr; buf->buffer = output_buffer; diff --git a/bfd/mach-o.c b/bfd/mach-o.c index d913d3c45ef..a02030e5dcd 100644 --- a/bfd/mach-o.c +++ b/bfd/mach-o.c @@ -630,13 +630,11 @@ bfd_mach_o_write_thread (bfd *abfd, bfd_mach_o_load_command *command) 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); diff --git a/bfd/mmo.c b/bfd/mmo.c index eee27c3a269..8c727880ef4 100644 --- a/bfd/mmo.c +++ b/bfd/mmo.c @@ -1,5 +1,5 @@ /* BFD back-end for mmo objects (MMIX-specific object-format). - Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009 + Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010 Free Software Foundation, Inc. Written by Hans-Peter Nilsson (hp@bitrange.com). Infrastructure and other bits originally copied from srec.c and @@ -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 *abfd) 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)); diff --git a/bfd/nlm32-sparc.c b/bfd/nlm32-sparc.c index 42c0c5bda60..ba60e44016d 100644 --- a/bfd/nlm32-sparc.c +++ b/bfd/nlm32-sparc.c @@ -1,6 +1,6 @@ /* Support for 32-bit SPARC NLM (NetWare Loadable Module) Copyright 1993, 1994, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, - 2007, 2009 Free Software Foundation, Inc. + 2007, 2009, 2010 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -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); diff --git a/bfd/pdp11.c b/bfd/pdp11.c index 8f448728e88..1a7694cd4d5 100644 --- a/bfd/pdp11.c +++ b/bfd/pdp11.c @@ -1,5 +1,5 @@ /* BFD back-end for PDP-11 a.out binaries. - Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009 + Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -3214,7 +3214,6 @@ pdp11_aout_link_input_section (struct aout_final_link_info *finfo, 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 aout_final_link_info *finfo, 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_final_link_info *finfo, 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_link_info *finfo, bfd *input_bfd) 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)) diff --git a/bfd/pe-mips.c b/bfd/pe-mips.c index 31b87f42e6e..42e4e83b004 100644 --- a/bfd/pe-mips.c +++ b/bfd/pe-mips.c @@ -1,6 +1,6 @@ /* BFD back-end for MIPS PE COFF files. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009 + 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. Modified from coff-i386.c by DJ Delorie, dj@cygnus.com @@ -552,7 +552,6 @@ mips_swap_reloc_in (bfd * abfd, void * src, void * dst) 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 * src, void * dst) { 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 *output_bfd, 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 *output_bfd, 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; diff --git a/bfd/peXXigen.c b/bfd/peXXigen.c index f9774678469..d023dc8e501 100644 --- a/bfd/peXXigen.c +++ b/bfd/peXXigen.c @@ -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; diff --git a/bfd/som.c b/bfd/som.c index 3b93df5d974..a46c35aec5f 100644 --- a/bfd/som.c +++ b/bfd/som.c @@ -1,6 +1,6 @@ /* bfd back-end for HP PA-RISC SOM objects. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 + 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. Contributed by the Center for Software Science at the @@ -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. diff --git a/bfd/versados.c b/bfd/versados.c index d7a5d47f05e..226f8a012b9 100644 --- a/bfd/versados.c +++ b/bfd/versados.c @@ -1,6 +1,6 @@ /* BFD back-end for VERSAdos-E objects. Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, - 2006, 2007, 2009 Free Software Foundation, Inc. + 2006, 2007, 2009, 2010 Free Software Foundation, Inc. Written by Steve Chamberlain of Cygnus Support <sac@cygnus.com>. Versados is a Motorola trademark. @@ -277,7 +277,9 @@ process_esd (bfd *abfd, struct ext_esd *esd, int pass) 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: diff --git a/bfd/vms-alpha.c b/bfd/vms-alpha.c index dc38a2614fc..b1cf82d3cc8 100644 --- a/bfd/vms-alpha.c +++ b/bfd/vms-alpha.c @@ -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); diff --git a/bfd/xsym.c b/bfd/xsym.c index 6d56729a1b8..95446e3f58c 100644 --- a/bfd/xsym.c +++ b/bfd/xsym.c @@ -1,6 +1,6 @@ /* xSYM symbol-file support for BFD. Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, - 2009 Free Software Foundation, Inc. + 2009, 2010 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -1082,10 +1082,8 @@ bfd_sym_fetch_type_information_table_entry (bfd *abfd, 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; diff --git a/binutils/ChangeLog b/binutils/ChangeLog index 9fb722c2eb5..881235bd6a7 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,7 @@ +2010-06-27 Alan Modra <amodra@gmail.com> + + * resbin.c (res_to_bin_accelerator): Delete set but unused variables. + 2010-06-17 Nick Clifton <nickc@redhat.com> PR binutils/11711 diff --git a/binutils/resbin.c b/binutils/resbin.c index 1db98d0668e..c35af981805 100644 --- a/binutils/resbin.c +++ b/binutils/resbin.c @@ -1,5 +1,5 @@ /* resbin.c -- manipulate the Windows binary resource format. - Copyright 1997, 1998, 1999, 2002, 2003, 2005, 2006, 2007, 2009 + Copyright 1997, 1998, 1999, 2002, 2003, 2005, 2006, 2007, 2009, 2010 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. Rewritten by Kai Tietz, Onevision. @@ -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) diff --git a/ld/ChangeLog b/ld/ChangeLog index 975edc04cbc..2548b753df2 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,13 @@ +2010-06-27 Alan Modra <amodra@gmail.com> + + * 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. + 2010-06-25 Alan Modra <amodra@gmail.com> * emultempl/ppc64elf.em (prelim_size_sections): New function. diff --git a/ld/emultempl/aix.em b/ld/emultempl/aix.em index 279032440bd..497f51de98b 100644 --- a/ld/emultempl/aix.em +++ b/ld/emultempl/aix.em @@ -10,7 +10,7 @@ fragment <<EOF /* AIX emulation code for ${EMULATION_NAME} Copyright 1991, 1993, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, - 2003, 2004, 2005, 2006, 2007, 2008, 2009 + 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. Written by Steve Chamberlain <sac@cygnus.com> AIX support by Ian Lance Taylor <ian@cygnus.com> @@ -1424,13 +1424,11 @@ gld${EMULATION_NAME}_open_dynamic_archive (const char *arch, 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)) { diff --git a/ld/emultempl/xtensaelf.em b/ld/emultempl/xtensaelf.em index 0ae0d1c0d70..37e7f5cb5d9 100644 --- a/ld/emultempl/xtensaelf.em +++ b/ld/emultempl/xtensaelf.em @@ -1,5 +1,5 @@ # This shell script emits a C file. -*- C -*- -# Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 +# Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 # Free Software Foundation, Inc. # # This file is part of the GNU Binutils. @@ -98,7 +98,6 @@ replace_insn_sec_with_prop_sec (bfd *abfd, 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 *abfd, 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_graph *deps, lang_wild_statement_type *w) 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 (lang_statement_union_type *statement) #endif bfd_boolean no_reorder = FALSE; - os = &statement->output_section_statement; - #if EXTRA_VALIDATION old_child_count = ld_count_children (statement); #endif diff --git a/ld/pe-dll.c b/ld/pe-dll.c index 47722b6df3d..9d3ee5da2dc 100644 --- a/ld/pe-dll.c +++ b/ld/pe-dll.c @@ -1154,7 +1154,7 @@ fill_edata (bfd *abfd, struct bfd_link_info *info ATTRIBUTE_UNUSED) /* 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_link_info *info, 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_link_info *info, } 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_link_info *info) { 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_link_info *info) } 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_link_info *info) 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_link_info *info) 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 *filename) 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 *filename) 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 diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index fac411a9576..276106756a1 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,28 @@ +2010-06-27 Alan Modra <amodra@gmail.com> + + * 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. + 2010-06-16 Vincent Rivière <vincent.riviere@freesbee.fr> PR gas/11673 diff --git a/opcodes/arc-dis.c b/opcodes/arc-dis.c index ba674549e00..b4cc241615f 100644 --- a/opcodes/arc-dis.c +++ b/opcodes/arc-dis.c @@ -1,5 +1,5 @@ /* Instruction printing code for the ARC. - Copyright 1994, 1995, 1997, 1998, 2000, 2001, 2002, 2005, 2007, 2009 + Copyright 1994, 1995, 1997, 1998, 2000, 2001, 2002, 2005, 2007, 2009, 2010 Free Software Foundation, Inc. Contributed by Doug Evans (dje@cygnus.com). @@ -238,7 +238,6 @@ arc_sprintf (struct arcDisState *state, char *buf, const char *format, ...) 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, char *buf, const char *format, ...) bp = buf; *bp = 0; p = format; - auxNum = -1; regMap[0] = 0; regMap[1] = 0; @@ -1170,7 +1168,6 @@ decodeInstr (bfd_vma address, /* Address of this instruction. */ 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, /* Address of this instruction. */ s.instName = _instName; /* Disassemble. */ - bytes = dsmOneArcInst (address, & s); + dsmOneArcInst (address, & s); /* Display the disassembly instruction. */ (*func) (stream, "%08lx ", s.words[0]); diff --git a/opcodes/bfin-dis.c b/opcodes/bfin-dis.c index 0be89f5f019..4741d200268 100644 --- a/opcodes/bfin-dis.c +++ b/opcodes/bfin-dis.c @@ -1,5 +1,5 @@ /* Disassemble ADI Blackfin Instructions. - Copyright 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. + Copyright 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. This file is part of libopcodes. @@ -4629,7 +4629,11 @@ _print_insn_bfin (bfd_vma pc, disassemble_info *outf) 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_info *outf) 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); diff --git a/opcodes/cgen-asm.in b/opcodes/cgen-asm.in index 5dde0aec023..be34ef56e06 100644 --- a/opcodes/cgen-asm.in +++ b/opcodes/cgen-asm.in @@ -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; diff --git a/opcodes/dlx-dis.c b/opcodes/dlx-dis.c index 1eb2576a3fe..f055c4d0fe6 100644 --- a/opcodes/dlx-dis.c +++ b/opcodes/dlx-dis.c @@ -1,5 +1,5 @@ /* Instruction printing code for the DLX Microprocessor - Copyright 2002, 2005, 2007 Free Software Foundation, Inc. + Copyright 2002, 2005, 2007, 2010 Free Software Foundation, Inc. Contributed by Kuang Hwa Lin. Written by Kuang Hwa Lin, 03/2002. This file is part of the GNU opcodes library. @@ -437,7 +437,6 @@ print_insn_dlx (bfd_vma memaddr, struct disassemble_info* info) 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 disassemble_info* info) #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++) diff --git a/opcodes/fr30-asm.c b/opcodes/fr30-asm.c index bbb1a86f89d..ad0456e0cf8 100644 --- a/opcodes/fr30-asm.c +++ b/opcodes/fr30-asm.c @@ -557,9 +557,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; @@ -676,31 +678,39 @@ fr30_cgen_assemble_insn (CGEN_CPU_DESC cd, { 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; diff --git a/opcodes/frv-asm.c b/opcodes/frv-asm.c index c5fa1c73d3e..dffa059ec29 100644 --- a/opcodes/frv-asm.c +++ b/opcodes/frv-asm.c @@ -1510,9 +1510,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; @@ -1629,31 +1631,39 @@ frv_cgen_assemble_insn (CGEN_CPU_DESC cd, { 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; diff --git a/opcodes/h8300-dis.c b/opcodes/h8300-dis.c index d6491b8a52b..0d260de68e0 100644 --- a/opcodes/h8300-dis.c +++ b/opcodes/h8300-dis.c @@ -1,6 +1,6 @@ /* Disassemble h8300 instructions. Copyright 1993, 1994, 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2006, - 2007 Free Software Foundation, Inc. + 2007, 2010 Free Software Foundation, Inc. This file is part of the GNU opcodes library. @@ -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++) diff --git a/opcodes/ip2k-asm.c b/opcodes/ip2k-asm.c index a164bc84d34..03e219c5544 100644 --- a/opcodes/ip2k-asm.c +++ b/opcodes/ip2k-asm.c @@ -758,9 +758,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; @@ -877,31 +879,39 @@ ip2k_cgen_assemble_insn (CGEN_CPU_DESC cd, { 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; diff --git a/opcodes/iq2000-asm.c b/opcodes/iq2000-asm.c index ec316551792..13f1cd36998 100644 --- a/opcodes/iq2000-asm.c +++ b/opcodes/iq2000-asm.c @@ -706,9 +706,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; @@ -825,31 +827,39 @@ iq2000_cgen_assemble_insn (CGEN_CPU_DESC cd, { 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; diff --git a/opcodes/lm32-asm.c b/opcodes/lm32-asm.c index 13328e6e583..31f4969dc6b 100644 --- a/opcodes/lm32-asm.c +++ b/opcodes/lm32-asm.c @@ -596,9 +596,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; @@ -715,31 +717,39 @@ lm32_cgen_assemble_insn (CGEN_CPU_DESC cd, { 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; diff --git a/opcodes/m32c-asm.c b/opcodes/m32c-asm.c index 6f724eb009f..13ab3ca187e 100644 --- a/opcodes/m32c-asm.c +++ b/opcodes/m32c-asm.c @@ -1831,9 +1831,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; @@ -1950,31 +1952,39 @@ m32c_cgen_assemble_insn (CGEN_CPU_DESC cd, { 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; diff --git a/opcodes/m32r-asm.c b/opcodes/m32r-asm.c index 60004c1556f..eff6da09307 100644 --- a/opcodes/m32r-asm.c +++ b/opcodes/m32r-asm.c @@ -575,9 +575,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; @@ -694,31 +696,39 @@ m32r_cgen_assemble_insn (CGEN_CPU_DESC cd, { 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; diff --git a/opcodes/maxq-dis.c b/opcodes/maxq-dis.c index 2f82c4d460d..d7e89971496 100644 --- a/opcodes/maxq-dis.c +++ b/opcodes/maxq-dis.c @@ -1,6 +1,6 @@ /* Instruction printing code for the MAXQ - Copyright 2004, 2005, 2007, 2009 Free Software Foundation, Inc. + Copyright 2004, 2005, 2007, 2009, 2010 Free Software Foundation, Inc. Written by Vineet Sharma(vineets@noida.hcltech.com) Inderpreet S.(inderpreetb@noida.hcltech.com) @@ -205,8 +205,6 @@ check_move (unsigned char insn0, unsigned char insn8) { 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, unsigned char insn8) /* 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, unsigned char insn8) && (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 disassemble_info *info, 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 disassemble_info *info, 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 disassemble_info *info, 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) diff --git a/opcodes/mep-asm.c b/opcodes/mep-asm.c index cb0ca82e286..2fc3087215c 100644 --- a/opcodes/mep-asm.c +++ b/opcodes/mep-asm.c @@ -1533,9 +1533,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; @@ -1652,31 +1654,39 @@ mep_cgen_assemble_insn (CGEN_CPU_DESC cd, { 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; diff --git a/opcodes/mep-dis.c b/opcodes/mep-dis.c index e0f26163a77..dbf429a4b91 100644 --- a/opcodes/mep-dis.c +++ b/opcodes/mep-dis.c @@ -534,14 +534,12 @@ mep_examine_ivc2_insns (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, bfd_vma pc ATTRIBUTE_ { 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. */ diff --git a/opcodes/msp430-dis.c b/opcodes/msp430-dis.c index c4a86eb418a..9d7edbeb903 100644 --- a/opcodes/msp430-dis.c +++ b/opcodes/msp430-dis.c @@ -1,5 +1,6 @@ /* Disassemble MSP430 instructions. - Copyright (C) 2002, 2004, 2005, 2007, 2009 Free Software Foundation, Inc. + Copyright (C) 2002, 2004, 2005, 2007, 2009, 2010 + Free Software Foundation, Inc. Contributed by Dmitry Diky <diwil@mail.ru> @@ -546,14 +547,13 @@ msp430_branchinstr (disassemble_info *info, 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; diff --git a/opcodes/mt-asm.c b/opcodes/mt-asm.c index 6bf31ba32ab..8dbbabf3fd9 100644 --- a/opcodes/mt-asm.c +++ b/opcodes/mt-asm.c @@ -842,9 +842,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; @@ -961,31 +963,39 @@ mt_cgen_assemble_insn (CGEN_CPU_DESC cd, { 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; diff --git a/opcodes/openrisc-asm.c b/opcodes/openrisc-asm.c index c9e4a3d9604..8aaf3746119 100644 --- a/opcodes/openrisc-asm.c +++ b/opcodes/openrisc-asm.c @@ -488,9 +488,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; @@ -607,31 +609,39 @@ openrisc_cgen_assemble_insn (CGEN_CPU_DESC cd, { 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; diff --git a/opcodes/sparc-dis.c b/opcodes/sparc-dis.c index 6a7649b3965..8dec272fb2b 100644 --- a/opcodes/sparc-dis.c +++ b/opcodes/sparc-dis.c @@ -1,6 +1,6 @@ /* Print SPARC instructions. Copyright 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2002, 2003, 2004, 2005, 2006, 2007, 2008 + 2000, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010 Free Software Foundation, Inc. This file is part of the GNU opcodes library. @@ -995,7 +995,8 @@ print_insn_sparc (bfd_vma memaddr, disassemble_info *info) 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) diff --git a/opcodes/xc16x-asm.c b/opcodes/xc16x-asm.c index fefa0400bd4..c7903e1f707 100644 --- a/opcodes/xc16x-asm.c +++ b/opcodes/xc16x-asm.c @@ -623,9 +623,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; @@ -742,31 +744,39 @@ xc16x_cgen_assemble_insn (CGEN_CPU_DESC cd, { 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; diff --git a/opcodes/xstormy16-asm.c b/opcodes/xstormy16-asm.c index 90d39e3b9a0..1191c64221f 100644 --- a/opcodes/xstormy16-asm.c +++ b/opcodes/xstormy16-asm.c @@ -523,9 +523,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; @@ -642,31 +644,39 @@ xstormy16_cgen_assemble_insn (CGEN_CPU_DESC cd, { 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; |