forked from OSchip/llvm-project
MC: introduce ability to restrict recorded relocations
Add support to allow a target specific COFF object writer to restrict the recorded resolutions in the emitted object files. This is motivated by the need in Windows on ARM, where an intermediate relocation needs to be prevented from being emitted in the object file. llvm-svn: 209336
This commit is contained in:
parent
1ea9db2dce
commit
54bed12082
|
@ -30,6 +30,7 @@ namespace llvm {
|
||||||
virtual unsigned getRelocType(const MCValue &Target,
|
virtual unsigned getRelocType(const MCValue &Target,
|
||||||
const MCFixup &Fixup,
|
const MCFixup &Fixup,
|
||||||
bool IsCrossSection) const = 0;
|
bool IsCrossSection) const = 0;
|
||||||
|
virtual bool recordRelocation(const MCFixup &) const { return true; }
|
||||||
};
|
};
|
||||||
|
|
||||||
/// \brief Construct a new Win COFF writer instance.
|
/// \brief Construct a new Win COFF writer instance.
|
||||||
|
|
|
@ -808,7 +808,8 @@ void WinCOFFObjectWriter::RecordRelocation(const MCAssembler &Asm,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
coff_section->Relocations.push_back(Reloc);
|
if (TargetObjectWriter->recordRelocation(Fixup))
|
||||||
|
coff_section->Relocations.push_back(Reloc);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WinCOFFObjectWriter::WriteObject(MCAssembler &Asm,
|
void WinCOFFObjectWriter::WriteObject(MCAssembler &Asm,
|
||||||
|
|
Loading…
Reference in New Issue