10 #ifndef LLVM_MC_MCELFOBJECTWRITER_H
11 #define LLVM_MC_MCELFOBJECTWRITER_H
14 #include "llvm/Support/DataTypes.h"
49 const uint16_t EMachine;
50 const unsigned HasRelocationAddend : 1;
51 const unsigned Is64Bit : 1;
52 const unsigned IsN64 : 1;
57 uint16_t EMachine_,
bool HasRelocationAddend,
75 bool IsPCRel,
bool IsRelocWithSymbol,
76 int64_t Addend)
const = 0;
87 std::vector<ELFRelocationEntry> &Relocs);
95 bool isN64()
const {
return IsN64; }
100 #define R_TYPE_SHIFT 0
101 #define R_TYPE_MASK 0xffffff00
102 #define R_TYPE2_SHIFT 8
103 #define R_TYPE2_MASK 0xffff00ff
104 #define R_TYPE3_SHIFT 16
105 #define R_TYPE3_MASK 0xff00ffff
106 #define R_SSYM_SHIFT 24
107 #define R_SSYM_MASK 0x00ffffff
144 raw_ostream &OS,
bool IsLittleEndian);
MCELFObjectTargetWriter(bool Is64Bit_, uint8_t OSABI_, uint16_t EMachine_, bool HasRelocationAddend, bool IsN64=false)
unsigned getRType2(uint32_t Type) const
virtual void sortRelocs(const MCAssembler &Asm, std::vector< ELFRelocationEntry > &Relocs)
virtual const MCSymbol * ExplicitRelSym(const MCAssembler &Asm, const MCValue &Target, const MCFragment &F, const MCFixup &Fixup, bool IsPCRel) const
virtual ~MCELFObjectTargetWriter()
unsigned setRType3(unsigned Value, unsigned Type) const
static uint8_t getOSABI(Triple::OSType OSType)
unsigned setRType2(unsigned Value, unsigned Type) const
ELFRelocationEntry(uint64_t RelocOffset, int Idx, unsigned RelType, const MCSymbol *Sym, uint64_t Addend, const MCFixup &Fixup)
unsigned getRType3(uint32_t Type) const
virtual unsigned GetRelocType(const MCValue &Target, const MCFixup &Fixup, bool IsPCRel, bool IsRelocWithSymbol, int64_t Addend) const =0
uint16_t getEMachine() const
MCObjectWriter * createELFObjectWriter(MCELFObjectTargetWriter *MOTW, raw_ostream &OS, bool IsLittleEndian)
Construct a new ELF writer instance.
unsigned getRType(uint32_t Type) const
LLVM Value Representation.
unsigned setRSsym(unsigned Value, unsigned Type) const
unsigned getRSsym(uint32_t Type) const
unsigned setRType(unsigned Value, unsigned Type) const
bool hasRelocationAddend() const
virtual const MCSymbol * undefinedExplicitRelSym(const MCValue &Target, const MCFixup &Fixup, bool IsPCRel) const