[BOLT] Fix symbol table issue with ICF

Summary: Not all symbol table entries were updated after ICF.

(cherry picked from FBD19319685)
This commit is contained in:
Maksim Panchenko 2020-01-08 13:32:59 -08:00
parent ac697b7d3a
commit d57513e4ab
1 changed files with 3 additions and 2 deletions

View File

@ -2035,8 +2035,9 @@ BinaryContext::getBinaryFunctionContainingAddress(uint64_t Address,
BinaryFunction *
BinaryContext::getBinaryFunctionAtAddress(uint64_t Address, bool Shallow) {
if (const auto *BD = getBinaryDataAtAddress(Address)) {
auto *BF = getFunctionForSymbol(BD->getSymbol());
if (BF && BF->getAddress() == Address) {
uint64_t EntryID{0};
auto *BF = getFunctionForSymbol(BD->getSymbol(), &EntryID);
if (BF && EntryID == 0) {
while (BF->getParentFunction() && !Shallow) {
BF = BF->getParentFunction();
}