|
LLVM
10.0.0
|
#include "ExecutionEngine/JITLink/MachOLinkGraphBuilder.h"
Classes | |
| class | NormalizedSection |
| struct | NormalizedSymbol |
Public Member Functions | |
| virtual | ~MachOLinkGraphBuilder () |
| Expected< std::unique_ptr< LinkGraph > > | buildGraph () |
Protected Types | |
| using | SectionParserFunction = std::function< Error(NormalizedSection &S)> |
Protected Member Functions | |
| MachOLinkGraphBuilder (const object::MachOObjectFile &Obj) | |
| LinkGraph & | getGraph () const |
| const object::MachOObjectFile & | getObject () const |
| void | addCustomSectionParser (StringRef SectionName, SectionParserFunction Parse) |
| virtual Error | addRelocations ()=0 |
| template<typename... ArgTs> | |
| NormalizedSymbol & | createNormalizedSymbol (ArgTs &&... Args) |
| Create a symbol. More... | |
| NormalizedSection & | getSectionByIndex (unsigned Index) |
| Index is zero-based (MachO section indexes are usually one-based) and assumed to be in-range. More... | |
| Expected< NormalizedSection & > | findSectionByIndex (unsigned Index) |
| Try to get the section at the given index. More... | |
| Expected< NormalizedSymbol & > | findSymbolByIndex (uint64_t Index) |
| Try to get the symbol at the given index. More... | |
| Symbol * | getSymbolByAddress (JITTargetAddress Address) |
| Returns the symbol with the highest address not greater than the search address, or null if no such symbol exists. More... | |
| Expected< Symbol & > | findSymbolByAddress (JITTargetAddress Address) |
| Returns the symbol with the highest address not greater than the search address, or an error if no such symbol exists. More... | |
Static Protected Member Functions | |
| static Linkage | getLinkage (uint16_t Desc) |
| static Scope | getScope (StringRef Name, uint8_t Type) |
| static bool | isAltEntry (const NormalizedSymbol &NSym) |
Definition at line 27 of file MachOLinkGraphBuilder.h.
|
protected |
Definition at line 76 of file MachOLinkGraphBuilder.h.
|
virtual |
Definition at line 22 of file MachOLinkGraphBuilder.cpp.
|
protected |
Definition at line 48 of file MachOLinkGraphBuilder.cpp.
|
protected |
Definition at line 53 of file MachOLinkGraphBuilder.cpp.
References assert(), llvm::StringMap< ValueTy, AllocatorTy >::count(), and AMDGPU::ElfNote::SectionName.
Referenced by getObject().
|
protectedpure virtual |
Referenced by getObject().
Definition at line 24 of file MachOLinkGraphBuilder.cpp.
References llvm::object::MachOObjectFile::isRelocatableObject().
|
inlineprotected |
Create a symbol.
Definition at line 91 of file MachOLinkGraphBuilder.h.
References Allocator, and llvm::AMDGPU::HSAMD::Kernel::Key::Args.
Referenced by isAltEntry().
|
inlineprotected |
Try to get the section at the given index.
Will return an error if the given index is out of range, or if no section has been added for the given index.
Definition at line 109 of file MachOLinkGraphBuilder.h.
References llvm::formatv(), and I.
Referenced by isAltEntry().
|
inlineprotected |
Returns the symbol with the highest address not greater than the search address, or an error if no such symbol exists.
Definition at line 141 of file MachOLinkGraphBuilder.h.
References llvm::Address, Allocator, assert(), llvm::Data, llvm::jitlink::MachOLinkGraphBuilder::NormalizedSymbol::Desc, llvm::formatv(), G, llvm::jitlink::Symbol::getAddress(), getLinkage(), getPointerSize(), getScope(), getSymbolByAddress(), isAltEntry(), llvm::jitlink::MachOLinkGraphBuilder::NormalizedSymbol::Name, and Size.
|
inlineprotected |
Try to get the symbol at the given index.
Will return an error if the given index is out of range, or if no symbol has been added for the given index.
Definition at line 120 of file MachOLinkGraphBuilder.h.
References llvm::formatv().
|
inlineprotected |
Definition at line 80 of file MachOLinkGraphBuilder.h.
References G.
Definition at line 60 of file MachOLinkGraphBuilder.cpp.
References llvm::MachO::N_WEAK_DEF, llvm::MachO::N_WEAK_REF, llvm::jitlink::Strong, and llvm::jitlink::Weak.
Referenced by findSymbolByAddress(), and isAltEntry().
|
inlineprotected |
Definition at line 82 of file MachOLinkGraphBuilder.h.
References addCustomSectionParser(), and addRelocations().
|
staticprotected |
Definition at line 66 of file MachOLinkGraphBuilder.cpp.
References llvm::jitlink::Default, llvm::jitlink::Hidden, llvm::jitlink::Local, llvm::MachO::N_EXT, llvm::MachO::N_PEXT, and llvm::StringRef::startswith().
Referenced by findSymbolByAddress(), and isAltEntry().
|
inlineprotected |
Index is zero-based (MachO section indexes are usually one-based) and assumed to be in-range.
Client is responsible for checking.
Definition at line 100 of file MachOLinkGraphBuilder.h.
|
inlineprotected |
Returns the symbol with the highest address not greater than the search address, or null if no such symbol exists.
Definition at line 132 of file MachOLinkGraphBuilder.h.
References I.
Referenced by findSymbolByAddress().
|
staticprotected |
Definition at line 76 of file MachOLinkGraphBuilder.cpp.
References llvm::MachO::section::addr, llvm::MachO::section_64::addr, llvm::Address, llvm::jitlink::MachOLinkGraphBuilder::NormalizedSection::Address, llvm::MachO::section::align, llvm::MachO::section_64::align, llvm::jitlink::MachOLinkGraphBuilder::NormalizedSection::Alignment, assert(), B, llvm::SmallVectorTemplateCommon< T >::back(), llvm::support::big, BlockSize, llvm::StringMap< ValueTy, AllocatorTy >::count(), createNormalizedSymbol(), llvm::Data, llvm::jitlink::MachOLinkGraphBuilder::NormalizedSection::Data, llvm::StringRef::data(), llvm::dbgs(), llvm::jitlink::Default, llvm::jitlink::MachOLinkGraphBuilder::NormalizedSymbol::Desc, E, llvm::SmallVectorBase::empty(), llvm::StringMap< ValueTy, AllocatorTy >::end(), llvm::StringMap< ValueTy, AllocatorTy >::find(), findSectionByIndex(), llvm::jitlink::MachOLinkGraphBuilder::NormalizedSection::Flags, llvm::MachO::section::flags, llvm::MachO::section_64::flags, llvm::formatv(), llvm::SmallVectorTemplateCommon< T >::front(), llvm::MachO::GET_COMM_ALIGN(), llvm::object::Binary::getData(), getLinkage(), getScope(), llvm::object::MachOObjectFile::getSection(), llvm::object::MachOObjectFile::getSection64(), llvm::object::MachOObjectFile::getSectionIndex(), llvm::object::MachOObjectFile::getSymbol64TableEntry(), llvm::object::MachOObjectFile::getSymbolIndex(), llvm::object::MachOObjectFile::getSymbolTableEntry(), llvm::jitlink::MachOLinkGraphBuilder::NormalizedSection::GraphSection, llvm::AArch64CC::HI, I, if(), llvm::object::MachOObjectFile::is64Bit(), llvm::object::Binary::isLittleEndian(), llvm::support::little, LLVM_DEBUG, llvm::sys::Memory::MF_EXEC, llvm::sys::Memory::MF_READ, llvm::sys::Memory::MF_WRITE, llvm::MachO::N_ABS, llvm::MachO::N_ALT_ENTRY, llvm::MachO::nlist::n_desc, llvm::MachO::nlist_64::n_desc, llvm::MachO::N_INDR, llvm::MachO::N_NO_DEAD_STRIP, llvm::MachO::N_PBUD, llvm::MachO::N_SECT, llvm::MachO::nlist::n_sect, llvm::MachO::nlist_64::n_sect, llvm::MachO::N_STAB, llvm::MachO::nlist::n_strx, llvm::MachO::nlist_64::n_strx, llvm::MachO::N_TYPE, llvm::MachO::nlist::n_type, llvm::MachO::nlist_64::n_type, llvm::MachO::N_UNDF, llvm::MachO::nlist::n_value, llvm::MachO::nlist_64::n_value, llvm::MachO::N_WEAK_REF, llvm::jitlink::MachOLinkGraphBuilder::NormalizedSymbol::Name, Name, llvm::MachO::section::offset, llvm::MachO::section_64::offset, llvm::SmallVectorTemplateBase< T >::pop_back(), llvm::SmallVectorTemplateBase< T >::push_back(), llvm::jitlink::MachOLinkGraphBuilder::NormalizedSymbol::S, llvm::MachO::S_ATTR_NO_DEAD_STRIP, llvm::MachO::S_ATTR_PURE_INSTRUCTIONS, llvm::MachO::S_GB_ZEROFILL, llvm::MachO::S_ZEROFILL, llvm::MachO::SECTION_TYPE, llvm::object::ObjectFile::sections(), Size, llvm::SmallVectorBase::size(), llvm::jitlink::MachOLinkGraphBuilder::NormalizedSection::Size, llvm::StringRef::size(), llvm::MachO::section::size, llvm::MachO::section_64::size, llvm::sort(), llvm::jitlink::Strong, llvm::Error::success(), llvm::object::ObjectFile::symbols(), llvm::jitlink::MachOLinkGraphBuilder::NormalizedSymbol::Value, and llvm::jitlink::Weak.
Referenced by findSymbolByAddress().
1.8.13