[lld] r249720 - [ELF2] Use EntrySize, not 8, to advance the .plt buffer when writing

Hal Finkel via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 8 12:16:05 PDT 2015


Author: hfinkel
Date: Thu Oct  8 14:16:05 2015
New Revision: 249720

URL: http://llvm.org/viewvc/llvm-project?rev=249720&view=rev
Log:
[ELF2] Use EntrySize, not 8, to advance the .plt buffer when writing

In preparation for making the size of a .plt entry target dependent, use the
existing EntrySize variable when writing (instead of a hard-coded value). NFC.

Modified:
    lld/trunk/ELF/OutputSections.cpp

Modified: lld/trunk/ELF/OutputSections.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/OutputSections.cpp?rev=249720&r1=249719&r2=249720&view=diff
==============================================================================
--- lld/trunk/ELF/OutputSections.cpp (original)
+++ lld/trunk/ELF/OutputSections.cpp Thu Oct  8 14:16:05 2015
@@ -119,7 +119,7 @@ template <class ELFT> void PltSection<EL
     uintptr_t InstPos = reinterpret_cast<uintptr_t>(Buf);
     uint64_t PltEntryAddr = (InstPos - Start) + this->getVA();
     Target->writePltEntry(Buf, GotEntryAddr, PltEntryAddr);
-    Buf += 8;
+    Buf += EntrySize;
   }
 }
 




More information about the llvm-commits mailing list