Fix "may be used uninitialized" warning.
authorTulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
Wed, 8 Aug 2018 05:39:23 +0000 (22:39 -0700)
committerCary Coutant <ccoutant@gmail.com>
Wed, 8 Aug 2018 05:40:33 +0000 (22:40 -0700)
* object.cc (Sized_relobj_file::map_to_kept_section): Initialize
kept_file.

gold/ChangeLog
gold/object.cc

index 658f5aef57afde9b2e8cb369afc870598e2fcc41..a5f4a85a76ed1ad8d27427d9ca96930c18888d0c 100644 (file)
@@ -1,3 +1,8 @@
+2018-07-10  Tulio Magno Quites Machado Filho  <tuliom@linux.ibm.com>
+
+       * object.cc (Sized_relobj_file::map_to_kept_section): Initialize
+       kept_file.
+
 2018-08-07  Cary Coutant  <ccoutant@gmail.com>
 
        PR ld/23486
index 084212c790e6afdb6678f4bdb46d4d54a875a9ee..cbeddb9158b91afcbf30c060009f81f880f5f19f 100644 (file)
@@ -2951,7 +2951,7 @@ Sized_relobj_file<size, big_endian>::map_to_kept_section(
              // Since we're using this mapping for relocation processing,
              // we don't want to match sections unless they have the same
              // size.
-             uint64_t kept_size;
+             uint64_t kept_size = 0;
              if (kept_section->find_comdat_section(section_name, &kept_shndx,
                                                    &kept_size))
                {
@@ -2961,7 +2961,7 @@ Sized_relobj_file<size, big_endian>::map_to_kept_section(
            }
          else
            {
-             uint64_t kept_size;
+             uint64_t kept_size = 0;
              if (kept_section->find_single_comdat_section(&kept_shndx,
                                                           &kept_size)
                  && sh_size == kept_size)