diff options
author | Lang Hames <lhames@gmail.com> | 2019-05-07 22:56:40 +0000 |
---|---|---|
committer | Lang Hames <lhames@gmail.com> | 2019-05-07 22:56:40 +0000 |
commit | 0d8ae1e3435accab5130d71dfc872507043ca4f1 (patch) | |
tree | 5b60260266cc2e1932c210159c85f53bd7cc7547 /llvm/lib/ExecutionEngine/JITLink/MachOAtomGraphBuilder.h | |
parent | d028a463d53a5c90bf1244f9c20a2e0439b7fd40 (diff) | |
download | bcm5719-llvm-0d8ae1e3435accab5130d71dfc872507043ca4f1.tar.gz bcm5719-llvm-0d8ae1e3435accab5130d71dfc872507043ca4f1.zip |
Reapply r360194 "[JITLink] Add support for MachO .alt_entry atoms." with fixes.
This patch modifies MachOAtomGraphBuilder to use setLayoutNext rather than
addEdge, and fixes a bug in the section layout algorithm that could result in
atoms appearing more than once in the section ordering (which resulted in those
atoms being assigned invalid addresses during layout).
llvm-svn: 360205
Diffstat (limited to 'llvm/lib/ExecutionEngine/JITLink/MachOAtomGraphBuilder.h')
-rw-r--r-- | llvm/lib/ExecutionEngine/JITLink/MachOAtomGraphBuilder.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/ExecutionEngine/JITLink/MachOAtomGraphBuilder.h b/llvm/lib/ExecutionEngine/JITLink/MachOAtomGraphBuilder.h index 340a11dfc0e..540e2c366f0 100644 --- a/llvm/lib/ExecutionEngine/JITLink/MachOAtomGraphBuilder.h +++ b/llvm/lib/ExecutionEngine/JITLink/MachOAtomGraphBuilder.h @@ -96,6 +96,10 @@ protected: virtual Error addRelocations() = 0; + /// Returns true if Atom A and Atom B are at a fixed offset from one another + /// (i.e. if they're part of the same alt-entry chain). + bool areLayoutLocked(const Atom &A, const Atom &B); + private: static unsigned getPointerSize(const object::MachOObjectFile &Obj); static support::endianness getEndianness(const object::MachOObjectFile &Obj); @@ -108,6 +112,7 @@ private: const object::MachOObjectFile &Obj; std::unique_ptr<AtomGraph> G; + DenseMap<const DefinedAtom *, const DefinedAtom *> AltEntryStarts; DenseMap<unsigned, MachOSection> Sections; StringMap<CustomAtomizeFunction> CustomAtomizeFunctions; Optional<MachOSection> CommonSymbolsSection; |