28 SystemZObjectWriter(uint8_t OSABI);
29 ~SystemZObjectWriter()
override =
default;
39SystemZObjectWriter::SystemZObjectWriter(uint8_t OSABI)
65 Ctx.
reportError(Loc,
"Unsupported absolute address");
75 return ELF::R_390_PC16;
79 return ELF::R_390_PC32;
81 return ELF::R_390_PC64;
83 return ELF::R_390_PC12DBL;
85 return ELF::R_390_PC16DBL;
87 return ELF::R_390_PC24DBL;
89 return ELF::R_390_PC32DBL;
91 Ctx.
reportError(Loc,
"Unsupported PC-relative address");
98 case FK_Data_4:
return ELF::R_390_TLS_LE32;
99 case FK_Data_8:
return ELF::R_390_TLS_LE64;
101 Ctx.
reportError(Loc,
"Unsupported thread-local address (local-exec)");
108 case FK_Data_4:
return ELF::R_390_TLS_LDO32;
109 case FK_Data_8:
return ELF::R_390_TLS_LDO64;
111 Ctx.
reportError(Loc,
"Unsupported thread-local address (local-dynamic)");
118 case FK_Data_4:
return ELF::R_390_TLS_LDM32;
119 case FK_Data_8:
return ELF::R_390_TLS_LDM64;
122 Ctx.
reportError(Loc,
"Unsupported thread-local address (local-dynamic)");
129 case FK_Data_4:
return ELF::R_390_TLS_GD32;
130 case FK_Data_8:
return ELF::R_390_TLS_GD64;
133 Ctx.
reportError(Loc,
"Unsupported thread-local address (general-dynamic)");
145 Ctx.
reportError(Loc,
"Unsupported PC-relative PLT address");
149unsigned SystemZObjectWriter::getRelocType(
MCContext &Ctx,
152 bool IsPCRel)
const {
165 assert(!IsPCRel &&
"NTPOFF shouldn't be PC-relative");
170 return ELF::R_390_TLS_IEENT;
171 Ctx.
reportError(Loc,
"Only PC-relative INDNTPOFF accesses are supported for now");
175 assert(!IsPCRel &&
"DTPOFF shouldn't be PC-relative");
179 assert(!IsPCRel &&
"TLSLDM shouldn't be PC-relative");
183 assert(!IsPCRel &&
"TLSGD shouldn't be PC-relative");
188 return ELF::R_390_GOTENT;
189 Ctx.
reportError(Loc,
"Only PC-relative GOT accesses are supported for now");
193 assert(IsPCRel &&
"@PLT shouldn't be PC-relative");
201std::unique_ptr<MCObjectTargetWriter>
203 return std::make_unique<SystemZObjectWriter>(OSABI);
PowerPC TLS Dynamic Call Fixup
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
static unsigned getPLTReloc(MCContext &Ctx, SMLoc Loc, unsigned Kind)
static unsigned getTLSGDReloc(MCContext &Ctx, SMLoc Loc, unsigned Kind)
static unsigned getPCRelReloc(MCContext &Ctx, SMLoc Loc, unsigned Kind)
static unsigned getTLSLDOReloc(MCContext &Ctx, SMLoc Loc, unsigned Kind)
static unsigned getTLSLDMReloc(MCContext &Ctx, SMLoc Loc, unsigned Kind)
static unsigned getAbsoluteReloc(MCContext &Ctx, SMLoc Loc, unsigned Kind)
static unsigned getTLSLEReloc(MCContext &Ctx, SMLoc Loc, unsigned Kind)
Context object for machine code objects.
void reportError(SMLoc L, const Twine &Msg)
virtual unsigned getRelocType(MCContext &Ctx, const MCValue &Target, const MCFixup &Fixup, bool IsPCRel) const =0
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...
This represents an "assembler immediate".
Represents a location in source code.
Target - Wrapper for Target specific information.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
This is an optimization pass for GlobalISel generic memory operations.
std::unique_ptr< MCObjectTargetWriter > createSystemZObjectWriter(uint8_t OSABI)
@ FirstLiteralRelocationKind
The range [FirstLiteralRelocationKind, MaxTargetFixupKind) is used for relocations coming from ....
@ 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.