1 //===-- Nios2ELFObjectWriter.cpp - Nios2 ELF Writer -----------------------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #include "MCTargetDesc/Nios2FixupKinds.h"
11 #include "MCTargetDesc/Nios2MCExpr.h"
12 #include "MCTargetDesc/Nios2MCTargetDesc.h"
13 #include "llvm/MC/MCELFObjectWriter.h"
14 #include "llvm/MC/MCObjectWriter.h"
15
16 using namespace llvm;
17
18 namespace {
19 class Nios2ELFObjectWriter : public MCELFObjectTargetWriter {
20 public:
Nios2ELFObjectWriter(uint8_t OSABI)21 Nios2ELFObjectWriter(uint8_t OSABI)
22 : MCELFObjectTargetWriter(false, OSABI, ELF::EM_ALTERA_NIOS2, false) {}
23
24 ~Nios2ELFObjectWriter() override;
25
26 unsigned getRelocType(MCContext &Ctx, const MCValue &Target,
27 const MCFixup &Fixup, bool IsPCRel) const override;
28 };
29 } // namespace
30
~Nios2ELFObjectWriter()31 Nios2ELFObjectWriter::~Nios2ELFObjectWriter() {}
32
getRelocType(MCContext & Ctx,const MCValue & Target,const MCFixup & Fixup,bool IsPCRel) const33 unsigned Nios2ELFObjectWriter::getRelocType(MCContext &Ctx,
34 const MCValue &Target,
35 const MCFixup &Fixup,
36 bool IsPCRel) const {
37 return 0;
38 }
39
40 std::unique_ptr<MCObjectTargetWriter>
createNios2ELFObjectWriter(uint8_t OSABI)41 llvm::createNios2ELFObjectWriter(uint8_t OSABI) {
42 return llvm::make_unique<Nios2ELFObjectWriter>(OSABI);
43 }
44