From f6f9ed015ea683ee2b00591aa31a4cacedb7a810 Mon Sep 17 00:00:00 2001 From: Tulio Magno Quites Machado Filho Date: Tue, 7 Aug 2018 22:39:23 -0700 Subject: [PATCH] Fix "may be used uninitialized" warning. * object.cc (Sized_relobj_file::map_to_kept_section): Initialize kept_file. --- gold/ChangeLog | 5 +++++ gold/object.cc | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/gold/ChangeLog b/gold/ChangeLog index 658f5aef57a..a5f4a85a76e 100644 --- a/gold/ChangeLog +++ b/gold/ChangeLog @@ -1,3 +1,8 @@ +2018-07-10 Tulio Magno Quites Machado Filho + + * object.cc (Sized_relobj_file::map_to_kept_section): Initialize + kept_file. + 2018-08-07 Cary Coutant PR ld/23486 diff --git a/gold/object.cc b/gold/object.cc index 084212c790e..cbeddb9158b 100644 --- a/gold/object.cc +++ b/gold/object.cc @@ -2951,7 +2951,7 @@ Sized_relobj_file::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::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) -- 2.30.2