[ELF][Reader][Perf] Only do loookup once.

llvm-svn: 177563
This commit is contained in:
Michael J. Spencer 2013-03-20 19:25:58 +00:00
parent 602ffc13b8
commit da384eebe5
1 changed files with 3 additions and 2 deletions

View File

@ -516,7 +516,8 @@ public:
int64_t relocAddend = relHandler.relocAddend(*ri);
uint64_t addend = ri->addend() + relocAddend;
const MergeSectionKey ms(shdr, addend);
if (_mergedSectionMap.find(ms) == _mergedSectionMap.end()) {
auto msec = _mergedSectionMap.find(ms);
if (msec == _mergedSectionMap.end()) {
if (Symbol->getType() != llvm::ELF::STT_SECTION)
addend = Symbol->st_value + addend;
MergeAtomsIter mai = findMergeAtom(shdr, addend);
@ -529,7 +530,7 @@ public:
llvm_unreachable("unable to find a merge atom");
} // find
else
ri->setTarget(_mergedSectionMap[ms]);
ri->setTarget(msec->second);
} else
ri->setTarget(findAtom(Symbol));
}