25 SparcELFObjectWriter(
bool Is64Bit,
bool IsV8Plus, uint8_t OSABI)
26 : MCELFObjectTargetWriter(
32 ~SparcELFObjectWriter()
override =
default;
35 unsigned getRelocType(
const MCFixup &
Fixup,
const MCValue &Target,
36 bool IsPCRel)
const override;
38 bool needsRelocateWithSymbol(
const MCValue &,
unsigned Type)
const override;
42unsigned SparcELFObjectWriter::getRelocType(
const MCFixup &
Fixup,
46 auto Spec =
Target.getSpecifier();
48 case ELF::R_SPARC_TLS_GD_HI22:
49 case ELF::R_SPARC_TLS_GD_LO10:
50 case ELF::R_SPARC_TLS_GD_ADD:
51 case ELF::R_SPARC_TLS_LDM_HI22:
52 case ELF::R_SPARC_TLS_LDM_LO10:
53 case ELF::R_SPARC_TLS_LDM_ADD:
54 case ELF::R_SPARC_TLS_LDO_HIX22:
55 case ELF::R_SPARC_TLS_LDO_LOX10:
56 case ELF::R_SPARC_TLS_LDO_ADD:
57 case ELF::R_SPARC_TLS_IE_HI22:
58 case ELF::R_SPARC_TLS_IE_LO10:
59 case ELF::R_SPARC_TLS_IE_LD:
60 case ELF::R_SPARC_TLS_IE_LDX:
61 case ELF::R_SPARC_TLS_IE_ADD:
62 case ELF::R_SPARC_TLS_LE_HIX22:
63 case ELF::R_SPARC_TLS_LE_LOX10:
67 case ELF::R_SPARC_DISP32:
69 return ELF::R_SPARC_DISP32;
71 " can only be used in a .word directive");
72 return ELF::R_SPARC_NONE;
86 case FK_Data_1:
return ELF::R_SPARC_DISP8;
87 case FK_Data_2:
return ELF::R_SPARC_DISP16;
88 case FK_Data_4:
return ELF::R_SPARC_DISP32;
89 case FK_Data_8:
return ELF::R_SPARC_DISP64;
91 if (
getContext().getObjectFileInfo()->isPositionIndependent())
92 return ELF::R_SPARC_WPLT30;
93 return ELF::R_SPARC_WDISP30;
98 switch(
Fixup.getKind()) {
101 case FK_NONE:
return ELF::R_SPARC_NONE;
113 if (
getContext().getObjectFileInfo()->isPositionIndependent())
114 return ELF::R_SPARC_GOT13;
115 return ELF::R_SPARC_13;
119 return ELF::R_SPARC_NONE;
122bool SparcELFObjectWriter::needsRelocateWithSymbol(
const MCValue &,
123 unsigned Type)
const {
132 case ELF::R_SPARC_GOT10:
133 case ELF::R_SPARC_GOT13:
134 case ELF::R_SPARC_GOT22:
135 case ELF::R_SPARC_GOTDATA_HIX22:
136 case ELF::R_SPARC_GOTDATA_LOX10:
137 case ELF::R_SPARC_GOTDATA_OP_HIX22:
138 case ELF::R_SPARC_GOTDATA_OP_LOX10:
143std::unique_ptr<MCObjectTargetWriter>
145 return std::make_unique<SparcELFObjectWriter>(Is64Bit, IsV8Plus, OSABI);
static Error reportError(StringRef Message)
PowerPC TLS Dynamic Call Fixup
Func getContext().diagnose(DiagnosticInfoUnsupported(Func
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...
Target - Wrapper for Target specific information.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
@ fixup_sparc_13
fixup_sparc_13 - 13-bit fixup
StringRef getSpecifierName(uint16_t S)
bool isRelocation(MCFixupKind FixupKind)
This is an optimization pass for GlobalISel generic memory operations.
std::unique_ptr< MCObjectTargetWriter > createSparcELFObjectWriter(bool Is64Bit, bool IsV8Plus, uint8_t OSABI)
@ 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.