diff options
author | Lang Hames <lhames@gmail.com> | 2014-09-04 04:53:03 +0000 |
---|---|---|
committer | Lang Hames <lhames@gmail.com> | 2014-09-04 04:53:03 +0000 |
commit | eb195f015199c6ed390ca8420ab8bcb45429d213 (patch) | |
tree | d506472f0c334068810b93db550d018c31bc846e /llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.h | |
parent | 1ddc288265d1b4c7116f19ef2b2046034f02070f (diff) | |
download | bcm5719-llvm-eb195f015199c6ed390ca8420ab8bcb45429d213.tar.gz bcm5719-llvm-eb195f015199c6ed390ca8420ab8bcb45429d213.zip |
[MCJIT] Make sure eh-frame fixups use the target's pointer type, not the host's.
If the wrong pointer type is used it can cause corruption of the frame
description entries.
llvm-svn: 217124
Diffstat (limited to 'llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.h')
-rw-r--r-- | llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.h | 28 |
1 files changed, 5 insertions, 23 deletions
diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.h b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.h index bae7ca86e66..3b5faab6381 100644 --- a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.h +++ b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.h @@ -122,7 +122,6 @@ public: bool isCompatibleFormat(const ObjectBuffer *Buffer) const override; bool isCompatibleFile(const object::ObjectFile *Obj) const override; - void registerEHFrames() override; }; /// RuntimeDyldMachOTarget - Templated base class for generic MachO linker @@ -138,32 +137,15 @@ private: Impl &impl() { return static_cast<Impl &>(*this); } const Impl &impl() const { return static_cast<const Impl &>(*this); } + unsigned char *processFDE(unsigned char *P, int64_t DeltaForText, + int64_t DeltaForEH); + public: RuntimeDyldMachOCRTPBase(RTDyldMemoryManager *mm) : RuntimeDyldMachO(mm) {} void finalizeLoad(ObjectImage &ObjImg, - ObjSectionToIDMap &SectionMap) override { - unsigned EHFrameSID = RTDYLD_INVALID_SECTION_ID; - unsigned TextSID = RTDYLD_INVALID_SECTION_ID; - unsigned ExceptTabSID = RTDYLD_INVALID_SECTION_ID; - ObjSectionToIDMap::iterator i, e; - - for (i = SectionMap.begin(), e = SectionMap.end(); i != e; ++i) { - const SectionRef &Section = i->first; - StringRef Name; - Section.getName(Name); - if (Name == "__eh_frame") - EHFrameSID = i->second; - else if (Name == "__text") - TextSID = i->second; - else if (Name == "__gcc_except_tab") - ExceptTabSID = i->second; - else - impl().finalizeSection(ObjImg, i->second, Section); - } - UnregisteredEHFrameSections.push_back( - EHFrameRelatedSections(EHFrameSID, TextSID, ExceptTabSID)); - } + ObjSectionToIDMap &SectionMap) override; + void registerEHFrames() override; }; } // end namespace llvm |