24 RISCVELFObjectWriter(
uint8_t OSABI,
bool Is64Bit);
26 ~RISCVELFObjectWriter()
override;
38 bool IsPCRel)
const override;
42RISCVELFObjectWriter::RISCVELFObjectWriter(
uint8_t OSABI,
bool Is64Bit)
46RISCVELFObjectWriter::~RISCVELFObjectWriter() =
default;
48unsigned RISCVELFObjectWriter::getRelocType(
const MCFixup &
Fixup,
54 case ELF::R_RISCV_TPREL_HI20:
55 case ELF::R_RISCV_TLS_GOT_HI20:
56 case ELF::R_RISCV_TLS_GD_HI20:
57 case ELF::R_RISCV_TLSDESC_HI20:
61 case ELF::R_RISCV_PLT32:
62 case ELF::R_RISCV_GOT32_PCREL:
66 " can only be used in a .word directive");
67 return ELF::R_RISCV_NONE;
81 return ELF::R_RISCV_NONE;
83 return ELF::R_RISCV_32_PCREL;
85 return ELF::R_RISCV_PCREL_HI20;
87 return ELF::R_RISCV_PCREL_LO12_I;
89 return ELF::R_RISCV_PCREL_LO12_S;
91 return ELF::R_RISCV_JAL;
93 return ELF::R_RISCV_BRANCH;
95 return ELF::R_RISCV_RVC_JUMP;
97 return ELF::R_RISCV_RVC_BRANCH;
99 return ELF::R_RISCV_CALL_PLT;
101 return ELF::R_RISCV_CALL_PLT;
103 return ELF::R_RISCV_QC_E_BRANCH;
105 return ELF::R_RISCV_QC_E_CALL_PLT;
107 return ELF::R_RISCV_NDS_BRANCH_10;
114 return ELF::R_RISCV_NONE;
118 return ELF::R_RISCV_NONE;
121 return ELF::R_RISCV_NONE;
124 case ELF::R_RISCV_32_PCREL:
125 case ELF::R_RISCV_GOT32_PCREL:
126 case ELF::R_RISCV_PLT32:
129 return ELF::R_RISCV_32;
131 return ELF::R_RISCV_64;
133 return ELF::R_RISCV_HI20;
135 return ELF::R_RISCV_LO12_I;
137 return ELF::R_RISCV_LO12_S;
140 return ELF::R_RISCV_NONE;
142 return ELF::R_RISCV_QC_E_32;
144 return ELF::R_RISCV_QC_ABS20_U;
148std::unique_ptr<MCObjectTargetWriter>
150 return std::make_unique<RISCVELFObjectWriter>(OSABI, Is64Bit);
static Error reportError(StringRef Message)
PowerPC TLS Dynamic Call Fixup
virtual unsigned getRelocType(const MCFixup &Fixup, const MCValue &Target, bool IsPCRel) const =0
virtual bool needsRelocateWithSymbol(const MCValue &, unsigned Type) const
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Target - Wrapper for Target specific information.
The instances of the Type class are immutable: once they are created, they are never changed.
@ fixup_riscv_pcrel_lo12_i
@ fixup_riscv_pcrel_lo12_s
@ fixup_riscv_nds_branch_10
@ fixup_riscv_qc_e_call_plt
@ fixup_riscv_qc_e_branch
StringRef getSpecifierName(Specifier Kind)
bool isRelocation(MCFixupKind FixupKind)
This is an optimization pass for GlobalISel generic memory operations.
std::unique_ptr< MCObjectTargetWriter > createRISCVELFObjectWriter(uint8_t OSABI, bool Is64Bit)
@ FK_Data_8
A eight-byte fixup.
@ FK_Data_1
A one-byte fixup.
@ FK_Data_4
A four-byte fixup.
@ FK_Data_2
A two-byte fixup.