This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] bfd: Avoid incrementing uninitialized variable


Clang's uninitialized variable warning complained about this.

bfd/ChangeLog:

2015-02-09  Ed Maste  <emaste@freebsd.org>

        * elf32-i386.c (elf_i386_get_plt_sym_val): Avoid incrementing
        uninitialized and unused variable.
        * elf64-x86-64.c (elf_x86_64_get_plt_sym_val): Likewise.

---
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c
index dd4dbdc..452ec54 100644
--- a/bfd/elf32-i386.c
+++ b/bfd/elf32-i386.c
@@ -5187,7 +5187,7 @@ bad_return:
   if (plt_sym_val == NULL)
     goto bad_return;

-  for (i = 0; i < count; i++, p++)
+  for (i = 0; i < count; i++)
     plt_sym_val[i] = -1;

   plt_offset = bed->plt->plt_entry_size;
diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c
index 5fd727b..fd9c726 100644
--- a/bfd/elf64-x86-64.c
+++ b/bfd/elf64-x86-64.c
@@ -5569,7 +5569,7 @@ bad_return:
   if (plt_sym_val == NULL)
     goto bad_return;

-  for (i = 0; i < count; i++, p++)
+  for (i = 0; i < count; i++)
     plt_sym_val[i] = -1;

   plt_offset = bed->plt_entry_size;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]