[PATCH] powerpc: Fix check-localplt from 99303f3871
Adhemerval Zanella
adhemerval.zanella@linaro.org
Wed Apr 29 12:47:50 GMT 2026
The misc/hash.c uses floating-point operations and powerpc softfp
also exports the same libgcc symbols, which creates extra PLT calls.
Use the same hack from divdi3-symbol-hacks.h to route such calls
internally.
Checked with build/check for powerpc-linux-gnu-soft.
---
soft-fp/fixunssfsi.c | 1 +
soft-fp/gesf2.c | 1 +
soft-fp/lesf2.c | 2 ++
sysdeps/powerpc/powerpc32/symbol-hacks.h | 8 ++++++++
4 files changed, 12 insertions(+)
diff --git a/soft-fp/fixunssfsi.c b/soft-fp/fixunssfsi.c
index 9e883a9769..1b17b04852 100644
--- a/soft-fp/fixunssfsi.c
+++ b/soft-fp/fixunssfsi.c
@@ -43,3 +43,4 @@ __fixunssfsi (SFtype a)
return r;
}
+strong_alias (__fixunssfsi, __fixunssfsi_internal)
diff --git a/soft-fp/gesf2.c b/soft-fp/gesf2.c
index f7289982f1..455bb75d34 100644
--- a/soft-fp/gesf2.c
+++ b/soft-fp/gesf2.c
@@ -47,3 +47,4 @@ __gesf2 (SFtype a, SFtype b)
}
strong_alias (__gesf2, __gtsf2);
+strong_alias (__gesf2, __gesf2_internal)
diff --git a/soft-fp/lesf2.c b/soft-fp/lesf2.c
index 2f4921f3ce..3b40b3c9b8 100644
--- a/soft-fp/lesf2.c
+++ b/soft-fp/lesf2.c
@@ -47,3 +47,5 @@ __lesf2 (SFtype a, SFtype b)
}
strong_alias (__lesf2, __ltsf2);
+strong_alias (__lesf2, __lesf2_internal);
+strong_alias (__ltsf2, __ltsf2_internal);
diff --git a/sysdeps/powerpc/powerpc32/symbol-hacks.h b/sysdeps/powerpc/powerpc32/symbol-hacks.h
index 1faf282601..6f85c16bb8 100644
--- a/sysdeps/powerpc/powerpc32/symbol-hacks.h
+++ b/sysdeps/powerpc/powerpc32/symbol-hacks.h
@@ -19,3 +19,11 @@
#include <sysdeps/wordsize-32/divdi3-symbol-hacks.h>
#include_next "symbol-hacks.h"
+
+#if !defined __ASSEMBLER__ \
+ && IS_IN (libc) && defined SHARED && defined __NO_FPRS__
+asm ("__fixunssfsi = __fixunssfsi_internal");
+asm ("__ltsf2 = __ltsf2_internal");
+asm ("__lesf2 = __lesf2_internal");
+asm ("__gesf2 = __gesf2_internal");
+#endif
--
2.43.0
More information about the Libc-alpha
mailing list