diff options
author | Michael J. Spencer <bigcheesegs@gmail.com> | 2013-08-08 22:27:13 +0000 |
---|---|---|
committer | Michael J. Spencer <bigcheesegs@gmail.com> | 2013-08-08 22:27:13 +0000 |
commit | 081a1941b595f6294e4ce678fd61ef56a2ceb51e (patch) | |
tree | 45ac82225774a2894de7e3e4c4a83e5cf2d90dd5 /lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp | |
parent | 491d04969d9f29ed891c73238648853954ba4f81 (diff) | |
download | llvm-081a1941b595f6294e4ce678fd61ef56a2ceb51e.tar.gz llvm-081a1941b595f6294e4ce678fd61ef56a2ceb51e.tar.bz2 llvm-081a1941b595f6294e4ce678fd61ef56a2ceb51e.tar.xz |
[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
Diffstat (limited to 'lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp')
-rw-r--r-- | lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
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<int64_t>(Result) >= INT32_MIN && + assert(static_cast<int64_t>(Result) >= INT32_MIN && static_cast<int64_t>(Result) <= UINT32_MAX); *TargetPtr = static_cast<uint32_t>(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<int64_t>(BranchImm) && + assert(-(1LL << 27) <= static_cast<int64_t>(BranchImm) && static_cast<int64_t>(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; |