about summary refs log tree commit diff
path: root/sysdeps/loongarch
diff options
context:
space:
mode:
authorcaiyinyu <caiyinyu@loongson.cn>2022-08-10 10:21:46 +0800
committercaiyinyu <caiyinyu@loongson.cn>2022-08-12 09:30:56 +0800
commit1c9bc1b6e50293a1b7037a7bfbf835868a55baed (patch)
tree33bcdaa52d913e1f09b959cba4eac20e6a11540f /sysdeps/loongarch
parent12182ba18dabda791a4f63a11ee2e9d828f40f9b (diff)
downloadglibc-1c9bc1b6e50293a1b7037a7bfbf835868a55baed.tar.gz
glibc-1c9bc1b6e50293a1b7037a7bfbf835868a55baed.tar.xz
glibc-1c9bc1b6e50293a1b7037a7bfbf835868a55baed.zip
LoongArch: Add pointer mangling support.
Diffstat (limited to 'sysdeps/loongarch')
-rw-r--r--sysdeps/loongarch/__longjmp.S7
-rw-r--r--sysdeps/loongarch/setjmp.S7
2 files changed, 14 insertions, 0 deletions
diff --git a/sysdeps/loongarch/__longjmp.S b/sysdeps/loongarch/__longjmp.S
index 37e7384413..c2c5b56a80 100644
--- a/sysdeps/loongarch/__longjmp.S
+++ b/sysdeps/loongarch/__longjmp.S
@@ -20,8 +20,15 @@
 #include <sys/asm.h>
 
 ENTRY (__longjmp)
+#ifdef PTR_MANGLE
+	REG_L t0, a0, 0*SZREG
+	PTR_DEMANGLE (ra, t0, t1, t2)
+	REG_L t0, a0, 1*SZREG
+	PTR_DEMANGLE2 (sp, t0, t1)
+#else
 	REG_L ra, a0, 0*SZREG
 	REG_L sp, a0, 1*SZREG
+#endif
 	REG_L x,  a0, 2*SZREG
 	REG_L fp, a0, 3*SZREG
 	REG_L s0, a0, 4*SZREG
diff --git a/sysdeps/loongarch/setjmp.S b/sysdeps/loongarch/setjmp.S
index 3afb9f3948..ec4ddc72da 100644
--- a/sysdeps/loongarch/setjmp.S
+++ b/sysdeps/loongarch/setjmp.S
@@ -29,8 +29,15 @@ ENTRY (setjmp)
 END (setjmp)
 
 ENTRY (__sigsetjmp)
+#ifdef PTR_MANGLE
+	PTR_MANGLE (t0, ra, t1, t2)
+	REG_S t0, a0, 0*SZREG
+	PTR_MANGLE2 (t0, sp, t1)
+	REG_S t0, a0, 1*SZREG
+#else
 	REG_S ra, a0, 0*SZREG
 	REG_S sp, a0, 1*SZREG
+#endif
 	REG_S x,  a0, 2*SZREG
 	REG_S fp, a0, 3*SZREG
 	REG_S s0, a0, 4*SZREG