[llvm] [ARM] [Windows] Error out on branch relocations that require a symbol offset (PR #101906)
Jacek Caban via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 6 08:57:16 PDT 2024
================
@@ -587,6 +587,14 @@ unsigned ARMAsmBackend::adjustFixupValue(const MCAssembler &Asm,
return 0;
return 0xffffff & ((Value - 8) >> 2);
case ARM::fixup_t2_uncondbranch: {
+ if (STI->getTargetTriple().isOSBinFormatCOFF() && !IsResolved &&
+ Value != 4) {
+ // MSVC link.exe and lld do not support this relocation type
+ // with a non-zero offset. ("Value" is offset by 4 at this point.)
+ Ctx.reportError(Fixup.getLoc(),
+ "cannot perform a PC-relative fixup with a non-zero "
+ "symbol offset");
+ }
Value = Value - 4;
----------------
cjacek wrote:
Sure, that's fine with me.
https://github.com/llvm/llvm-project/pull/101906
More information about the llvm-commits
mailing list