10 #ifndef LLVM_MC_MCELFOBJECTWRITER_H
11 #define LLVM_MC_MCELFOBJECTWRITER_H
14 #include "llvm/Support/DataTypes.h"
26 class raw_pwrite_stream;
36 : Offset(Offset), Symbol(Symbol), Type(Type), Addend(Addend) {}
41 const uint16_t EMachine;
42 const unsigned HasRelocationAddend : 1;
43 const unsigned Is64Bit : 1;
44 const unsigned IsN64 : 1;
49 uint16_t EMachine_,
bool HasRelocationAddend,
70 bool IsPCRel)
const = 0;
76 std::vector<ELFRelocationEntry> &Relocs);
84 bool isN64()
const {
return IsN64; }
89 #define R_TYPE_SHIFT 0
90 #define R_TYPE_MASK 0xffffff00
91 #define R_TYPE2_SHIFT 8
92 #define R_TYPE2_MASK 0xffff00ff
93 #define R_TYPE3_SHIFT 16
94 #define R_TYPE3_MASK 0xff00ffff
95 #define R_SSYM_SHIFT 24
96 #define R_SSYM_MASK 0x00ffffff
133 raw_pwrite_stream &OS,
134 bool IsLittleEndian);
This represents an "assembler immediate".
MCELFObjectTargetWriter(bool Is64Bit_, uint8_t OSABI_, uint16_t EMachine_, bool HasRelocationAddend, bool IsN64=false)
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
virtual unsigned GetRelocType(const MCValue &Target, const MCFixup &Fixup, bool IsPCRel) const =0
virtual void sortRelocs(const MCAssembler &Asm, std::vector< ELFRelocationEntry > &Relocs)
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...
virtual ~MCELFObjectTargetWriter()
unsigned setRType3(unsigned Value, unsigned Type) const
static uint8_t getOSABI(Triple::OSType OSType)
unsigned setRType2(unsigned Value, unsigned Type) const
uint8_t getRSsym(uint32_t Type) const
The instances of the Type class are immutable: once they are created, they are never changed...
uint16_t getEMachine() const
uint8_t getRType(uint32_t Type) const
PowerPC TLS Dynamic Call Fixup
uint8_t getRType3(uint32_t Type) const
Target - Wrapper for Target specific information.
MCObjectWriter * createELFObjectWriter(MCELFObjectTargetWriter *MOTW, raw_pwrite_stream &OS, bool IsLittleEndian)
Construct a new ELF writer instance.
uint8_t getRType2(uint32_t Type) const
ELFRelocationEntry(uint64_t Offset, const MCSymbolELF *Symbol, unsigned Type, uint64_t Addend)
virtual bool needsRelocateWithSymbol(const MCSymbol &Sym, unsigned Type) const
LLVM Value Representation.
unsigned setRSsym(unsigned Value, unsigned Type) const
unsigned setRType(unsigned Value, unsigned Type) const
bool hasRelocationAddend() const
const MCSymbolELF * Symbol