Fix a potential use of an uninitialised variable error in gold.

* target-reloc.h (issue_discarded_error): Initialise the
	key_symndx variable.
This commit is contained in:
Nick Clifton 2020-06-24 17:38:16 +01:00
parent 4bf05d4a90
commit fb58f5e928
2 changed files with 6 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2020-06-24 Nick Clifton <nickc@redhat.com>
* target-reloc.h (issue_discarded_error): Initialise the
key_symndx variable.
2020-06-23 Roland McGrath <mcgrathr@google.com>
PR 22843

View File

@ -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)