10 #ifndef LLVM_MC_MCELFOBJECTWRITER_H
11 #define LLVM_MC_MCELFOBJECTWRITER_H
15 #include "llvm/Support/DataTypes.h"
29 class raw_pwrite_stream;
42 : Offset(Offset), Symbol(Symbol), Type(Type), Addend(Addend),
43 OriginalSymbol(OriginalSymbol), OriginalAddend(OriginalAddend) {}
55 const uint16_t EMachine;
56 const unsigned HasRelocationAddend : 1;
57 const unsigned Is64Bit : 1;
58 const unsigned IsN64 : 1;
63 uint16_t EMachine_,
bool HasRelocationAddend,
82 const MCFixup &Fixup,
bool IsPCRel)
const = 0;
88 std::vector<ELFRelocationEntry> &Relocs);
96 bool isN64()
const {
return IsN64; }
101 #define R_TYPE_SHIFT 0
102 #define R_TYPE_MASK 0xffffff00
103 #define R_TYPE2_SHIFT 8
104 #define R_TYPE2_MASK 0xffff00ff
105 #define R_TYPE3_SHIFT 16
106 #define R_TYPE3_MASK 0xff00ffff
107 #define R_SSYM_SHIFT 24
108 #define R_SSYM_MASK 0x00ffffff
145 raw_pwrite_stream &OS,
146 bool IsLittleEndian);
raw_ostream & errs()
This returns a reference to a raw_ostream for standard error.
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 ...
void print(raw_ostream &Out) const
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
Context object for machine code objects.
virtual unsigned getRelocType(MCContext &Ctx, const MCValue &Target, const MCFixup &Fixup, bool IsPCRel) const =0
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
ELFRelocationEntry(uint64_t Offset, const MCSymbolELF *Symbol, unsigned Type, uint64_t Addend, const MCSymbolELF *OriginalSymbol, uint64_t OriginalAddend)
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
const MCSymbolELF * OriginalSymbol
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
This class implements an extremely fast bulk output stream that can only output to a stream...
bool hasRelocationAddend() const
const MCSymbolELF * Symbol