Go to the documentation of this file.
9 #ifndef LLVM_MC_MCELFOBJECTWRITER_H
10 #define LLVM_MC_MCELFOBJECTWRITER_H
55 const uint8_t ABIVersion;
57 const unsigned HasRelocationAddend : 1;
58 const unsigned Is64Bit : 1;
62 bool HasRelocationAddend_, uint8_t ABIVersion_ = 0);
89 const MCFixup &Fixup,
bool IsPCRel)
const = 0;
95 std::vector<ELFRelocationEntry> &Relocs);
110 #define R_TYPE_SHIFT 0
111 #define R_TYPE_MASK 0xffffff00
112 #define R_TYPE2_SHIFT 8
113 #define R_TYPE2_MASK 0xffff00ff
114 #define R_TYPE3_SHIFT 16
115 #define R_TYPE3_MASK 0xff00ffff
116 #define R_SSYM_SHIFT 24
117 #define R_SSYM_MASK 0x00ffffff
134 static unsigned setRTypes(
unsigned Value1,
unsigned Value2,
unsigned Value3) {
157 std::unique_ptr<MCObjectWriter>
159 raw_pwrite_stream &OS,
bool IsLittleEndian);
161 std::unique_ptr<MCObjectWriter>
163 raw_pwrite_stream &OS, raw_pwrite_stream &DwoOS,
164 bool IsLittleEndian);
168 #endif // LLVM_MC_MCELFOBJECTWRITER_H
const MCSymbolELF * OriginalSymbol
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds.
This is an optimization pass for GlobalISel generic memory operations.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
std::unique_ptr< MCObjectWriter > createELFObjectWriter(std::unique_ptr< MCELFObjectTargetWriter > MOTW, raw_pwrite_stream &OS, bool IsLittleEndian)
Construct a new ELF writer instance.
Context object for machine code objects.
Target - Wrapper for Target specific information.
Triple::ObjectFormatType getFormat() const override
uint8_t getRType3(uint32_t Type) const
uint8_t getABIVersion() const
The instances of the Type class are immutable: once they are created, they are never changed.
unsigned setRSsym(unsigned Value, unsigned Type) const
void print(raw_ostream &Out) const
bool hasRelocationAddend() const
raw_fd_ostream & errs()
This returns a reference to a raw_ostream for standard error.
This represents a section on linux, lots of unix variants and some bare metal systems.
virtual void sortRelocs(const MCAssembler &Asm, std::vector< ELFRelocationEntry > &Relocs)
const MCSymbolELF * Symbol
Base class for classes that define behaviour that is specific to both the target and the object forma...
static unsigned setRTypes(unsigned Value1, unsigned Value2, unsigned Value3)
This class implements an extremely fast bulk output stream that can only output to a stream.
ELFRelocationEntry(uint64_t Offset, const MCSymbolELF *Symbol, unsigned Type, uint64_t Addend, const MCSymbolELF *OriginalSymbol, uint64_t OriginalAddend)
uint8_t getRSsym(uint32_t Type) const
uint8_t getRType(uint32_t Type) const
MCELFObjectTargetWriter(bool Is64Bit_, uint8_t OSABI_, uint16_t EMachine_, bool HasRelocationAddend_, uint8_t ABIVersion_=0)
LLVM_DUMP_METHOD void dump() const
virtual void addTargetSectionFlags(MCContext &Ctx, MCSectionELF &Sec)
virtual bool needsRelocateWithSymbol(const MCSymbol &Sym, unsigned Type) const
virtual MCSectionELF * getMemtagRelocsSection(MCContext &Ctx) const
static uint8_t getOSABI(Triple::OSType OSType)
uint16_t getEMachine() const
std::unique_ptr< MCObjectWriter > createELFDwoObjectWriter(std::unique_ptr< MCELFObjectTargetWriter > MOTW, raw_pwrite_stream &OS, raw_pwrite_stream &DwoOS, bool IsLittleEndian)
static bool classof(const MCObjectTargetWriter *W)
This represents an "assembler immediate".
uint8_t getRType2(uint32_t Type) const
virtual unsigned getRelocType(MCContext &Ctx, const MCValue &Target, const MCFixup &Fixup, bool IsPCRel) const =0
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...
LLVM Value Representation.
virtual ~MCELFObjectTargetWriter()=default