summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bfd/ChangeLog.arm5
-rw-r--r--bfd/elf32-arm.c6
2 files changed, 10 insertions, 1 deletions
diff --git a/bfd/ChangeLog.arm b/bfd/ChangeLog.arm
index 0e613565b46..d1af3b58104 100644
--- a/bfd/ChangeLog.arm
+++ b/bfd/ChangeLog.arm
@@ -1,3 +1,8 @@
+2016-06-22 Thomas Preud'homme <thomas.preudhomme@arm.com>
+
+ * bfd/elf32-arm.c (cmse_scan): Declare and initialize j in the
+ innermost conditional block containing all its uses.
+
2016-06-20 Thomas Preud'homme <thomas.preudhomme@arm.com>
* elf32-arm.c (elf32_arm_gc_mark_extra_sections): Mark sections holding
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index 588f832cce2..36d2a338a2e 100644
--- a/bfd/elf32-arm.c
+++ b/bfd/elf32-arm.c
@@ -5531,10 +5531,14 @@ cmse_scan (bfd *input_bfd, struct elf32_arm_link_hash_table *htab,
&& hash->root.root.type != bfd_link_hash_defweak)
|| hash->root.type != STT_FUNC)
{
+ /* Initialize here to avoid warning about use of possibly
+ uninitialized variable. */
+ j = 0;
+
if (!hash)
{
/* Searching for a normal symbol with local binding. */
- for (j = 0; j < ext_start; j++)
+ for (; j < ext_start; j++)
{
lsym_name =
bfd_elf_string_from_elf_section (input_bfd,