const uint16_t EMachine;
const unsigned HasRelocationAddend : 1;
const unsigned Is64Bit : 1;
- const unsigned IsN64 : 1;
protected:
MCELFObjectTargetWriter(bool Is64Bit_, uint8_t OSABI_, uint16_t EMachine_,
- bool HasRelocationAddend, bool IsN64 = false);
+ bool HasRelocationAddend);
public:
virtual ~MCELFObjectTargetWriter() = default;
uint16_t getEMachine() const { return EMachine; }
bool hasRelocationAddend() const { return HasRelocationAddend; }
bool is64Bit() const { return Is64Bit; }
- bool isN64() const { return IsN64; }
/// @}
// Instead of changing everyone's API we pack the N64 Type fields
if (is64Bit()) {
write(Entry.Offset);
- if (TargetObjectWriter->isN64()) {
+ if (TargetObjectWriter->getEMachine() == ELF::EM_MIPS) {
write(uint32_t(Index));
write(TargetObjectWriter->getRSsym(Entry.Type));
using namespace llvm;
-MCELFObjectTargetWriter::MCELFObjectTargetWriter(bool Is64Bit_,
- uint8_t OSABI_,
+MCELFObjectTargetWriter::MCELFObjectTargetWriter(bool Is64Bit_, uint8_t OSABI_,
uint16_t EMachine_,
- bool HasRelocationAddend_,
- bool IsN64_)
- : OSABI(OSABI_), EMachine(EMachine_),
- HasRelocationAddend(HasRelocationAddend_), Is64Bit(Is64Bit_),
- IsN64(IsN64_){
-}
+ bool HasRelocationAddend_)
+ : OSABI(OSABI_), EMachine(EMachine_),
+ HasRelocationAddend(HasRelocationAddend_), Is64Bit(Is64Bit_) {}
bool MCELFObjectTargetWriter::needsRelocateWithSymbol(const MCSymbol &Sym,
unsigned Type) const {
class MipsELFObjectWriter : public MCELFObjectTargetWriter {
public:
- MipsELFObjectWriter(uint8_t OSABI, bool HasRelocationAddend, bool IsN64,
+ MipsELFObjectWriter(uint8_t OSABI, bool HasRelocationAddend, bool Is64,
bool IsLittleEndian);
~MipsELFObjectWriter() override = default;
#endif
MipsELFObjectWriter::MipsELFObjectWriter(uint8_t OSABI,
- bool HasRelocationAddend, bool IsN64,
+ bool HasRelocationAddend, bool Is64,
bool IsLittleEndian)
- : MCELFObjectTargetWriter(IsN64, OSABI, ELF::EM_MIPS, HasRelocationAddend,
- IsN64) {}
+ : MCELFObjectTargetWriter(Is64, OSABI, ELF::EM_MIPS, HasRelocationAddend) {}
unsigned MipsELFObjectWriter::getRelocType(MCContext &Ctx,
const MCValue &Target,
case FK_TPRel_8:
return ELF::R_MIPS_TLS_TPREL64;
case FK_GPRel_4:
- if (isN64()) {
+ if (is64Bit()) {
unsigned Type = (unsigned)ELF::R_MIPS_NONE;
Type = setRType((unsigned)ELF::R_MIPS_GPREL32, Type);
Type = setRType2((unsigned)ELF::R_MIPS_64, Type);