[lld] r248289 - Use a signed value for Delta.

Rafael Espindola via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 22 10:08:25 PDT 2015


Author: rafael
Date: Tue Sep 22 12:08:25 2015
New Revision: 248289

URL: http://llvm.org/viewvc/llvm-project?rev=248289&view=rev
Log:
Use a signed value for Delta.

This fixes got.s on 32 bit windows.

Patch by Igor Kudrin!

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=248289&r1=248288&r2=248289&view=diff
==============================================================================
--- lld/trunk/ELF/OutputSections.cpp (original)
+++ lld/trunk/ELF/OutputSections.cpp Tue Sep 22 12:08:25 2015
@@ -48,7 +48,7 @@ template <class ELFT> void PltSection<EL
     Buf += Jmp.size();
 
     uintptr_t OffsetInPLT = (InstPos + 6) - Start;
-    uintptr_t Delta = GotSec.getEntryAddr(*E) - (this->getVA() + OffsetInPLT);
+    intptr_t Delta = GotSec.getEntryAddr(*E) - (this->getVA() + OffsetInPLT);
     assert(isInt<32>(Delta));
     support::endian::write32le(Buf, Delta);
     Buf += 4;




More information about the llvm-commits mailing list