[ELF] Initialize 2 fields of Symbol in SymbolTable::insert
authorFangrui Song <maskray@google.com>
Wed, 14 Aug 2019 01:52:47 +0000 (01:52 +0000)
committerFangrui Song <maskray@google.com>
Wed, 14 Aug 2019 01:52:47 +0000 (01:52 +0000)
commitf1d538cce54b4a2ae06b07cf5323b0137f5385d3
tree5c10ef2b4bd53df00f8cce38c3c20b8fc31f9f11
parentcee41ce223c7e5bd1a52a74e37d79bbbc785cf0a
[ELF] Initialize 2 fields of Symbol in SymbolTable::insert

A new symbol is added to elf::symtab in 3 steps:

1) SymbolTable::insert creates a placeholder.
2) Symbol::mergeProperties
3) Symbol::replace

Fields referenced by steps 2) and 3) should be initialized in
SymbolTable::insert.  `traced` and `referenced` were missed previously.
This did not cause problems because compilers generated code that
initialized them (bit fields) to 0.

Reviewed By: grimar

Differential Revision: https://reviews.llvm.org/D66130

llvm-svn: 368784
lld/ELF/SymbolTable.cpp
lld/ELF/Symbols.h