LoongArch: Fix soft-float bug about _dl_runtime_resolve{, lsx, lasx}

Message ID 20230711044432.2407878-1-caiyinyu@loongson.cn
State Committed
Commit 0e1324e655f3ba9fd3f8ad24678b93b35eee2618
Headers
Series LoongArch: Fix soft-float bug about _dl_runtime_resolve{, lsx, lasx} |

Checks

Context Check Description
redhat-pt-bot/TryBot-apply_patch success Patch applied to master at the time it was sent
redhat-pt-bot/TryBot-32bit success Build for i686
linaro-tcwg-bot/tcwg_glibc_check--master-aarch64 warning Patch failed to apply
linaro-tcwg-bot/tcwg_glibc_build--master-aarch64 warning Patch failed to apply
linaro-tcwg-bot/tcwg_glibc_build--master-arm warning Patch failed to apply
linaro-tcwg-bot/tcwg_glibc_check--master-arm warning Patch failed to apply

Commit Message

caiyinyu July 11, 2023, 4:44 a.m. UTC
  ---
 sysdeps/loongarch/dl-machine.h    |  4 ++--
 sysdeps/loongarch/dl-trampoline.S |  2 +-
 sysdeps/loongarch/dl-trampoline.h | 14 ++++++--------
 3 files changed, 9 insertions(+), 11 deletions(-)
  

Patch

diff --git a/sysdeps/loongarch/dl-machine.h b/sysdeps/loongarch/dl-machine.h
index 02ce17852c..51ce9af84b 100644
--- a/sysdeps/loongarch/dl-machine.h
+++ b/sysdeps/loongarch/dl-machine.h
@@ -270,7 +270,7 @@  elf_machine_runtime_setup (struct link_map *l, struct r_scope_elem *scope[],
   /* If using PLTs, fill in the first two entries of .got.plt.  */
   if (l->l_info[DT_JMPREL])
     {
-#if HAVE_LOONGARCH_VEC_ASM
+#if HAVE_LOONGARCH_VEC_ASM && !defined __loongarch_soft_float
       extern void _dl_runtime_resolve_lasx (void) attribute_hidden;
       extern void _dl_runtime_resolve_lsx (void) attribute_hidden;
 #endif
@@ -300,7 +300,7 @@  elf_machine_runtime_setup (struct link_map *l, struct r_scope_elem *scope[],
 	  /* This function will get called to fix up the GOT entry
 	     indicated by the offset on the stack, and then jump to
 	     the resolved address.  */
-#if HAVE_LOONGARCH_VEC_ASM
+#if HAVE_LOONGARCH_VEC_ASM && !defined __loongarch_soft_float
 	  if (SUPPORT_LASX)
 	    gotplt[0] = (ElfW(Addr)) &_dl_runtime_resolve_lasx;
 	  else if (SUPPORT_LSX)
diff --git a/sysdeps/loongarch/dl-trampoline.S b/sysdeps/loongarch/dl-trampoline.S
index 2a561b7136..f6ba5e443c 100644
--- a/sysdeps/loongarch/dl-trampoline.S
+++ b/sysdeps/loongarch/dl-trampoline.S
@@ -19,7 +19,7 @@ 
 #include <sysdep.h>
 #include <sys/asm.h>
 
-#if HAVE_LOONGARCH_VEC_ASM
+#if HAVE_LOONGARCH_VEC_ASM && !defined __loongarch_soft_float
 #define USE_LASX
 #define _dl_runtime_resolve _dl_runtime_resolve_lasx
 #include "dl-trampoline.h"
diff --git a/sysdeps/loongarch/dl-trampoline.h b/sysdeps/loongarch/dl-trampoline.h
index f60634a55a..02375286f8 100644
--- a/sysdeps/loongarch/dl-trampoline.h
+++ b/sysdeps/loongarch/dl-trampoline.h
@@ -18,14 +18,12 @@ 
 
 /* Assembler veneer called from the PLT header code for lazy loading.
    The PLT header passes its own args in t0-t2.  */
-#ifndef __loongarch_soft_float
-# ifdef USE_LASX
-#  define FRAME_SIZE (-((-9 * SZREG - 8 * SZFREG - 8 * SZXREG) & ALMASK))
-# elif defined USE_LSX
-#  define FRAME_SIZE (-((-9 * SZREG - 8 * SZFREG - 8 * SZVREG) & ALMASK))
-# else
-#  define FRAME_SIZE (-((-9 * SZREG - 8 * SZFREG) & ALMASK))
-# endif
+#ifdef USE_LASX
+# define FRAME_SIZE (-((-9 * SZREG - 8 * SZFREG - 8 * SZXREG) & ALMASK))
+#elif defined USE_LSX
+# define FRAME_SIZE (-((-9 * SZREG - 8 * SZFREG - 8 * SZVREG) & ALMASK))
+#elif !defined __loongarch_soft_float
+# define FRAME_SIZE (-((-9 * SZREG - 8 * SZFREG) & ALMASK))
 #else
 # define FRAME_SIZE (-((-9 * SZREG) & ALMASK))
 #endif