summaryrefslogtreecommitdiff
path: root/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.h
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2014-05-12 21:39:59 +0000
committerLang Hames <lhames@gmail.com>2014-05-12 21:39:59 +0000
commitb572bc1ccfc41ae7567423843a5b88f8fba270ac (patch)
tree583925a8d52504c80c53a800f497b9a47c5f4fb1 /lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.h
parent61248341474ae75536b64edde4debe813f21068d (diff)
downloadllvm-b572bc1ccfc41ae7567423843a5b88f8fba270ac.tar.gz
llvm-b572bc1ccfc41ae7567423843a5b88f8fba270ac.tar.bz2
llvm-b572bc1ccfc41ae7567423843a5b88f8fba270ac.tar.xz
[RuntimeDyld] Add support for MachO __jump_table and __pointers sections, and
SECTDIFF relocations on 32-bit x86. This fixes several of the MCJIT regression test failures that show up on 32-bit builds. <rdar://problem/16886294> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208635 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.h')
-rw-r--r--lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.h b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.h
index 0c799bd7bc..138c59b95c 100644
--- a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.h
+++ b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.h
@@ -46,6 +46,14 @@ private:
bool resolveARMRelocation(const RelocationEntry &RE, uint64_t Value);
bool resolveARM64Relocation(const RelocationEntry &RE, uint64_t Value);
+ // Populate stubs in __jump_table section.
+ void populateJumpTable(MachOObjectFile &Obj, const SectionRef &JTSection,
+ unsigned JTSectionID);
+
+ // Populate __pointers section.
+ void populatePointersSection(MachOObjectFile &Obj, const SectionRef &PTSection,
+ unsigned PTSectionID);
+
unsigned getMaxStubSize() override {
if (Arch == Triple::arm || Arch == Triple::thumb)
return 8; // 32-bit instruction and 32-bit address
@@ -57,6 +65,12 @@ private:
unsigned getStubAlignment() override { return 1; }
+ relocation_iterator processSECTDIFFRelocation(
+ unsigned SectionID,
+ relocation_iterator RelI,
+ ObjectImage &ObjImg,
+ ObjSectionToIDMap &ObjSectionToID);
+
struct EHFrameRelatedSections {
EHFrameRelatedSections()
: EHFrameSID(RTDYLD_INVALID_SECTION_ID),
@@ -85,7 +99,8 @@ public:
bool isCompatibleFormat(const ObjectBuffer *Buffer) const override;
bool isCompatibleFile(const object::ObjectFile *Obj) const override;
void registerEHFrames() override;
- void finalizeLoad(ObjSectionToIDMap &SectionMap) override;
+ void finalizeLoad(ObjectImage &ObjImg,
+ ObjSectionToIDMap &SectionMap) override;
static ObjectImage *createObjectImage(ObjectBuffer *InputBuffer) {
return new ObjectImageCommon(InputBuffer);