30 SystemZELFObjectWriter(uint8_t OSABI);
31 ~SystemZELFObjectWriter()
override =
default;
35 unsigned getRelocType(
const MCFixup &,
const MCValue &,
36 bool IsPCRel)
const override;
37 bool needsRelocateWithSymbol(
const MCValue &,
unsigned Type)
const override;
38 unsigned getAbsoluteReloc(SMLoc Loc,
unsigned Kind)
const;
39 unsigned getPCRelReloc(SMLoc Loc,
unsigned Kind)
const;
44SystemZELFObjectWriter::SystemZELFObjectWriter(
uint8_t OSABI)
49unsigned SystemZELFObjectWriter::getAbsoluteReloc(
SMLoc Loc,
50 unsigned Kind)
const {
76unsigned SystemZELFObjectWriter::getPCRelReloc(SMLoc Loc,
unsigned Kind)
const {
81 return ELF::R_390_PC16;
85 return ELF::R_390_PC32;
87 return ELF::R_390_PC64;
89 return ELF::R_390_PC12DBL;
91 return ELF::R_390_PC16DBL;
93 return ELF::R_390_PC24DBL;
95 return ELF::R_390_PC32DBL;
97 reportError(Loc,
"Unsupported PC-relative address");
101unsigned SystemZELFObjectWriter::getRelocType(
const MCFixup &
Fixup,
102 const MCValue &Target,
103 bool IsPCRel)
const {
104 SMLoc Loc =
Fixup.getLoc();
124 return getPCRelReloc(Loc, Kind);
125 return getAbsoluteReloc(Loc, Kind);
128 assert(!IsPCRel &&
"NTPOFF shouldn't be PC-relative");
131 return ELF::R_390_TLS_LE32;
133 return ELF::R_390_TLS_LE64;
135 reportError(Loc,
"Unsupported thread-local address (local-exec)");
140 return ELF::R_390_TLS_IEENT;
142 "Only PC-relative INDNTPOFF accesses are supported for now");
146 assert(!IsPCRel &&
"DTPOFF shouldn't be PC-relative");
149 return ELF::R_390_TLS_LDO32;
151 return ELF::R_390_TLS_LDO64;
153 reportError(Loc,
"Unsupported thread-local address (local-dynamic)");
157 assert(!IsPCRel &&
"TLSLDM shouldn't be PC-relative");
160 return ELF::R_390_TLS_LDM32;
162 return ELF::R_390_TLS_LDM64;
164 return ELF::R_390_TLS_LDCALL;
166 reportError(Loc,
"Unsupported thread-local address (local-dynamic)");
170 assert(!IsPCRel &&
"TLSGD shouldn't be PC-relative");
173 return ELF::R_390_TLS_GD32;
175 return ELF::R_390_TLS_GD64;
177 return ELF::R_390_TLS_GDCALL;
179 reportError(Loc,
"Unsupported thread-local address (general-dynamic)");
185 return ELF::R_390_GOTENT;
186 reportError(Loc,
"Only PC-relative GOT accesses are supported for now");
190 assert(IsPCRel &&
"@PLT shouldn't be PC-relative");
193 return ELF::R_390_PLT12DBL;
195 return ELF::R_390_PLT16DBL;
197 return ELF::R_390_PLT24DBL;
199 return ELF::R_390_PLT32DBL;
201 reportError(Loc,
"Unsupported PC-relative PLT address");
209bool SystemZELFObjectWriter::needsRelocateWithSymbol(
const MCValue &V,
210 unsigned Type)
const {
211 switch (
V.getSpecifier()) {
220std::unique_ptr<MCObjectTargetWriter>
222 return std::make_unique<SystemZELFObjectWriter>(OSABI);
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static Error reportError(StringRef Message)
PowerPC TLS Dynamic Call Fixup
Represents a location in source code.
#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.
@ 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 > createSystemZELFObjectWriter(uint8_t OSABI)