diff options
author | Lang Hames <lhames@gmail.com> | 2019-04-21 04:48:32 +0000 |
---|---|---|
committer | Lang Hames <lhames@gmail.com> | 2019-04-21 04:48:32 +0000 |
commit | a97032e9479db2d2c8808f74081162f5c5a45b4a (patch) | |
tree | 271bfa7eb0b5d8bd1a3d099c29175002b9b6bce3 /llvm/lib/ExecutionEngine | |
parent | 3ccd677bf8841b4791344f25c4c57faf8e144dc6 (diff) | |
download | bcm5719-llvm-a97032e9479db2d2c8808f74081162f5c5a45b4a.tar.gz bcm5719-llvm-a97032e9479db2d2c8808f74081162f5c5a45b4a.zip |
[JITLink] Remove an overly strict error check in JITLink's eh-frame parser.
The error check required FDEs to refer to the most recent CIE, but the eh-frame
spec allows them to refer to any previously seen CIE. This patch removes the
offending check.
llvm-svn: 358840
Diffstat (limited to 'llvm/lib/ExecutionEngine')
-rw-r--r-- | llvm/lib/ExecutionEngine/JITLink/JITLink_EHFrameSupport.cpp | 16 | ||||
-rw-r--r-- | llvm/lib/ExecutionEngine/JITLink/JITLink_EHFrameSupportImpl.h | 1 |
2 files changed, 4 insertions, 13 deletions
diff --git a/llvm/lib/ExecutionEngine/JITLink/JITLink_EHFrameSupport.cpp b/llvm/lib/ExecutionEngine/JITLink/JITLink_EHFrameSupport.cpp index 8d94e46cf22..2aa4a45600c 100644 --- a/llvm/lib/ExecutionEngine/JITLink/JITLink_EHFrameSupport.cpp +++ b/llvm/lib/ExecutionEngine/JITLink/JITLink_EHFrameSupport.cpp @@ -164,7 +164,6 @@ Error EHFrameParser::processCIE() { LLVM_DEBUG(dbgs() << " Record is CIE\n"); /// Reset state for the new CIE. - MostRecentCIE = CurRecordAtom; LSDAFieldPresent = false; uint8_t Version = 0; @@ -276,26 +275,19 @@ Error EHFrameParser::processFDE(JITTargetAddress CIEPointerAddress, uint32_t CIEPointer) { LLVM_DEBUG(dbgs() << " Record is FDE\n"); - // Sanity check the CIE pointer: if this is an FDE it must be proceeded by - // a CIE. - if (MostRecentCIE == nullptr) - return make_error<JITLinkError>("__eh_frame must start with CIE, not " - "FDE"); - LLVM_DEBUG({ dbgs() << " CIE pointer: " << format("0x%016" PRIx64, CIEPointerAddress - CIEPointer) << "\n"; }); - // Verify that this FDE's CIE pointer points to the most recent CIE entry. - if (CIEPointerAddress - CIEPointer != MostRecentCIE->getAddress()) - return make_error<JITLinkError>("__eh_frame FDE's CIE Pointer does not " - "point at the most recent CIE"); + auto CIEAtom = G.findAtomByAddress(CIEPointerAddress - CIEPointer); + if (!CIEAtom) + return CIEAtom.takeError(); // The CIEPointer looks good. Add a relocation. CurRecordAtom->addEdge(FDEToCIERelocKind, CIEPointerAddress - CurRecordAtom->getAddress(), - *MostRecentCIE, 0); + *CIEAtom, 0); // Read and sanity check the PC-start pointer and size. JITTargetAddress PCBeginAddress = EHFrameAddress + EHFrameReader.getOffset(); diff --git a/llvm/lib/ExecutionEngine/JITLink/JITLink_EHFrameSupportImpl.h b/llvm/lib/ExecutionEngine/JITLink/JITLink_EHFrameSupportImpl.h index 85b1b803c5d..fe4b182401a 100644 --- a/llvm/lib/ExecutionEngine/JITLink/JITLink_EHFrameSupportImpl.h +++ b/llvm/lib/ExecutionEngine/JITLink/JITLink_EHFrameSupportImpl.h @@ -50,7 +50,6 @@ private: JITTargetAddress EHFrameAddress; BinaryStreamReader EHFrameReader; DefinedAtom *CurRecordAtom = nullptr; - DefinedAtom *MostRecentCIE = nullptr; bool LSDAFieldPresent = false; Edge::Kind FDEToCIERelocKind; Edge::Kind FDEToTargetRelocKind; |