[llvm] [RISCV-V][Mach-O] Support large offset for relocation of subtraction expressions. (PR #222205)

Adam Nemet via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 8 17:50:30 PDT 2026


================
@@ -326,17 +326,26 @@ void RISCVMachObjectWriter::recordRelocation(
     // If there's any addend left to handle, inline it in the instruction's
     // immediate.
     FixedValue = Value;
-    if (!isValidInt<12>(
-            FixedValue,
-            "AUIPC out of range of corresponding %pcrel_lo instruction", Asm,
-            Fixup.getLoc()))
-      return;
+    if (!isInt<12>(FixedValue)) {
+      RequireExtraAddend = true;
+      ExtraAddendValue = FixedValue;
----------------
anemet wrote:

Don't we need to clear FixedValue at this point?

https://github.com/llvm/llvm-project/pull/222205


More information about the llvm-commits mailing list