aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2010-06-27 04:07:55 +0000
committerAlan Modra <amodra@gmail.com>2010-06-27 04:07:55 +0000
commitc7e2358a8849d7540212543e1a2acbac648cb973 (patch)
treea882f5a804c7dca6bde423d24e5b13b1a3eeff32 /ld
parent1addfd92eb085db42013c4d45e3df8bf2053cde4 (diff)
downloadfsf-binutils-gdb-c7e2358a8849d7540212543e1a2acbac648cb973.zip
fsf-binutils-gdb-c7e2358a8849d7540212543e1a2acbac648cb973.tar.gz
fsf-binutils-gdb-c7e2358a8849d7540212543e1a2acbac648cb973.tar.bz2
fix set but unused variable warnings
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog10
-rw-r--r--ld/emultempl/aix.em4
-rw-r--r--ld/emultempl/xtensaelf.em7
-rw-r--r--ld/pe-dll.c16
4 files changed, 14 insertions, 23 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 975edc0..2548b75 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 2790324..497f51d 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 0ae0d1c..37e7f5c 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 47722b6..9d3ee5d 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