From db43dfdfa8bc2b938582aef3d87e43594c13ee50 Mon Sep 17 00:00:00 2001 From: CoprDistGit Date: Wed, 9 Oct 2024 03:36:26 +0000 Subject: automatic import of glibc --- LoongArch-Micro-optimize-LD_PCREL.patch | 44 +++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 LoongArch-Micro-optimize-LD_PCREL.patch (limited to 'LoongArch-Micro-optimize-LD_PCREL.patch') diff --git a/LoongArch-Micro-optimize-LD_PCREL.patch b/LoongArch-Micro-optimize-LD_PCREL.patch new file mode 100644 index 0000000..0362e34 --- /dev/null +++ b/LoongArch-Micro-optimize-LD_PCREL.patch @@ -0,0 +1,44 @@ +From 7f703cf758c4f185dd62f2a4f463002bb514af16 Mon Sep 17 00:00:00 2001 +From: Xi Ruoyao +Date: Sun, 27 Aug 2023 00:36:51 +0800 +Subject: [PATCH 13/29] LoongArch: Micro-optimize LD_PCREL + +We are requiring Binutils >= 2.41, so explicit relocation syntax is +always supported by the assembler. Use it to reduce one instruction. + +Signed-off-by: Xi Ruoyao +Signed-off-by: Peng Fan +Signed-off-by: ticat_fp +--- + sysdeps/unix/sysv/linux/loongarch/pointer_guard.h | 10 ++++------ + 1 file changed, 4 insertions(+), 6 deletions(-) + +diff --git a/sysdeps/unix/sysv/linux/loongarch/pointer_guard.h b/sysdeps/unix/sysv/linux/loongarch/pointer_guard.h +index b25e353b..d6c78687 100644 +--- a/sysdeps/unix/sysv/linux/loongarch/pointer_guard.h ++++ b/sysdeps/unix/sysv/linux/loongarch/pointer_guard.h +@@ -19,17 +19,15 @@ + #ifndef POINTER_GUARD_H + #define POINTER_GUARD_H + +-/* Load a got-relative EXPR into G, using T. +- Note G and T are register names. */ ++/* Load a got-relative EXPR into register G. */ + #define LD_GLOBAL(G, EXPR) \ + la.global G, EXPR; \ + REG_L G, G, 0; + +-/* Load a pc-relative EXPR into G, using T. +- Note G and T are register names. */ ++/* Load a pc-relative EXPR into register G. */ + #define LD_PCREL(G, EXPR) \ +- la.pcrel G, EXPR; \ +- REG_L G, G, 0; ++ pcalau12i G, %pc_hi20(EXPR); \ ++ REG_L G, G, %pc_lo12(EXPR); + + #if (IS_IN (rtld) \ + || (!defined SHARED && (IS_IN (libc) \ +-- +2.33.0 + -- cgit v1.2.3