[llvm] [JITLink][LoongArch] Support large code model (PR #155566)

via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 4 00:50:29 PDT 2025


================
@@ -0,0 +1,50 @@
+# RUN: rm -rf %t && mkdir -p %t
+# RUN: llvm-mc --triple=loongarch64 --filetype=obj -o %t/elf_large_reloc.o %s
+# RUN: llvm-jitlink --noexec \
+# RUN:              --abs external_data=0x1234 \
+# RUN:              --check %s %t/elf_large_reloc.o
+
+    .text
+    .globl main
+    .p2align 2
+    .type main, at function
+main:
+    ret
+    .size main,.-main
+
+    .section .sec.large.pc,"ax", at progbits
+    .globl test_large_pc
+    .p2align 2
+test_large_pc:
+# jitlink-check: *{4}(test_large_pc) = 0x1bffffed
+# jitlink-check: *{4}(test_large_pc + 4) = 0x2c0000c
----------------
wangleiat wrote:

Better not to check the instruction `hard-code` directly; should use expressions instead.(decode_operand/got_addr)

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


More information about the llvm-commits mailing list