[llvm] [lldb][LoongArch] Fix expression function call failure (PR #136563)

via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 21 20:23:22 PDT 2025


================
@@ -662,7 +662,16 @@ bool RuntimeDyldELF::resolveLoongArch64ShortBranch(
   }
   uint64_t Offset = RelI->getOffset();
   uint64_t SourceAddress = Sections[SectionID].getLoadAddressWithOffset(Offset);
-  if (!isInt<28>(Address + Value.Addend - SourceAddress))
+  // Normal call
+  if (RelI->getType() == ELF::R_LARCH_B26) {
+    if (!isInt<28>(Address + Value.Addend - SourceAddress))
+      return false;
+    resolveRelocation(Sections[SectionID], Offset, Address, RelI->getType(),
+                      Value.Addend);
+    return true;
+  }
+  // Medium call: R_LARCH_CALL36
+  if (!isInt<38>(Address + Value.Addend - SourceAddress))
----------------
wangleiat wrote:

Thanks, done.

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


More information about the llvm-commits mailing list