Add definition of MipsELFObjectWriter.

Patch by Reed Kotler at Mips Technologies.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140891 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Akira Hatanaka 2011-09-30 21:55:40 +00:00
parent 09a2e0f794
commit 291512f96f
2 changed files with 33 additions and 0 deletions

View File

@ -1264,6 +1264,8 @@ MCObjectWriter *llvm::createELFObjectWriter(MCELFObjectTargetWriter *MOTW,
case ELF::EM_PPC:
case ELF::EM_PPC64:
return new PPCELFObjectWriter(MOTW, OS, IsLittleEndian); break;
case ELF::EM_MIPS:
return new MipsELFObjectWriter(MOTW, OS, IsLittleEndian); break;
default: llvm_unreachable("Unsupported architecture"); break;
}
}
@ -1809,3 +1811,19 @@ unsigned X86ELFObjectWriter::GetRelocType(const MCValue &Target,
return Type;
}
MipsELFObjectWriter::MipsELFObjectWriter(MCELFObjectTargetWriter *MOTW,
raw_ostream &_OS,
bool IsLittleEndian)
: ELFObjectWriter(MOTW, _OS, IsLittleEndian) {}
MipsELFObjectWriter::~MipsELFObjectWriter() {}
unsigned MipsELFObjectWriter::GetRelocType(const MCValue &Target,
const MCFixup &Fixup,
bool IsPCRel,
bool IsRelocWithSymbol,
int64_t Addend) {
// tbd
return 1;
}

View File

@ -426,6 +426,21 @@ class ELFObjectWriter : public MCObjectWriter {
bool IsPCRel, bool IsRelocWithSymbol,
int64_t Addend);
};
//===- MipsELFObjectWriter -------------------------------------------===//
class MipsELFObjectWriter : public ELFObjectWriter {
public:
MipsELFObjectWriter(MCELFObjectTargetWriter *MOTW,
raw_ostream &_OS,
bool IsLittleEndian);
virtual ~MipsELFObjectWriter();
protected:
virtual unsigned GetRelocType(const MCValue &Target, const MCFixup &Fixup,
bool IsPCRel, bool IsRelocWithSymbol,
int64_t Addend);
};
}
#endif