Simplify. NFC.

llvm-svn: 259660
This commit is contained in:
Rafael Espindola 2016-02-03 16:53:39 +00:00
parent bea6c54723
commit 38a36c4f1c
1 changed files with 1 additions and 5 deletions

View File

@ -848,16 +848,12 @@ elf2::getLocalRelTarget(const ObjectFile<ELFT> &File,
if (Section == &InputSection<ELFT>::Discarded || !Section->isLive())
return Addend;
uintX_t VA = Section->OutSec->getVA();
if (isa<InputSection<ELFT>>(Section))
return VA + Section->getOffset(*Sym) + Addend;
uintX_t Offset = Sym->st_value;
if (Sym->getType() == STT_SECTION) {
Offset += Addend;
Addend = 0;
}
return VA + Section->getOffset(Offset) + Addend;
return Section->OutSec->getVA() + Section->getOffset(Offset) + Addend;
}
// Returns true if a symbol can be replaced at load-time by a symbol