aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/i386/i686/multiarch/strspn.S
diff options
context:
space:
mode:
authorH.J. Lu <hongjiu.lu@intel.com>2009-08-08 10:29:29 -0700
committerUlrich Drepper <drepper@redhat.com>2009-08-08 10:29:29 -0700
commitfc1870e6a484ad3211648c9ae51bc076913518aa (patch)
tree79e028c9691d0f75c99fe5d6f5f2214e57808c36 /sysdeps/i386/i686/multiarch/strspn.S
parenta3d4298d8354f4ea232f027ba2ebfd560afecc1b (diff)
downloadglibc-fc1870e6a484ad3211648c9ae51bc076913518aa.tar
glibc-fc1870e6a484ad3211648c9ae51bc076913518aa.tar.gz
glibc-fc1870e6a484ad3211648c9ae51bc076913518aa.tar.bz2
glibc-fc1870e6a484ad3211648c9ae51bc076913518aa.zip
Use PIC only if SHARED is defined.
For ia32, we can avoid PIC in IFUNC functions in static library.
Diffstat (limited to 'sysdeps/i386/i686/multiarch/strspn.S')
-rw-r--r--sysdeps/i386/i686/multiarch/strspn.S15
1 files changed, 15 insertions, 0 deletions
diff --git a/sysdeps/i386/i686/multiarch/strspn.S b/sysdeps/i386/i686/multiarch/strspn.S
index f11d3eaf6a..f306d2d1fb 100644
--- a/sysdeps/i386/i686/multiarch/strspn.S
+++ b/sysdeps/i386/i686/multiarch/strspn.S
@@ -27,6 +27,7 @@
/* Define multiple versions only for the definition in libc. */
#ifndef NOT_IN_libc
+# ifdef SHARED
.section .gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits
.globl __i686.get_pc_thunk.bx
.hidden __i686.get_pc_thunk.bx
@@ -56,6 +57,20 @@ ENTRY(strspn)
cfi_restore (ebx)
ret
END(strspn)
+# else
+ .text
+ENTRY(strspn)
+ .type strspn, @gnu_indirect_function
+ cmpl $0, KIND_OFFSET+__cpu_features
+ jne 1f
+ call __init_cpu_features
+1: leal __strspn_ia32, %eax
+ testl $(1<<20), CPUID_OFFSET+COMMON_CPUID_INDEX_1*CPUID_SIZE+CPUID_ECX_OFFSET+__cpu_features
+ jz 2f
+ leal __strspn_sse42, %eax
+2: ret
+END(strspn)
+# endif
# undef ENTRY
# define ENTRY(name) \