This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 2.25] powerpc: Avoid calling strncmp via PLT on GCC 7


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]