[lld] [lld][LoongArch] Support the R_LARCH_CALL36 relocation type (PR #73346)

Jinyang He via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 7 00:13:16 PST 2023


================
@@ -591,6 +592,20 @@ void LoongArch::relocate(uint8_t *loc, const Relocation &rel,
     write32le(loc, setD10k16(read32le(loc), val >> 2));
     return;
 
+  case R_LARCH_CALL36: {
+    // This relocation type is designed for the adjancent pcaddu18i+jirl pair,
+    // so patch these 2 instructions in one time.
+    checkInt(loc, val, 38, rel);
----------------
MQ-mengqing wrote:

The real range is [-128G - 0x20000, +128G - 0x20000). Or check the HI and LO separately.

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


More information about the llvm-commits mailing list