29 X86ELFObjectWriter(
bool IsELF64, uint8_t OSABI,
uint16_t EMachine);
30 ~X86ELFObjectWriter()
override =
default;
39X86ELFObjectWriter::X86ELFObjectWriter(
bool IsELF64, uint8_t OSABI,
52 switch (
unsigned(Kind)) {
94 "32 bit reloc applied to a field with a different size");
100 "64 bit reloc applied to a field with a different size");
115 return ELF::R_X86_64_NONE;
118 return IsPCRel ? ELF::R_X86_64_PC64 : ELF::R_X86_64_64;
120 return IsPCRel ? ELF::R_X86_64_PC32 : ELF::R_X86_64_32;
122 return ELF::R_X86_64_32S;
124 return IsPCRel ? ELF::R_X86_64_PC16 : ELF::R_X86_64_16;
126 return IsPCRel ? ELF::R_X86_64_PC8 : ELF::R_X86_64_8;
132 return IsPCRel ? ELF::R_X86_64_GOTPC64 : ELF::R_X86_64_GOT64;
134 return IsPCRel ? ELF::R_X86_64_GOTPC32 : ELF::R_X86_64_GOT32;
145 return ELF::R_X86_64_GOTOFF64;
150 return ELF::R_X86_64_TPOFF64;
152 return ELF::R_X86_64_TPOFF32;
164 return ELF::R_X86_64_DTPOFF64;
166 return ELF::R_X86_64_DTPOFF32;
178 return ELF::R_X86_64_SIZE64;
180 return ELF::R_X86_64_SIZE32;
189 return ELF::R_X86_64_TLSDESC_CALL;
191 return ELF::R_X86_64_GOTPC32_TLSDESC;
194 return ELF::R_X86_64_TLSGD;
197 return ELF::R_X86_64_GOTTPOFF;
200 return ELF::R_X86_64_TLSLD;
203 return ELF::R_X86_64_PLT32;
210 return ELF::R_X86_64_GOTPCREL;
211 switch (
unsigned(Kind)) {
213 return ELF::R_X86_64_GOTPCREL;
215 return ELF::R_X86_64_GOTPCRELX;
218 return ELF::R_X86_64_REX_GOTPCRELX;
223 return ELF::R_X86_64_GOTPCREL;
226 return ELF::R_X86_64_PLTOFF64;
244 return ELF::R_386_NONE;
247 return IsPCRel ? ELF::R_386_PC32 : ELF::R_386_32;
249 return IsPCRel ? ELF::R_386_PC16 : ELF::R_386_16;
251 return IsPCRel ? ELF::R_386_PC8 : ELF::R_386_8;
257 return ELF::R_386_GOTPC;
261 return ELF::R_386_GOT32;
269 return ELF::R_386_GOTOFF;
271 return ELF::R_386_TLS_DESC_CALL;
273 return ELF::R_386_TLS_GOTDESC;
277 return ELF::R_386_TLS_LE_32;
281 return ELF::R_386_TLS_LDO_32;
285 return ELF::R_386_TLS_GD;
289 return ELF::R_386_TLS_IE_32;
292 return ELF::R_386_PLT32;
296 return ELF::R_386_TLS_IE;
300 return ELF::R_386_TLS_LE;
304 return ELF::R_386_TLS_GOTIE;
308 return ELF::R_386_TLS_LDM;
314 bool IsPCRel)
const {
324 "Unsupported ELF machine type.");
347std::unique_ptr<MCObjectTargetWriter>
349 return std::make_unique<X86ELFObjectWriter>(IsELF64, OSABI, EMachine);
PowerPC TLS Dynamic Call Fixup
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
static unsigned getRelocType32(MCContext &Ctx, MCSymbolRefExpr::VariantKind Modifier, X86_32RelType Type, bool IsPCRel, MCFixupKind Kind)
static void checkIs64(MCContext &Ctx, SMLoc Loc, X86_64RelType Type)
static X86_64RelType getType64(MCFixupKind Kind, MCSymbolRefExpr::VariantKind &Modifier, bool &IsPCRel)
static void checkIs32(MCContext &Ctx, SMLoc Loc, X86_64RelType Type)
static unsigned getRelocType64(MCContext &Ctx, SMLoc Loc, MCSymbolRefExpr::VariantKind Modifier, X86_64RelType Type, bool IsPCRel, MCFixupKind Kind)
bool canRelaxRelocations() const
Context object for machine code objects.
const MCAsmInfo * getAsmInfo() const
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.
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.
@ reloc_global_offset_table8
@ reloc_signed_4byte_relax
@ reloc_branch_4byte_pcrel
@ reloc_riprel_4byte_relax
@ reloc_riprel_4byte_relax_rex
@ reloc_global_offset_table
@ reloc_riprel_4byte_movq_load
This is an optimization pass for GlobalISel generic memory operations.
MCFixupKind
Extensible enumeration to represent the type of a fixup.
@ FK_PCRel_4
A four-byte pc relative fixup.
@ FK_PCRel_2
A two-byte pc relative fixup.
@ 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_PCRel_1
A one-byte pc relative fixup.
@ FK_Data_2
A two-byte fixup.
std::unique_ptr< MCObjectTargetWriter > createX86ELFObjectWriter(bool IsELF64, uint8_t OSABI, uint16_t EMachine)
Construct an X86 ELF object writer.