22 RISCVELFObjectWriter(uint8_t OSABI,
bool Is64Bit);
24 ~RISCVELFObjectWriter()
override;
28 bool needsRelocateWithSymbol(
const MCSymbol &Sym,
29 unsigned Type)
const override {
37 const MCFixup &Fixup,
bool IsPCRel)
const override;
41 RISCVELFObjectWriter::RISCVELFObjectWriter(uint8_t OSABI,
bool Is64Bit)
45 RISCVELFObjectWriter::~RISCVELFObjectWriter() {}
52 switch ((
unsigned)Fixup.
getKind()) {
56 return ELF::R_RISCV_32;
58 return ELF::R_RISCV_64;
60 return ELF::R_RISCV_ADD8;
62 return ELF::R_RISCV_ADD16;
64 return ELF::R_RISCV_ADD32;
66 return ELF::R_RISCV_ADD64;
68 return ELF::R_RISCV_SUB8;
70 return ELF::R_RISCV_SUB16;
72 return ELF::R_RISCV_SUB32;
74 return ELF::R_RISCV_SUB64;
76 return ELF::R_RISCV_HI20;
78 return ELF::R_RISCV_LO12_I;
80 return ELF::R_RISCV_LO12_S;
82 return ELF::R_RISCV_PCREL_HI20;
84 return ELF::R_RISCV_PCREL_LO12_I;
86 return ELF::R_RISCV_PCREL_LO12_S;
88 return ELF::R_RISCV_JAL;
90 return ELF::R_RISCV_BRANCH;
92 return ELF::R_RISCV_RVC_JUMP;
94 return ELF::R_RISCV_RVC_BRANCH;
96 return ELF::R_RISCV_CALL;
98 return ELF::R_RISCV_RELAX;
102 std::unique_ptr<MCObjectTargetWriter>
104 return llvm::make_unique<RISCVELFObjectWriter>(OSABI, Is64Bit);
std::unique_ptr< MCObjectTargetWriter > createRISCVELFObjectWriter(uint8_t OSABI, bool Is64Bit)
This class represents lattice values for constants.
This represents an "assembler immediate".
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
block Block Frequency true
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...
static unsigned getRelocType(const MCValue &Target, const MCFixupKind FixupKind, const bool IsPCRel)
Translates generic PPC fixup kind to Mach-O/PPC relocation type enum.
Context object for machine code objects.
The instances of the Type class are immutable: once they are created, they are never changed...
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Target - Wrapper for Target specific information.
MCFixupKind getKind() const