25 X86ELFObjectWriter(
bool IsELF64, uint8_t OSABI, uint16_t EMachine);
27 ~X86ELFObjectWriter()
override;
31 const MCFixup &Fixup,
bool IsPCRel)
const override;
35 X86ELFObjectWriter::X86ELFObjectWriter(
bool IsELF64, uint8_t OSABI,
40 (EMachine != ELF::
EM_386) &&
43 X86ELFObjectWriter::~X86ELFObjectWriter()
88 "32 bit reloc applied to a field with a different size");
101 return IsPCRel ? ELF::R_X86_64_PC64 : ELF::R_X86_64_64;
103 return IsPCRel ? ELF::R_X86_64_PC32 : ELF::R_X86_64_32;
105 return ELF::R_X86_64_32S;
107 return IsPCRel ? ELF::R_X86_64_PC16 : ELF::R_X86_64_16;
109 return IsPCRel ? ELF::R_X86_64_PC8 : ELF::R_X86_64_8;
114 return IsPCRel ? ELF::R_X86_64_GOTPC64 : ELF::R_X86_64_GOT64;
116 return IsPCRel ? ELF::R_X86_64_GOTPC32 : ELF::R_X86_64_GOT32;
125 return ELF::R_X86_64_GOTOFF64;
130 return ELF::R_X86_64_TPOFF64;
132 return ELF::R_X86_64_TPOFF32;
142 return ELF::R_X86_64_DTPOFF64;
144 return ELF::R_X86_64_DTPOFF32;
154 return ELF::R_X86_64_SIZE64;
156 return ELF::R_X86_64_SIZE32;
163 return ELF::R_X86_64_TLSDESC_CALL;
165 return ELF::R_X86_64_GOTPC32_TLSDESC;
168 return ELF::R_X86_64_TLSGD;
171 return ELF::R_X86_64_GOTTPOFF;
174 return ELF::R_X86_64_TLSLD;
177 return ELF::R_X86_64_PLT32;
184 return ELF::R_X86_64_GOTPCREL;
187 return ELF::R_X86_64_GOTPCREL;
189 return ELF::R_X86_64_GOTPCRELX;
192 return ELF::R_X86_64_REX_GOTPCRELX;
224 return IsPCRel ? ELF::R_386_PC32 : ELF::R_386_32;
226 return IsPCRel ? ELF::R_386_PC16 : ELF::R_386_16;
228 return IsPCRel ? ELF::R_386_PC8 : ELF::R_386_8;
233 return ELF::R_386_GOTPC;
237 return ELF::R_386_GOT32;
244 return ELF::R_386_GOTOFF;
248 return ELF::R_386_TLS_LE_32;
252 return ELF::R_386_TLS_LDO_32;
256 return ELF::R_386_TLS_GD;
260 return ELF::R_386_TLS_IE_32;
263 return ELF::R_386_PLT32;
267 return ELF::R_386_TLS_IE;
271 return ELF::R_386_TLS_LE;
275 return ELF::R_386_TLS_GOTIE;
279 return ELF::R_386_TLS_LDM;
285 bool IsPCRel)
const {
293 "Unsupported ELF machine type.");
298 bool IsELF64, uint8_t OSABI,
301 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)
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
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.
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.