* incremental.cc (Sized_incr_relobj::do_add_symbols): Always
authorIan Lance Taylor <ian@airs.com>
Tue, 12 Apr 2011 05:55:33 +0000 (05:55 +0000)
committerIan Lance Taylor <ian@airs.com>
Tue, 12 Apr 2011 05:55:33 +0000 (05:55 +0000)
initialize local variable v.

gold/ChangeLog
gold/incremental.cc

index a3ebae99171e55252bf536884e101cec4000918e..cb4cdfa880542db092ce20fffedbdeb0678bc7be 100644 (file)
@@ -1,3 +1,8 @@
+2011-04-11  Ian Lance Taylor  <iant@google.com>
+
+       * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
+       initialize local variable v.
+
 2011-04-11  Cary Coutant  <ccoutant@google.com>
 
        * archive.cc (Archive::include_member): Adjust call to
index e4c0fe15e9bee2f43b3eff633fc24641c746c4e4..ba89e0569e37a9a27c247b6e8da43a070c44601b 100644 (file)
@@ -1668,7 +1668,7 @@ Sized_incr_relobj<size, big_endian>::do_add_symbols(
       if (!strtab.get_c_string(gsym.get_st_name(), &name))
        name = "";
 
-      typename elfcpp::Elf_types<size>::Elf_Addr v;
+      typename elfcpp::Elf_types<size>::Elf_Addr v = gsym.get_st_value();
       unsigned int shndx = gsym.get_st_shndx();
       elfcpp::STB st_bind = gsym.get_st_bind();
       elfcpp::STT st_type = gsym.get_st_type();
@@ -1688,7 +1688,6 @@ Sized_incr_relobj<size, big_endian>::do_add_symbols(
        {
          // Find the input section and calculate the section-relative value.
          gold_assert(shndx != elfcpp::SHN_UNDEF);
-         v = gsym.get_st_value();
          Output_section* os = this->ibase_->output_section(shndx);
          gold_assert(os != NULL && os->has_fixed_layout());
          typename Input_entry_reader::Input_section_info sect =