summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-04-29 17:24:34 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-04-29 17:24:34 +0000
commitf1f1c626e7fcd3db60641be223308390de288a41 (patch)
tree69a91d6a0ffc501985816161f02a809d2a50fcf4 /llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h
parent63524b945356f1d3c5a4fe4b6ba979d9cdc97200 (diff)
downloadbcm5719-llvm-f1f1c626e7fcd3db60641be223308390de288a41.tar.gz
bcm5719-llvm-f1f1c626e7fcd3db60641be223308390de288a41.zip
Propagate relocation info to resolveRelocation.
This gets most of the MCJITs tests passing with MachO. llvm-svn: 180716
Diffstat (limited to 'llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h')
-rw-r--r--llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h21
1 files changed, 14 insertions, 7 deletions
diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h
index 46771d05a33..d0022c196d6 100644
--- a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h
+++ b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h
@@ -89,8 +89,20 @@ public:
/// used to make a relocation section relative instead of symbol relative.
intptr_t Addend;
+ /// True if this is a PCRel relocation (MachO specific).
+ bool IsPCRel;
+
+ /// The size of this relocation (MachO specific).
+ unsigned Size;
+
RelocationEntry(unsigned id, uint64_t offset, uint32_t type, int64_t addend)
- : SectionID(id), Offset(offset), RelType(type), Addend(addend) {}
+ : SectionID(id), Offset(offset), RelType(type), Addend(addend),
+ IsPCRel(false), Size(0) {}
+
+ RelocationEntry(unsigned id, uint64_t offset, uint32_t type, int64_t addend,
+ bool IsPCRel, unsigned Size)
+ : SectionID(id), Offset(offset), RelType(type), Addend(addend),
+ IsPCRel(IsPCRel), Size(Size) {}
};
class RelocationValueRef {
@@ -257,7 +269,6 @@ protected:
/// \brief Resolves relocations from Relocs list with address from Value.
void resolveRelocationList(const RelocationList &Relocs, uint64_t Value);
- void resolveRelocationEntry(const RelocationEntry &RE, uint64_t Value);
/// \brief A object file specific relocation resolver
/// \param Section The section where the relocation is being applied
@@ -266,11 +277,7 @@ protected:
/// \param Type object file specific relocation type
/// \param Addend A constant addend used to compute the value to be stored
/// into the relocatable field
- virtual void resolveRelocation(const SectionEntry &Section,
- uint64_t Offset,
- uint64_t Value,
- uint32_t Type,
- int64_t Addend) = 0;
+ virtual void resolveRelocation(const RelocationEntry &RE, uint64_t Value) = 0;
/// \brief Parses the object file relocation and stores it to Relocations
/// or SymbolRelocations (this depends on the object file type).
OpenPOWER on IntegriCloud