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,
|
||||
const MCFixup &Fixup,
|
||||
bool IsCrossSection) const = 0;
|
||||
virtual bool recordRelocation(const MCFixup &) const { return true; }
|
||||
};
|
||||
|
||||
/// \brief Construct a new Win COFF writer instance.
|
||||
|
|
|
@ -808,6 +808,7 @@ void WinCOFFObjectWriter::RecordRelocation(const MCAssembler &Asm,
|
|||
}
|
||||
}
|
||||
|
||||
if (TargetObjectWriter->recordRelocation(Fixup))
|
||||
coff_section->Relocations.push_back(Reloc);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue