[llvm] [AVR] Emit relocation record for local branch (PR #145291)

Patryk Wychowaniec via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 25 05:21:03 PDT 2025


================
@@ -520,19 +520,7 @@ bool AVRAsmBackend::forceRelocation(const MCFragment &F, const MCFixup &Fixup,
     return false;
 
   case AVR::fixup_7_pcrel:
-  case AVR::fixup_13_pcrel: {
-    uint64_t Offset = Target.getConstant();
-    uint64_t Size = AVRAsmBackend::getFixupKindInfo(Fixup.getKind()).TargetSize;
-
-    // If the jump is too large to encode it, fall back to a relocation.
-    //
-    // Note that trying to actually link that relocation *would* fail, but the
-    // hopes are that the module we're currently compiling won't be actually
-    // linked to the final binary.
-    return !adjust::adjustRelativeBranch(Size, Fixup, Offset,
-                                         getContext().getSubtargetInfo());
-  }
-
+  case AVR::fixup_13_pcrel:
----------------
Patryk27 wrote:

fwiw, I think this ^ is what GCC does as well, would be nice to have if only for better compatibility 👀 

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


More information about the llvm-commits mailing list