Don't call getOffset twice. NFC.

Just a bit faster.

llvm-svn: 330306
This commit is contained in:
Rafael Espindola 2018-04-19 02:24:28 +00:00
parent 50c7db17f7
commit 719fcd08c6
1 changed files with 3 additions and 2 deletions

View File

@ -710,10 +710,11 @@ void InputSectionBase::relocateAlloc(uint8_t *Buf, uint8_t *BufEnd) {
const unsigned Bits = Config->Wordsize * 8;
for (const Relocation &Rel : Relocations) {
uint8_t *BufLoc = Buf + getOffset(Rel.Offset);
uint64_t Offset = getOffset(Rel.Offset);
uint8_t *BufLoc = Buf + Offset;
RelType Type = Rel.Type;
uint64_t AddrLoc = getVA(Rel.Offset);
uint64_t AddrLoc = getOutputSection()->Addr + Offset;
RelExpr Expr = Rel.Expr;
uint64_t TargetVA = SignExtend64(
getRelocTargetVA(Type, Rel.Addend, AddrLoc, *Rel.Sym, Expr), Bits);