Hi,

I attached a patch that fixes the relocation issue.
This fixes the load(draw) issue in maxima, and a FTBFS with GCC 16 in fricas.

Best
-Dominique
Description: [loong64] handle R_LARCH_CALL36 in the ELF relocation code
 The relocation is defined in the LoongArch ELF psABI:
 https://github.com/loongson/la-abi-specs/blob/release/laelf.adoc

--- a/h/elf64_loongarch64_reloc.h
+++ b/h/elf64_loongarch64_reloc.h
@@ -75,6 +75,14 @@
 	store_val((ul*)((ul)got+4),MASK(16)<<10,(((s+a)>>2)&0x3ff)<<10);
       }
       break;
+    case R_LARCH_CALL36:
+      {
+	long d=(long)((s+a)-p);
+	massert(d>=-(1L<<37) && d<(1L<<37));
+	store_val(where,MASK(20)<<5,((((d+0x20000)>>18))&MASK(20))<<5);
+	store_val((ul*)((ul)where+4),MASK(16)<<10,((d&0x3ffff)>>2)<<10);
+      }
+      break;
     case R_LARCH_PCALA_HI20:
       store_val(where,MASK(20)<<5,get_page_delta(s+a,p)>>12<<5);
       break;
--- a/h/elf64_loongarch64_reloc_special.h
+++ b/h/elf64_loongarch64_reloc_special.h
@@ -10,6 +10,7 @@
 #define R_LARCH_ALIGN 102
 #define R_LARCH_ADD6 105
 #define R_LARCH_SUB6 106
+#define R_LARCH_CALL36 110

 static unsigned int tramp[] = {
 				0x1a00000c, /* pcalau12i $t0, %hi(sym) */

Reply via email to