This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[COMMITTED] Fix -Wshadow warning in readelf.c
- From: Matthew Fortune <Matthew dot Fortune at imgtec dot com>
- To: "binutils at sourceware dot org" <binutils at sourceware dot org>
- Date: Tue, 4 Nov 2014 23:51:12 +0000
- Subject: [COMMITTED] Fix -Wshadow warning in readelf.c
- Authentication-results: sourceware.org; auth=none
Fix a -Wshadow warning caused by using 'index' as a local variable
which shadows the prototype of the posix index function.
Introduced in commit: 79f2a78e76fae1885163027f843e1bafde984b4c
Fix problem with linker created sections being mistakenly flagged
as corrupt by the new error checking code in bfd_get_full_section_contents.
Committed as obvious.
Thanks,
Matthew
binutils/
* readelf.c (process_mips_specific): Rename index to idx.
---
binutils/ChangeLog | 4 ++++
binutils/readelf.c | 8 ++++----
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index f3c7196..d071381 100644
diff --git a/binutils/readelf.c b/binutils/readelf.c
index 03c2c5c..7c0c3ff 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -13579,16 +13579,16 @@ process_mips_specific (FILE * file)
sym_width = (is_32bit_elf ? 80 : 160) - 17 - addr_size * 6 - 1;
for (i = 0; i < count; i++)
{
- unsigned long index = get_reloc_symindex (rels[i].r_info);
+ unsigned long idx = get_reloc_symindex (rels[i].r_info);
ent = print_mips_pltgot_entry (data, mips_pltgot, ent);
printf (" ");
- if (index >= num_dynamic_syms)
- printf (_("<corrupt symbol index: %lu>"), index);
+ if (idx >= num_dynamic_syms)
+ printf (_("<corrupt symbol index: %lu>"), idx);
else
{
- Elf_Internal_Sym * psym = dynamic_symbols + index;
+ Elf_Internal_Sym * psym = dynamic_symbols + idx;
print_vma (psym->st_value, LONG_HEX);
printf (" %-7s %3s ",
--
1.9.4