This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[Committed] S/390: Make IFUNC optimized mem* functions hidden
- From: "Andreas Krebbel" <andreas at de dot ibm dot com>
- To: libc-alpha at sourceware dot org
- Date: Mon, 3 Sep 2012 14:14:54 +0200
- Subject: [Committed] S/390: Make IFUNC optimized mem* functions hidden
Hi,
marking the CPU level optimized function prototypes as hidden makes
GCC to generate code which does not need any runtime relocations in
the ifunc resolver.
Committed to glibc after testing on s390 and s390x.
Bye,
-Andreas-
2012-09-03 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
* sysdeps/s390/s390-32/multiarch/ifunc-resolve.c
(IFUNC_RESOLVE): Make pointers to the specialized implementations
hidden.
* sysdeps/s390/s390-64/multiarch/ifunc-resolve.c: Likewise.
---
sysdeps/s390/s390-32/multiarch/ifunc-resolve.c | 10 ++++++----
sysdeps/s390/s390-64/multiarch/ifunc-resolve.c | 8 +++++---
2 files changed, 11 insertions(+), 7 deletions(-)
Index: glibc/sysdeps/s390/s390-64/multiarch/ifunc-resolve.c
===================================================================
--- glibc.orig/sysdeps/s390/s390-64/multiarch/ifunc-resolve.c
+++ glibc/sysdeps/s390/s390-64/multiarch/ifunc-resolve.c
@@ -32,9 +32,11 @@
".globl __GI_" #FUNC "\n\t" \
".set __GI_" #FUNC "," #FUNC "\n"); \
\
- extern void *FUNC##_z10; \
- extern void *FUNC##_z196; \
- extern void *FUNC##_z900; \
+ /* Make the declarations of the optimized functions hidden in order
+ to prevent GOT slots being generated for them. */ \
+ extern __attribute__((visibility("hidden"))) void *FUNC##_z196; \
+ extern __attribute__((visibility("hidden"))) void *FUNC##_z10; \
+ extern __attribute__((visibility("hidden"))) void *FUNC##_z900; \
\
void *resolve_##FUNC (unsigned long int dl_hwcap) \
{ \
Index: glibc/sysdeps/s390/s390-32/multiarch/ifunc-resolve.c
===================================================================
--- glibc.orig/sysdeps/s390/s390-32/multiarch/ifunc-resolve.c
+++ glibc/sysdeps/s390/s390-32/multiarch/ifunc-resolve.c
@@ -31,10 +31,12 @@
".set " #FUNC ",resolve_" #FUNC "\n\t" \
".globl __GI_" #FUNC "\n\t" \
".set __GI_" #FUNC "," #FUNC "\n"); \
- \
- extern void *FUNC##_z10; \
- extern void *FUNC##_z196; \
- extern void *FUNC##_g5; \
+ \
+ /* Make the declarations of the optimized functions hidden in order
+ to prevent GOT slots being generated for them. */ \
+ extern __attribute__((visibility("hidden"))) void *FUNC##_z196; \
+ extern __attribute__((visibility("hidden"))) void *FUNC##_z10; \
+ extern __attribute__((visibility("hidden"))) void *FUNC##_g5; \
\
void *resolve_##FUNC (unsigned long int dl_hwcap) \
{ \