From 71655832555411915d157b17253c8ffe0848533a Mon Sep 17 00:00:00 2001 From: Stefan Liebler Date: Tue, 24 May 2016 10:39:13 +0200 Subject: S390: Do not call memcpy, memcmp, memset within libc.so via ifunc-plt. On s390, the memcpy, memcmp, memset functions are IFUNC symbols, which are created with s390_libc_ifunc-macro. This macro creates a __GI_ symbol which is set to the ifunced symbol. Thus calls within libc.so to e.g. memcpy result in a call to *ABS*+0x954c0@plt stub and afterwards to the resolved memcpy-ifunc-variant. This patch sets the __GI_ symbol to the default-ifunc-variant to avoid the plt call. The __GI_ symbols are now created at the default variant of ifunced function. ChangeLog: * sysdeps/s390/multiarch/ifunc-resolve.h (s390_libc_ifunc): Remove __GI_ symbol. * sysdeps/s390/s390-32/multiarch/memcmp-s390.S: Add __GI_memcmp symbol. * sysdeps/s390/s390-64/multiarch/memcmp-s390x.S: Likewise. * sysdeps/s390/s390-32/multiarch/memcpy-s390.S: Add __GI_memcpy symbol. * sysdeps/s390/s390-64/multiarch/memcpy-s390x.S: Likewise. * sysdeps/s390/s390-32/multiarch/memset-s390.S: Add __GI_memset symbol. * sysdeps/s390/s390-64/multiarch/memset-s390x.S: Likewise. --- sysdeps/s390/multiarch/ifunc-resolve.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'sysdeps/s390/multiarch') diff --git a/sysdeps/s390/multiarch/ifunc-resolve.h b/sysdeps/s390/multiarch/ifunc-resolve.h index 744a0d8d6d..26e097ad6e 100644 --- a/sysdeps/s390/multiarch/ifunc-resolve.h +++ b/sysdeps/s390/multiarch/ifunc-resolve.h @@ -44,9 +44,7 @@ #define s390_libc_ifunc(FUNC) \ __asm__ (".globl " #FUNC "\n\t" \ ".type " #FUNC ",@gnu_indirect_function\n\t" \ - ".set " #FUNC ",__resolve_" #FUNC "\n\t" \ - ".globl __GI_" #FUNC "\n\t" \ - ".set __GI_" #FUNC "," #FUNC "\n"); \ + ".set " #FUNC ",__resolve_" #FUNC "\n\t"); \ \ /* Make the declarations of the optimized functions hidden in order to prevent GOT slots being generated for them. */ \ -- cgit 1.4.1