20 using namespace object;
29 uint64_t RelType = Rel.
getType();
33 if (std::error_code EC = SymNameOrErr.
getError())
38 if (std::error_code EC = SymAddr.
getError())
40 uint64_t SymSize = SymI->
getSize();
43 MCSymbol *Sym = Ctx.getOrCreateSymbol(SymName);
48 const MCExpr *Expr =
nullptr;
50 bool hasAddend =
false;
89 case R_X86_64_GOTPC32:
90 case R_X86_64_GOTPC64:
91 case R_X86_64_GOTPLT64:
101 case R_X86_64_GLOB_DAT:
102 case R_X86_64_JUMP_SLOT:
106 case R_X86_64_GOTPCREL:
107 case R_X86_64_GOTPCREL64:
112 case R_X86_64_GOTOFF64:
116 case R_X86_64_PLTOFF64:
119 case R_X86_64_SIZE32:
120 case R_X86_64_SIZE64:
128 if (Expr && hasAddend && Addend != 0)
140 return new X86_64ELFRelocationInfo(Ctx);
std::error_code getError() const
Represents either an error or a value T.
static const MCSymbolRefExpr * create(const MCSymbol *Symbol, MCContext &Ctx)
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
LLVM_ATTRIBUTE_NORETURN void report_fatal_error(const char *reason, bool gen_crash_diag=true)
Reports a serious error, calling any installed error handler.
Base class for the full range of assembler expressions which are needed for parsing.
This is a value type class that represents a single relocation in the list of relocations in the obje...
Context object for machine code objects.
MCRelocationInfo * createX86_64ELFRelocationInfo(MCContext &Ctx)
Construct X86-64 ELF relocation info.
static const MCBinaryExpr * createAdd(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
symbol_iterator getSymbol() const
Create MCExprs from relocations found in an object file.
ErrorOr< int64_t > getAddend() const
void setVariableValue(const MCExpr *Value)
ErrorOr< StringRef > getName() const
bool isVariable() const
isVariable - Check if this is a variable symbol.
StringRef - Represent a constant reference to a string, i.e.
ErrorOr< uint64_t > getAddress() const
Returns the symbol virtual address (i.e.
static const MCConstantExpr * create(int64_t Value, MCContext &Ctx)