diff options
| author | 2020-08-03 15:06:44 +0000 | |
|---|---|---|
| committer | 2020-08-03 15:06:44 +0000 | |
| commit | b64793999546ed8adebaeebd9d8345d18db8927d (patch) | |
| tree | 4357c27b561d73b0e089727c6ed659f2ceff5f47 /gnu/llvm/lib/Target/RISCV/MCTargetDesc/RISCVELFObjectWriter.cpp | |
| parent | Add support for UTF-8 DISPLAY-HINTs with octet length. For now only (diff) | |
| download | wireguard-openbsd-b64793999546ed8adebaeebd9d8345d18db8927d.tar.xz wireguard-openbsd-b64793999546ed8adebaeebd9d8345d18db8927d.zip | |
Remove LLVM 8.0.1 files.
Diffstat (limited to 'gnu/llvm/lib/Target/RISCV/MCTargetDesc/RISCVELFObjectWriter.cpp')
| -rw-r--r-- | gnu/llvm/lib/Target/RISCV/MCTargetDesc/RISCVELFObjectWriter.cpp | 105 |
1 files changed, 0 insertions, 105 deletions
diff --git a/gnu/llvm/lib/Target/RISCV/MCTargetDesc/RISCVELFObjectWriter.cpp b/gnu/llvm/lib/Target/RISCV/MCTargetDesc/RISCVELFObjectWriter.cpp deleted file mode 100644 index 9b88614aa69..00000000000 --- a/gnu/llvm/lib/Target/RISCV/MCTargetDesc/RISCVELFObjectWriter.cpp +++ /dev/null @@ -1,105 +0,0 @@ -//===-- RISCVELFObjectWriter.cpp - RISCV ELF Writer -----------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#include "MCTargetDesc/RISCVFixupKinds.h" -#include "MCTargetDesc/RISCVMCTargetDesc.h" -#include "llvm/MC/MCELFObjectWriter.h" -#include "llvm/MC/MCFixup.h" -#include "llvm/MC/MCObjectWriter.h" -#include "llvm/Support/ErrorHandling.h" - -using namespace llvm; - -namespace { -class RISCVELFObjectWriter : public MCELFObjectTargetWriter { -public: - RISCVELFObjectWriter(uint8_t OSABI, bool Is64Bit); - - ~RISCVELFObjectWriter() override; - - // Return true if the given relocation must be with a symbol rather than - // section plus offset. - bool needsRelocateWithSymbol(const MCSymbol &Sym, - unsigned Type) const override { - // TODO: this is very conservative, update once RISC-V psABI requirements - // are clarified. - return true; - } - -protected: - unsigned getRelocType(MCContext &Ctx, const MCValue &Target, - const MCFixup &Fixup, bool IsPCRel) const override; -}; -} - -RISCVELFObjectWriter::RISCVELFObjectWriter(uint8_t OSABI, bool Is64Bit) - : MCELFObjectTargetWriter(Is64Bit, OSABI, ELF::EM_RISCV, - /*HasRelocationAddend*/ true) {} - -RISCVELFObjectWriter::~RISCVELFObjectWriter() {} - -unsigned RISCVELFObjectWriter::getRelocType(MCContext &Ctx, - const MCValue &Target, - const MCFixup &Fixup, - bool IsPCRel) const { - // Determine the type of the relocation - switch ((unsigned)Fixup.getKind()) { - default: - llvm_unreachable("invalid fixup kind!"); - case FK_Data_4: - return ELF::R_RISCV_32; - case FK_Data_8: - return ELF::R_RISCV_64; - case FK_Data_Add_1: - return ELF::R_RISCV_ADD8; - case FK_Data_Add_2: - return ELF::R_RISCV_ADD16; - case FK_Data_Add_4: - return ELF::R_RISCV_ADD32; - case FK_Data_Add_8: - return ELF::R_RISCV_ADD64; - case FK_Data_Sub_1: - return ELF::R_RISCV_SUB8; - case FK_Data_Sub_2: - return ELF::R_RISCV_SUB16; - case FK_Data_Sub_4: - return ELF::R_RISCV_SUB32; - case FK_Data_Sub_8: - return ELF::R_RISCV_SUB64; - case RISCV::fixup_riscv_hi20: - return ELF::R_RISCV_HI20; - case RISCV::fixup_riscv_lo12_i: - return ELF::R_RISCV_LO12_I; - case RISCV::fixup_riscv_lo12_s: - return ELF::R_RISCV_LO12_S; - case RISCV::fixup_riscv_pcrel_hi20: - return ELF::R_RISCV_PCREL_HI20; - case RISCV::fixup_riscv_pcrel_lo12_i: - return ELF::R_RISCV_PCREL_LO12_I; - case RISCV::fixup_riscv_pcrel_lo12_s: - return ELF::R_RISCV_PCREL_LO12_S; - case RISCV::fixup_riscv_jal: - return ELF::R_RISCV_JAL; - case RISCV::fixup_riscv_branch: - return ELF::R_RISCV_BRANCH; - case RISCV::fixup_riscv_rvc_jump: - return ELF::R_RISCV_RVC_JUMP; - case RISCV::fixup_riscv_rvc_branch: - return ELF::R_RISCV_RVC_BRANCH; - case RISCV::fixup_riscv_call: - return ELF::R_RISCV_CALL; - case RISCV::fixup_riscv_relax: - return ELF::R_RISCV_RELAX; - } -} - -std::unique_ptr<MCObjectTargetWriter> -llvm::createRISCVELFObjectWriter(uint8_t OSABI, bool Is64Bit) { - return llvm::make_unique<RISCVELFObjectWriter>(OSABI, Is64Bit); -} |
