30 X86ELFObjectWriter(
bool IsELF64, uint8_t OSABI, uint16_t EMachine);
31 ~X86ELFObjectWriter()
override =
default;
35 const MCFixup &Fixup,
bool IsPCRel)
const override;
40 X86ELFObjectWriter::X86ELFObjectWriter(
bool IsELF64, uint8_t OSABI,
45 (EMachine != ELF::
EM_386) &&
93 "32 bit reloc applied to a field with a different size");
107 return IsPCRel ? ELF::R_X86_64_PC64 : ELF::R_X86_64_64;
109 return IsPCRel ? ELF::R_X86_64_PC32 : ELF::R_X86_64_32;
111 return ELF::R_X86_64_32S;
113 return IsPCRel ? ELF::R_X86_64_PC16 : ELF::R_X86_64_16;
115 return IsPCRel ? ELF::R_X86_64_PC8 : ELF::R_X86_64_8;
120 return IsPCRel ? ELF::R_X86_64_GOTPC64 : ELF::R_X86_64_GOT64;
122 return IsPCRel ? ELF::R_X86_64_GOTPC32 : ELF::R_X86_64_GOT32;
131 return ELF::R_X86_64_GOTOFF64;
136 return ELF::R_X86_64_TPOFF64;
138 return ELF::R_X86_64_TPOFF32;
148 return ELF::R_X86_64_DTPOFF64;
150 return ELF::R_X86_64_DTPOFF32;
160 return ELF::R_X86_64_SIZE64;
162 return ELF::R_X86_64_SIZE32;
169 return ELF::R_X86_64_TLSDESC_CALL;
171 return ELF::R_X86_64_GOTPC32_TLSDESC;
174 return ELF::R_X86_64_TLSGD;
177 return ELF::R_X86_64_GOTTPOFF;
180 return ELF::R_X86_64_TLSLD;
183 return ELF::R_X86_64_PLT32;
190 return ELF::R_X86_64_GOTPCREL;
193 return ELF::R_X86_64_GOTPCREL;
195 return ELF::R_X86_64_GOTPCRELX;
198 return ELF::R_X86_64_REX_GOTPCRELX;
231 return IsPCRel ? ELF::R_386_PC32 : ELF::R_386_32;
233 return IsPCRel ? ELF::R_386_PC16 : ELF::R_386_16;
235 return IsPCRel ? ELF::R_386_PC8 : ELF::R_386_8;
240 return ELF::R_386_GOTPC;
244 return ELF::R_386_GOT32;
251 return ELF::R_386_GOTOFF;
255 return ELF::R_386_TLS_LE_32;
259 return ELF::R_386_TLS_LDO_32;
263 return ELF::R_386_TLS_GD;
267 return ELF::R_386_TLS_IE_32;
270 return ELF::R_386_PLT32;
274 return ELF::R_386_TLS_IE;
278 return ELF::R_386_TLS_LE;
282 return ELF::R_386_TLS_GOTIE;
286 return ELF::R_386_TLS_LDM;
292 bool IsPCRel)
const {
300 "Unsupported ELF machine type.");
304 std::unique_ptr<MCObjectTargetWriter>
306 return llvm::make_unique<X86ELFObjectWriter>(IsELF64, OSABI, EMachine);
const MCAsmInfo * getAsmInfo() const
This class represents lattice values for constants.
This represents an "assembler immediate".
MCSymbolRefExpr::VariantKind getAccessVariant() const
bool canRelaxRelocations() const
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...
A one-byte pc relative fixup.
static void checkIs32(MCContext &Ctx, SMLoc Loc, X86_64RelType Type)
static unsigned getRelocType(const MCValue &Target, const MCFixupKind FixupKind, const bool IsPCRel)
Translates generic PPC fixup kind to Mach-O/PPC relocation type enum.
static unsigned getRelocType32(MCContext &Ctx, MCSymbolRefExpr::VariantKind Modifier, X86_32RelType Type, bool IsPCRel, unsigned Kind)
Context object for machine code objects.
static X86_64RelType getType64(unsigned Kind, MCSymbolRefExpr::VariantKind &Modifier, bool &IsPCRel)
std::unique_ptr< MCObjectTargetWriter > createX86ELFObjectWriter(bool IsELF64, uint8_t OSABI, uint16_t EMachine)
Construct an X86 ELF object writer.
The instances of the Type class are immutable: once they are created, they are never changed...
static X86_32RelType getType32(X86_64RelType T)
void reportError(SMLoc L, const Twine &Msg)
static unsigned getRelocType64(MCContext &Ctx, SMLoc Loc, MCSymbolRefExpr::VariantKind Modifier, X86_64RelType Type, bool IsPCRel, unsigned Kind)
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
PowerPC TLS Dynamic Call Fixup
A two-byte pc relative fixup.
A four-byte pc relative fixup.
Target - Wrapper for Target specific information.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Represents a location in source code.
MCFixupKind getKind() const