This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH 2.25] powerpc: Avoid calling strncmp via PLT on GCC 7
- From: "Tulio Magno Quites Machado Filho" <tuliom at linux dot vnet dot ibm dot com>
- To: libc-alpha at sourceware dot org, joseph at codesourcery dot com
- Cc: acsawdey at linux dot vnet dot ibm dot com, segher at kernel dot crashing dot org, siddhesh at sourceware dot org
- Date: Mon, 16 Jan 2017 11:29:19 -0200
- Subject: [PATCH 2.25] powerpc: Avoid calling strncmp via PLT on GCC 7
- Authentication-results: sourceware.org; auth=none
This patch only fixes the issue on elf/check-localplt.
In case you notice any other test failures when comparing strings on GCC
7, please refer to this patch:
https://gcc.gnu.org/ml/gcc-patches/2017-01/msg00744.html
-- 8< --
GCC 7 added support for a strncmp built-in for POWER7, generating PLT calls
to strncmp from libc.
2017-01-16 Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>
* sysdeps/powerpc/symbol-hacks.h: New file. Enforce strncmp
calls don't go through the PLT.
---
sysdeps/powerpc/symbol-hacks.h | 7 +++++++
1 file changed, 7 insertions(+)
create mode 100644 sysdeps/powerpc/symbol-hacks.h
diff --git a/sysdeps/powerpc/symbol-hacks.h b/sysdeps/powerpc/symbol-hacks.h
new file mode 100644
index 0000000..7558b18
--- /dev/null
+++ b/sysdeps/powerpc/symbol-hacks.h
@@ -0,0 +1,7 @@
+#include <sysdeps/generic/symbol-hacks.h>
+
+/* GCC 7.0 added support for a builtin strncmp that is used on POWER >= 7. */
+#if !defined __ASSEMBLER__ && IS_IN (libc) && defined SHARED \
+ && defined _ARCH_PWR7
+asm ("strncmp = __GI_strncmp");
+#endif
--
2.1.0