|
LLVM
10.0.0
|
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction) which requires assemble- or run- time patching. More...
#include "llvm/MC/MCFixup.h"
Public Member Functions | |
| MCFixupKind | getKind () const |
| unsigned | getTargetKind () const |
| uint32_t | getOffset () const |
| void | setOffset (uint32_t Value) |
| const MCExpr * | getValue () const |
| SMLoc | getLoc () const |
Static Public Member Functions | |
| static MCFixup | create (uint32_t Offset, const MCExpr *Value, MCFixupKind Kind, SMLoc Loc=SMLoc()) |
| static MCFixup | createAddFor (const MCFixup &Fixup) |
| Return a fixup corresponding to the add half of a add/sub fixup pair for the given Fixup. More... | |
| static MCFixup | createSubFor (const MCFixup &Fixup) |
| Return a fixup corresponding to the sub half of a add/sub fixup pair for the given Fixup. More... | |
| static MCFixupKind | getKindForSize (unsigned Size, bool IsPCRel) |
| Return the generic fixup kind for a value with the given size. More... | |
| static MCFixupKind | getKindForSizeInBits (unsigned Size, bool IsPCRel) |
| Return the generic fixup kind for a value with the given size in bits. More... | |
| static MCFixupKind | getAddKindForKind (MCFixupKind Kind) |
| Return the generic fixup kind for an addition with a given size. More... | |
| static MCFixupKind | getSubKindForKind (MCFixupKind Kind) |
| Return the generic fixup kind for an subtraction with a given size. More... | |
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction) which requires assemble- or run- time patching.
Fixups are used any time the target instruction encoder needs to represent some value in an instruction which is not yet concrete. The encoder will encode the instruction assuming the value is 0, and emit a fixup which communicates to the assembler backend how it should rewrite the encoded value.
During the process of relaxation, the assembler will apply fixups as symbolic values become concrete. When relaxation is complete, any remaining fixups become relocations in the object file (or errors, if the fixup cannot be encoded on the target).
|
inlinestatic |
Definition at line 93 of file MCFixup.h.
References assert(), and llvm::MaxTargetFixupKind.
Referenced by llvm::adjustPqBits(), llvm::createBPFbeMCCodeEmitter(), llvm::createR600MCCodeEmitter(), llvm::createRISCVMCCodeEmitter(), llvm::MCWinCOFFStreamer::EmitCOFFImgRel32(), llvm::MCWinCOFFStreamer::EmitCOFFSecRel32(), llvm::MCWinCOFFStreamer::EmitCOFFSectionIndex(), llvm::MCObjectStreamer::EmitDTPRel32Value(), llvm::MCObjectStreamer::EmitDTPRel64Value(), llvm::MCObjectStreamer::EmitGPRel32Value(), llvm::MCObjectStreamer::EmitGPRel64Value(), llvm::MCObjectStreamer::EmitRelocDirective(), llvm::MCObjectStreamer::EmitTPRel32Value(), llvm::MCObjectStreamer::EmitTPRel64Value(), llvm::MCObjectStreamer::EmitValueImpl(), llvm::CodeViewContext::encodeDefRange(), llvm::MSP430MCCodeEmitter::encodeInstruction(), llvm::FixupKind(), llvm::PPCMCCodeEmitter::getAbsCondBrEncoding(), llvm::PPCMCCodeEmitter::getAbsDirectBrEncoding(), GetAEABIUnwindPersonalityName(), llvm::MipsMCCodeEmitter::getBranchTarget21OpValue(), llvm::MipsMCCodeEmitter::getBranchTarget21OpValueMM(), llvm::MipsMCCodeEmitter::getBranchTarget26OpValue(), llvm::MipsMCCodeEmitter::getBranchTarget26OpValueMM(), llvm::MipsMCCodeEmitter::getBranchTarget7OpValueMM(), llvm::MipsMCCodeEmitter::getBranchTargetOpValue(), getBranchTargetOpValue(), llvm::MipsMCCodeEmitter::getBranchTargetOpValue1SImm16(), llvm::MipsMCCodeEmitter::getBranchTargetOpValueLsl2MMR6(), llvm::MipsMCCodeEmitter::getBranchTargetOpValueMM(), llvm::MipsMCCodeEmitter::getBranchTargetOpValueMMPC10(), llvm::MipsMCCodeEmitter::getBranchTargetOpValueMMR6(), llvm::PPCMCCodeEmitter::getCondBrEncoding(), llvm::PPCMCCodeEmitter::getDirectBrEncoding(), llvm::MipsMCCodeEmitter::getExprOpValue(), llvm::PPCMCCodeEmitter::getImm16Encoding(), llvm::MipsMCCodeEmitter::getJumpOffset16OpValue(), llvm::MipsMCCodeEmitter::getJumpTargetOpValue(), llvm::MipsMCCodeEmitter::getJumpTargetOpValueMM(), getLit64Encoding(), llvm::PPCMCCodeEmitter::getMemRIEncoding(), llvm::PPCMCCodeEmitter::getMemRIX16Encoding(), llvm::PPCMCCodeEmitter::getMemRIXEncoding(), llvm::MipsMCCodeEmitter::getSimm18Lsl3Encoding(), llvm::MipsMCCodeEmitter::getSimm19Lsl2Encoding(), llvm::PPCMCCodeEmitter::getTLSCallEncoding(), llvm::PPCMCCodeEmitter::getTLSRegEncoding(), HasConditionalBranch(), isPCRel(), isPCRel32Branch(), needPadding(), needsPCRel(), and llvm::RISCVAsmBackend::shouldInsertFixupForCodeAlign().
Return a fixup corresponding to the add half of a add/sub fixup pair for the given Fixup.
Definition at line 106 of file MCFixup.h.
References getAddKindForKind(), getKind(), getLoc(), getOffset(), and getValue().
Return a fixup corresponding to the sub half of a add/sub fixup pair for the given Fixup.
Definition at line 117 of file MCFixup.h.
References getKind(), getLoc(), getOffset(), getSubKindForKind(), and getValue().
|
inlinestatic |
Return the generic fixup kind for an addition with a given size.
It is an error to pass an unsupported size.
Definition at line 173 of file MCFixup.h.
References llvm::FK_Data_1, llvm::FK_Data_2, llvm::FK_Data_4, llvm::FK_Data_6b, llvm::FK_Data_8, llvm::FK_Data_Add_1, llvm::FK_Data_Add_2, llvm::FK_Data_Add_4, llvm::FK_Data_Add_6b, llvm::FK_Data_Add_8, and llvm_unreachable.
Referenced by createAddFor().
|
inline |
Definition at line 126 of file MCFixup.h.
Referenced by llvm::AVRAsmBackend::adjustFixupValue(), llvm::ARMAsmBackend::adjustFixupValue(), adjustFixupValue(), llvm::AVRAsmBackend::applyFixup(), llvm::MipsAsmBackend::applyFixup(), llvm::ARMAsmBackend::applyFixup(), llvm::RISCVAsmBackend::applyFixup(), canReuseBoundaryAlignFragment(), canUseLocalRelocation(), createAddFor(), createSubFor(), llvm::PPCMCExpr::evaluateAsRelocatableImpl(), extractBitsForFixup(), llvm::MCAssembler::Finish(), getARMFixupKindMachOInfo(), llvm::MCAssembler::getAtom(), getFixupKindLog2Size(), getFixupKindNumBytes(), getFixupKindSize(), getFixupOffset(), getFixupSection(), getPLTReloc(), llvm::AVRELFObjectWriter::getRelocType(), getRelocType32(), isIFunc(), llvm::operator<<(), PrintCFIEscape(), llvm::ARMAsmBackend::shouldForceRelocation(), llvm::AVRAsmBackend::shouldForceRelocation(), and llvm::MipsAsmBackend::shouldForceRelocation().
|
inlinestatic |
Return the generic fixup kind for a value with the given size.
It is an error to pass an unsupported size.
Definition at line 137 of file MCFixup.h.
References llvm::FK_Data_1, llvm::FK_Data_2, llvm::FK_Data_4, llvm::FK_Data_8, llvm::FK_PCRel_1, llvm::FK_PCRel_2, llvm::FK_PCRel_4, llvm::FK_PCRel_8, and llvm_unreachable.
Referenced by llvm::MCObjectStreamer::EmitValueImpl(), GetAEABIUnwindPersonalityName(), getImmFixupKind(), and needPadding().
|
inlinestatic |
Return the generic fixup kind for a value with the given size in bits.
It is an error to pass an unsupported size.
Definition at line 153 of file MCFixup.h.
References assert(), llvm::FK_Data_1, llvm::FK_Data_2, llvm::FK_Data_4, llvm::FK_Data_6b, llvm::FK_Data_8, llvm::FK_PCRel_1, llvm::FK_PCRel_2, llvm::FK_PCRel_4, llvm::FK_PCRel_8, and llvm_unreachable.
Referenced by needPadding().
|
inline |
Definition at line 197 of file MCFixup.h.
Referenced by llvm::ARMAsmBackend::adjustFixupValue(), adjustFixupValue(), canUseLocalRelocation(), createAddFor(), createSubFor(), dumpRelocs(), llvm::RISCVAsmBackend::evaluateTargetFixup(), getARMFixupKindMachOInfo(), llvm::MCAssembler::getAtom(), getFixupKindLog2Size(), getFixupKindSize(), getFixupOffset(), getRelocType32(), isIFunc(), isNonILP32reloc(), llvm::MachObjectWriter::recordRelocation(), adjust::signed_width(), and adjust::unsigned_width().
|
inline |
Definition at line 130 of file MCFixup.h.
Referenced by adjustFixupValue(), llvm::AVRAsmBackend::applyFixup(), llvm::MipsAsmBackend::applyFixup(), llvm::ARMAsmBackend::applyFixup(), llvm::RISCVAsmBackend::applyFixup(), canUseLocalRelocation(), createAddFor(), createSubFor(), llvm::RISCVAsmBackend::evaluateTargetFixup(), extractBitsForFixup(), getARMFixupKindMachOInfo(), llvm::MCAssembler::getAtom(), getFixupKindLog2Size(), getFixupKindNumBytes(), getFixupKindSize(), getFixupOffset(), isIFunc(), llvm::operator<<(), and PrintCFIEscape().
|
inlinestatic |
Return the generic fixup kind for an subtraction with a given size.
It is an error to pass an unsupported size.
Definition at line 186 of file MCFixup.h.
References llvm::FK_Data_1, llvm::FK_Data_2, llvm::FK_Data_4, llvm::FK_Data_6b, llvm::FK_Data_8, llvm::FK_Data_Sub_1, llvm::FK_Data_Sub_2, llvm::FK_Data_Sub_4, llvm::FK_Data_Sub_6b, llvm::FK_Data_Sub_8, and llvm_unreachable.
Referenced by createSubFor().
|
inline |
Definition at line 128 of file MCFixup.h.
Referenced by adjustFixupValue(), dumpRelocs(), llvm::RISCVAsmBackend::evaluateTargetFixup(), llvm::RISCVAsmBackend::fixupNeedsRelaxationAdvanced(), getAccessVariant(), getARMFixupKindMachOInfo(), getFixupKindLog2Size(), getFixupOffset(), isNonILP32reloc(), llvm::ARMAsmBackend::reasonForFixupRelaxation(), and llvm::RISCVAsmBackend::shouldForceRelocation().
Definition at line 133 of file MCFixup.h.
Referenced by llvm::ARMAsmBackend::adjustFixupValue(), createAddFor(), createSubFor(), llvm::RISCVAsmBackend::evaluateTargetFixup(), getAccessVariant(), llvm::MCAssembler::getAtom(), getFixupSection(), llvm::operator<<(), and PrintCFIEscape().
1.8.13