From 081a1941b595f6294e4ce678fd61ef56a2ceb51e Mon Sep 17 00:00:00 2001 From: "Michael J. Spencer" Date: Thu, 8 Aug 2013 22:27:13 +0000 Subject: [Object] Split the ELF interface into 3 parts. * ELFTypes.h contains template magic for defining types based on endianess, size, and alignment. * ELFFile.h defines the ELFFile class which provides low level ELF specific access. * ELFObjectFile.h contains ELFObjectFile which uses ELFFile to implement the ObjectFile interface. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188022 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp') diff --git a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp index cd99c3c0f3..501959e10d 100644 --- a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp +++ b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp @@ -22,7 +22,7 @@ #include "llvm/ADT/Triple.h" #include "llvm/ExecutionEngine/ObjectBuffer.h" #include "llvm/ExecutionEngine/ObjectImage.h" -#include "llvm/Object/ELF.h" +#include "llvm/Object/ELFObjectFile.h" #include "llvm/Object/ObjectFile.h" #include "llvm/Support/ELF.h" using namespace llvm; @@ -304,7 +304,7 @@ void RuntimeDyldELF::resolveAArch64Relocation(const SectionEntry &Section, } case ELF::R_AARCH64_PREL32: { uint64_t Result = Value + Addend - FinalAddress; - assert(static_cast(Result) >= INT32_MIN && + assert(static_cast(Result) >= INT32_MIN && static_cast(Result) <= UINT32_MAX); *TargetPtr = static_cast(Result & 0xffffffffU); break; @@ -316,7 +316,7 @@ void RuntimeDyldELF::resolveAArch64Relocation(const SectionEntry &Section, uint64_t BranchImm = Value + Addend - FinalAddress; // "Check that -2^27 <= result < 2^27". - assert(-(1LL << 27) <= static_cast(BranchImm) && + assert(-(1LL << 27) <= static_cast(BranchImm) && static_cast(BranchImm) < (1LL << 27)); // AArch64 code is emitted with .rela relocations. The data already in any @@ -341,7 +341,6 @@ void RuntimeDyldELF::resolveAArch64Relocation(const SectionEntry &Section, case ELF::R_AARCH64_MOVW_UABS_G2_NC: { uint64_t Result = Value + Addend; - // AArch64 code is emitted with .rela relocations. The data already in any // bits affected by the relocation on entry is garbage. *TargetPtr &= 0xffe0001fU; -- cgit v1.2.3