From: Nick Clifton Date: Wed, 24 Jun 2020 16:38:16 +0000 (+0100) Subject: Fix a potential use of an uninitialised variable error in gold. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fb58f5e9286a7ea5c6f0977595c37f11087f5883;p=binutils-gdb.git Fix a potential use of an uninitialised variable error in gold. * target-reloc.h (issue_discarded_error): Initialise the key_symndx variable. --- diff --git a/gold/ChangeLog b/gold/ChangeLog index 4d524d7f5ac..78b5579cd87 100644 --- a/gold/ChangeLog +++ b/gold/ChangeLog @@ -1,3 +1,8 @@ +2020-06-24 Nick Clifton + + * target-reloc.h (issue_discarded_error): Initialise the + key_symndx variable. + 2020-06-23 Roland McGrath PR 22843 diff --git a/gold/target-reloc.h b/gold/target-reloc.h index 2b205a1a74b..e9e3e5b0027 100644 --- a/gold/target-reloc.h +++ b/gold/target-reloc.h @@ -258,7 +258,7 @@ issue_discarded_error( &is_ordinary); if (orig_shndx != elfcpp::SHN_UNDEF) { - unsigned int key_symndx; + unsigned int key_symndx = 0; Relobj* kept_obj = object->find_kept_section_object(orig_shndx, &key_symndx); if (key_symndx != 0)