24 SparcELFObjectWriter(
bool Is64Bit,
bool IsV8Plus,
uint8_t OSABI)
31 ~SparcELFObjectWriter()
override =
default;
35 bool IsPCRel)
const override;
41unsigned SparcELFObjectWriter::getRelocType(
const MCFixup &
Fixup,
44 switch (
Target.getSpecifier()) {
45 case ELF::R_SPARC_TLS_GD_HI22:
46 case ELF::R_SPARC_TLS_GD_LO10:
47 case ELF::R_SPARC_TLS_GD_ADD:
48 case ELF::R_SPARC_TLS_LDM_HI22:
49 case ELF::R_SPARC_TLS_LDM_LO10:
50 case ELF::R_SPARC_TLS_LDM_ADD:
51 case ELF::R_SPARC_TLS_LDO_HIX22:
52 case ELF::R_SPARC_TLS_LDO_LOX10:
53 case ELF::R_SPARC_TLS_LDO_ADD:
54 case ELF::R_SPARC_TLS_IE_HI22:
55 case ELF::R_SPARC_TLS_IE_LO10:
56 case ELF::R_SPARC_TLS_IE_LD:
57 case ELF::R_SPARC_TLS_IE_LDX:
58 case ELF::R_SPARC_TLS_IE_ADD:
59 case ELF::R_SPARC_TLS_LE_HIX22:
60 case ELF::R_SPARC_TLS_LE_LOX10:
74 if (
const auto *SExpr = dyn_cast<MCSpecifierExpr>(
Fixup.getValue())) {
75 if (SExpr->getSpecifier() == ELF::R_SPARC_DISP32)
76 return ELF::R_SPARC_DISP32;
83 case FK_Data_1:
return ELF::R_SPARC_DISP8;
84 case FK_Data_2:
return ELF::R_SPARC_DISP16;
85 case FK_Data_4:
return ELF::R_SPARC_DISP32;
86 case FK_Data_8:
return ELF::R_SPARC_DISP64;
88 if (getContext().getObjectFileInfo()->isPositionIndependent())
89 return ELF::R_SPARC_WPLT30;
90 return ELF::R_SPARC_WDISP30;
95 switch(
Fixup.getKind()) {
98 case FK_NONE:
return ELF::R_SPARC_NONE;
110 if (getContext().getObjectFileInfo()->isPositionIndependent())
111 return ELF::R_SPARC_GOT13;
112 return ELF::R_SPARC_13;
116 return ELF::R_SPARC_NONE;
119bool SparcELFObjectWriter::needsRelocateWithSymbol(
const MCValue &,
120 unsigned Type)
const {
129 case ELF::R_SPARC_GOT10:
130 case ELF::R_SPARC_GOT13:
131 case ELF::R_SPARC_GOT22:
132 case ELF::R_SPARC_GOTDATA_HIX22:
133 case ELF::R_SPARC_GOTDATA_LOX10:
134 case ELF::R_SPARC_GOTDATA_OP_HIX22:
135 case ELF::R_SPARC_GOTDATA_OP_LOX10:
140std::unique_ptr<MCObjectTargetWriter>
142 return std::make_unique<SparcELFObjectWriter>(Is64Bit, IsV8Plus, OSABI);
PowerPC TLS Dynamic Call Fixup
virtual unsigned getRelocType(const MCFixup &Fixup, const MCValue &Target, bool IsPCRel) const =0
virtual bool needsRelocateWithSymbol(const MCValue &, unsigned Type) const
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Target - Wrapper for Target specific information.
The instances of the Type class are immutable: once they are created, they are never changed.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
@ fixup_sparc_13
fixup_sparc_13 - 13-bit fixup
bool isRelocation(MCFixupKind FixupKind)
This is an optimization pass for GlobalISel generic memory operations.
@ FK_Data_8
A eight-byte fixup.
@ FK_Data_1
A one-byte fixup.
@ FK_Data_4
A four-byte fixup.
@ FK_Data_2
A two-byte fixup.
std::unique_ptr< MCObjectTargetWriter > createSparcELFObjectWriter(bool Is64Bit, bool IsV8Plus, uint8_t OSABI)