29 X86ELFObjectWriter(
bool IsELF64, uint8_t OSABI, uint16_t EMachine);
30 ~X86ELFObjectWriter()
override =
default;
34 const MCFixup &Fixup,
bool IsPCRel)
const override;
39 X86ELFObjectWriter::X86ELFObjectWriter(
bool IsELF64, uint8_t OSABI,
44 (EMachine != ELF::
EM_386) &&
89 "32 bit reloc applied to a field with a different size");
103 return IsPCRel ? ELF::R_X86_64_PC64 : ELF::R_X86_64_64;
105 return IsPCRel ? ELF::R_X86_64_PC32 : ELF::R_X86_64_32;
107 return ELF::R_X86_64_32S;
109 return IsPCRel ? ELF::R_X86_64_PC16 : ELF::R_X86_64_16;
111 return IsPCRel ? ELF::R_X86_64_PC8 : ELF::R_X86_64_8;
116 return IsPCRel ? ELF::R_X86_64_GOTPC64 : ELF::R_X86_64_GOT64;
118 return IsPCRel ? ELF::R_X86_64_GOTPC32 : ELF::R_X86_64_GOT32;
127 return ELF::R_X86_64_GOTOFF64;
132 return ELF::R_X86_64_TPOFF64;
134 return ELF::R_X86_64_TPOFF32;
144 return ELF::R_X86_64_DTPOFF64;
146 return ELF::R_X86_64_DTPOFF32;
156 return ELF::R_X86_64_SIZE64;
158 return ELF::R_X86_64_SIZE32;
165 return ELF::R_X86_64_TLSDESC_CALL;
167 return ELF::R_X86_64_GOTPC32_TLSDESC;
170 return ELF::R_X86_64_TLSGD;
173 return ELF::R_X86_64_GOTTPOFF;
176 return ELF::R_X86_64_TLSLD;
179 return ELF::R_X86_64_PLT32;
186 return ELF::R_X86_64_GOTPCREL;
189 return ELF::R_X86_64_GOTPCREL;
191 return ELF::R_X86_64_GOTPCRELX;
194 return ELF::R_X86_64_REX_GOTPCRELX;
227 return IsPCRel ? ELF::R_386_PC32 : ELF::R_386_32;
229 return IsPCRel ? ELF::R_386_PC16 : ELF::R_386_16;
231 return IsPCRel ? ELF::R_386_PC8 : ELF::R_386_8;
236 return ELF::R_386_GOTPC;
240 return ELF::R_386_GOT32;
247 return ELF::R_386_GOTOFF;
251 return ELF::R_386_TLS_LE_32;
255 return ELF::R_386_TLS_LDO_32;
259 return ELF::R_386_TLS_GD;
263 return ELF::R_386_TLS_IE_32;
266 return ELF::R_386_PLT32;
270 return ELF::R_386_TLS_IE;
274 return ELF::R_386_TLS_LE;
278 return ELF::R_386_TLS_GOTIE;
282 return ELF::R_386_TLS_LDM;
288 bool IsPCRel)
const {
296 "Unsupported ELF machine type.");
301 bool IsELF64, uint8_t OSABI,
304 new X86ELFObjectWriter(IsELF64, OSABI, EMachine);
bool canRelaxRelocations() const
const MCAsmInfo * getAsmInfo() const
This represents an "assembler immediate".
Defines the object file and target independent interfaces used by the assembler backend to write nati...
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)
The instances of the Type class are immutable: once they are created, they are never changed...
static X86_32RelType getType32(X86_64RelType T)
MCSymbolRefExpr::VariantKind getAccessVariant() const
void reportError(SMLoc L, const Twine &Msg)
MCFixupKind getKind() const
static unsigned getRelocType64(MCContext &Ctx, SMLoc Loc, MCSymbolRefExpr::VariantKind Modifier, X86_64RelType Type, bool IsPCRel, unsigned Kind)
A two-byte pc relative fixup.
A four-byte pc relative fixup.
MCObjectWriter * createX86ELFObjectWriter(raw_pwrite_stream &OS, bool IsELF64, uint8_t OSABI, uint16_t EMachine)
Construct an X86 ELF object writer.
Target - Wrapper for Target specific information.
llvm_unreachable("Unknown RegBank!")
MCObjectWriter * createELFObjectWriter(MCELFObjectTargetWriter *MOTW, raw_pwrite_stream &OS, bool IsLittleEndian)
Construct a new ELF writer instance.
An abstract base class for streams implementations that also support a pwrite operation.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Represents a location in source code.