LLVM API Documentation
An ObjectFile-backed symbolizer. More...
#include <MCObjectSymbolizer.h>
Public Member Functions | |
virtual StringRef | findExternalFunctionAt (uint64_t Addr) |
Look for an external function symbol at Addr . (References through the ELF PLT, Mach-O stubs, and similar). More... | |
Overridden MCSymbolizer methods: | |
bool | tryAddingSymbolicOperand (MCInst &MI, raw_ostream &cStream, int64_t Value, uint64_t Address, bool IsBranch, uint64_t Offset, uint64_t InstSize) |
Try to add a symbolic operand instead of Value to the MCInst. More... | |
void | tryAddingPcLoadReferenceComment (raw_ostream &cStream, int64_t Value, uint64_t Address) |
Try to add a comment on the PC-relative load. For instance, in Mach-O, this is used to add annotations to instructions that use C string literals, as found in __cstring. More... | |
![]() | |
MCSymbolizer (MCContext &Ctx, OwningPtr< MCRelocationInfo > &RelInfo) | |
Construct an MCSymbolizer, taking ownership of RelInfo . More... | |
virtual | ~MCSymbolizer () |
Static Public Member Functions | |
static MCObjectSymbolizer * | createObjectSymbolizer (MCContext &Ctx, OwningPtr< MCRelocationInfo > &RelInfo, const object::ObjectFile *Obj) |
Create an object symbolizer for Obj . More... | |
Protected Member Functions | |
const object::RelocationRef * | findRelocationAt (uint64_t Addr) |
const object::SectionRef * | findSectionContaining (uint64_t Addr) |
MCObjectSymbolizer (MCContext &Ctx, OwningPtr< MCRelocationInfo > &RelInfo, const object::ObjectFile *Obj) | |
Protected Attributes | |
const object::ObjectFile * | Obj |
![]() | |
MCContext & | Ctx |
OwningPtr< MCRelocationInfo > | RelInfo |
An ObjectFile-backed symbolizer.
Definition at line 31 of file MCObjectSymbolizer.h.
|
protected |
Definition at line 128 of file MCObjectSymbolizer.cpp.
Referenced by createObjectSymbolizer().
|
static |
Create an object symbolizer for Obj
.
Definition at line 199 of file MCObjectSymbolizer.cpp.
References MCObjectSymbolizer().
|
virtual |
Look for an external function symbol at Addr
. (References through the ELF PLT, Mach-O stubs, and similar).
Definition at line 194 of file MCObjectSymbolizer.cpp.
Referenced by llvm::MCObjectDisassembler::createFunction(), and tryAddingSymbolicOperand().
|
protected |
Definition at line 231 of file MCObjectSymbolizer.cpp.
References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::empty(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::end(), and llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::find().
Referenced by tryAddingSymbolicOperand().
|
protected |
Definition at line 214 of file MCObjectSymbolizer.cpp.
References SectionStartsBefore().
|
virtual |
Try to add a comment on the PC-relative load. For instance, in Mach-O, this is used to add annotations to instructions that use C string literals, as found in __cstring.
Implements llvm::MCSymbolizer.
Definition at line 190 of file MCObjectSymbolizer.cpp.
|
virtual |
Try to add a symbolic operand instead of Value
to the MCInst.
Instead of having a difficult to read immediate, a symbolic operand would represent this immediate in a more understandable way, for instance as a symbol or an offset from a symbol. Relocations can also be used to enrich the symbolic expression.
Inst | - The MCInst where to insert the symbolic operand. |
cStream | - Stream to print comments and annotations on. |
Value | - Operand value, pc-adjusted by the caller if necessary. |
Address | - Load address of the instruction. |
IsBranch | - Is the instruction a branch? |
Offset | - Byte offset of the operand inside the inst. |
InstSize | - Size of the instruction in bytes. |
Implements llvm::MCSymbolizer.
Definition at line 135 of file MCObjectSymbolizer.cpp.
References llvm::MCInst::addOperand(), llvm::object::ObjectFile::begin_symbols(), llvm::MCConstantExpr::Create(), llvm::MCSymbolRefExpr::Create(), llvm::MCBinaryExpr::CreateAdd(), llvm::MCOperand::CreateExpr(), llvm::MCRelocationInfo::createExprForRelocation(), llvm::StringRef::empty(), llvm::object::ObjectFile::end_symbols(), findExternalFunctionAt(), findRelocationAt(), llvm::MCContext::GetOrCreateSymbol(), llvm::object::content_iterator< content_type >::increment(), Obj, llvm::object::SymbolRef::ST_Function, and llvm::object::UnknownAddressOrSize.
|
protected |
Definition at line 33 of file MCObjectSymbolizer.h.
Referenced by tryAddingSymbolicOperand().