This is the mail archive of the
binutils-cvs@sourceware.org
mailing list for the binutils project.
[binutils-gdb] ARM/BFD: Correct an `index' global shadowing error
- From: Maciej W.Rozycki <macro at sourceware dot org>
- To: bfd-cvs at sourceware dot org
- Date: 18 Oct 2016 03:44:11 -0000
- Subject: [binutils-gdb] ARM/BFD: Correct an `index' global shadowing error
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=c48182bfe408e06e3301ee887fd9a7b06bedff37
commit c48182bfe408e06e3301ee887fd9a7b06bedff37
Author: Maciej W. Rozycki <macro@imgtec.com>
Date: Tue Oct 18 04:28:34 2016 +0100
ARM/BFD: Correct an `index' global shadowing error
Fix a commit 5025eb7c0d87 ("Delete relocations associatesd with deleted
exidx entries.") build regression:
cc1: warnings being treated as errors
.../bfd/elf32-arm.c: In function 'elf32_arm_update_relocs':
.../bfd/elf32-arm.c:14951: warning: declaration of 'index' shadows a global declaration
/usr/include/string.h:304: warning: shadowed declaration is here
make[3]: *** [elf32-arm.lo] Error 1
in a way following commit 91d6fa6a035c ("Add -Wshadow to the gcc command
line options used when compiling the binutils.").
bfd/
* elf32-arm.c (elf32_arm_update_relocs): Rename `index' local
variable to `reloc_index'.
Diff:
---
bfd/ChangeLog | 5 +++++
bfd/elf32-arm.c | 8 ++++----
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 6f726ae..4dc5256 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2016-10-18 Maciej W. Rozycki <macro@imgtec.com>
+
+ * elf32-arm.c (elf32_arm_update_relocs): Rename `index' local
+ variable to `reloc_index'.
+
2016-10-12 Alan Modra <amodra@gmail.com>
* section.c (BFD_FAKE_SECTION): Reorder parameters. Formatting.
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index 787e570..c6bca9e 100644
--- a/bfd/elf32-arm.c
+++ b/bfd/elf32-arm.c
@@ -14948,15 +14948,15 @@ elf32_arm_update_relocs (asection *o,
{
arm_unwind_table_edit *edit_node, *edit_next;
bfd_vma bias;
- bfd_vma index;
+ bfd_vma reloc_index;
(*swap_in) (abfd, erela, irela);
- index = (irela->r_offset - offset) / 8;
+ reloc_index = (irela->r_offset - offset) / 8;
bias = 0;
edit_node = edit_list;
for (edit_next = edit_list;
- edit_next && edit_next->index <= index;
+ edit_next && edit_next->index <= reloc_index;
edit_next = edit_node->next)
{
bias++;
@@ -14964,7 +14964,7 @@ elf32_arm_update_relocs (asection *o,
}
if (edit_node->type != DELETE_EXIDX_ENTRY
- || edit_node->index != index)
+ || edit_node->index != reloc_index)
{
irela->r_offset -= bias * 8;
irela++;