From 36f69229e670e0ef545cf95ae3241e94fa7e6090 Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Fri, 9 Oct 2015 00:50:05 +0000 Subject: [PATCH] Simplify expressions. NFC. llvm-svn: 249793 --- lld/ELF/OutputSections.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lld/ELF/OutputSections.cpp b/lld/ELF/OutputSections.cpp index 8b2fe21d8ce3..af2e637b6b4a 100644 --- a/lld/ELF/OutputSections.cpp +++ b/lld/ELF/OutputSections.cpp @@ -113,12 +113,11 @@ PltSection::PltSection() } template void PltSection::writeTo(uint8_t *Buf) { - uintptr_t Start = reinterpret_cast(Buf); + uint8_t *Start = Buf; for (const SymbolBody *E : Entries) { - uint64_t GotEntryAddr = Out::Got->getEntryAddr(*E); - uintptr_t InstPos = reinterpret_cast(Buf); - uint64_t PltEntryAddr = (InstPos - Start) + this->getVA(); - Target->writePltEntry(Buf, GotEntryAddr, PltEntryAddr); + uint64_t Got = Out::Got->getEntryAddr(*E); + uint64_t Plt = Buf - Start + this->getVA(); + Target->writePltEntry(Buf, Got, Plt); Buf += Target->getPltEntrySize(); } }