From: Juergen Ributzka Date: Tue, 22 Jul 2014 21:42:46 +0000 (+0000) Subject: [RuntimeDyld] Change the return type of decodeAddend to match the storage type. X-Git-Tag: android-x86-7.1-r4~59425 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=5b50a3c76987f4506e6b5f12dadadde0d52b2c68;p=android-x86%2Fexternal-llvm.git [RuntimeDyld] Change the return type of decodeAddend to match the storage type. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213686 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp index 58fb51557c9..ba7c7cb9240 100644 --- a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp +++ b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp @@ -27,9 +27,9 @@ using namespace llvm::object; namespace llvm { -uint64_t RuntimeDyldMachO::decodeAddend(uint8_t *LocalAddress, unsigned NumBytes, - uint32_t RelType) const { - uint64_t Addend = 0; +int64_t RuntimeDyldMachO::decodeAddend(uint8_t *LocalAddress, unsigned NumBytes, + uint32_t RelType) const { + int64_t Addend = 0; memcpy(&Addend, LocalAddress, NumBytes); return Addend; } diff --git a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.h b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.h index 7d1dc0263db..ecbbf828251 100644 --- a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.h +++ b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.h @@ -52,8 +52,8 @@ protected: RuntimeDyldMachO(RTDyldMemoryManager *mm) : RuntimeDyldImpl(mm) {} /// Extract the addend encoded in the instruction. - uint64_t decodeAddend(uint8_t *LocalAddress, unsigned NumBytes, - uint32_t RelType) const; + int64_t decodeAddend(uint8_t *LocalAddress, unsigned NumBytes, + uint32_t RelType) const; /// Construct a RelocationValueRef representing the relocation target. /// For Symbols in known sections, this will return a RelocationValueRef @@ -138,7 +138,7 @@ protected: uint8_t *LocalAddress = Section.Address + Offset; unsigned NumBytes = 1 << Size; uint32_t RelType = Obj.getAnyRelocationType(RelInfo); - uint64_t Addend = impl().decodeAddend(LocalAddress, NumBytes, RelType); + int64_t Addend = impl().decodeAddend(LocalAddress, NumBytes, RelType); return RelocationEntry(SectionID, Offset, RelType, Addend, IsPCRel, Size); }