diff options
author | Andreas Schwab <schwab@redhat.com> | 2009-12-14 16:38:19 +0100 |
---|---|---|
committer | Andreas Schwab <schwab@redhat.com> | 2009-12-14 16:38:19 +0100 |
commit | 57596e7a129337d40dc4c966aa65009b7339f3cc (patch) | |
tree | 5922f5630b0bca97035c598775d4c9ee8ce4c2a6 | |
parent | 72500358549b4df4cd239e081733a643fb3b3d03 (diff) | |
parent | 2510d01ddba195f8cfaa3c2349f75e0612719d82 (diff) |
Merge remote branch 'origin/master' into fedora/master
46 files changed, 569 insertions, 242 deletions
diff --git a/.gitignore b/.gitignore index a64fda5108..fbdcf54506 100644 --- a/.gitignore +++ b/.gitignore @@ -1,19 +1,11 @@ *~ -*.d -*.o -*.so -*.po -*.go -*.bo -stamp.* -*.stamp -*.ustamp -*.udeps *.gz *.Z *.tar *.tgz *.bz2 +*.rej +*.orig =* TAGS TODO @@ -1,3 +1,96 @@ +2009-12-13 H.J. Lu <hongjiu.lu@intel.com> + + * sysdeps/i386/i686/multiarch/strcspn.S Include <init-arch.h> + instead of <ifunc-defines.h>. Use bit_XXX and index_XXX to + check processor feature. + * sysdeps/i386/i686/multiarch/strlen.S: Likewise. + * sysdeps/i386/i686/multiarch/strspn.S: Likewise. + * sysdeps/x86_64/multiarch/init-arch.h (bit_SSE2): New definition. + (index_SSE2): Likewise. + +2009-12-09 H.J. Lu <hongjiu.lu@intel.com> + + * sysdeps/x86_64/multiarch/init-arch.h: Include <ifunc-defines.h> + if __ASSEMBLER__ is defined. + (bit_SSSE3): New. Defined for __ASSEMBLER__. + (bit_SSE4_2): Likewise. + (index_SSSE3): Likewise. + (index_SSE4_2): Likewise. + * sysdeps/x86_64/multiarch/rawmemchr.S: Include <init-arch.h> + instead of <ifunc-defines.h>. Use bit_XXX and index_XXX to + check processor feature. + * sysdeps/x86_64/multiarch/strchr.S: Likewise. + * sysdeps/x86_64/multiarch/strcmp.S: Likewise. + * sysdeps/x86_64/multiarch/strcpy.S: Likewise. + * sysdeps/x86_64/multiarch/strcspn.S: Likewise. + * sysdeps/x86_64/multiarch/strlen.S: Likewise. + * sysdeps/x86_64/multiarch/strrchr.S: Likewise. + * sysdeps/x86_64/multiarch/strspn.S: Likewise. + +2009-12-08 Kaz Kojima <kkojima@rr.iij4u.or.jp> + + * sysdeps/sh/elf/initfini.c: Update according to generic/initfini.c. + +2009-12-01 Mike Frysinger <vapier@gentoo.org> + + * sysdeps/sh/sh4/fpu/fpu_control.h (__set_fpscr): New prototype. + +2009-12-11 Ulrich Drepper <drepper@redhat.com> + + * sysdeps/unix/sysv/linux/sh/bits/fcntl.h: Redefine O_SYNC and + O_DSYNC to match 2.6.33+ kernels. + * sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h: Likewise. + * sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h: Likewise. + * sysdeps/unix/sysv/linux/sparc/bits/fcntl.h: Likewise. + * sysdeps/unix/sysv/linux/ia64/bits/fcntl.h: Likewise. + * sysdeps/unix/sysv/linux/i386/bits/fcntl.h: Likewise. + * sysdeps/unix/sysv/linux/s390/bits/fcntl.h: Likewise. + +2009-12-10 Ulrich Drepper <drepper@redhat.com> + + [BZ #11000] + * nis/nss_nis/nis-hosts.c (_nss_nis_gethostbyname4_r): Always set + *herrnop before returning. + * nis/nss_nisplus/nisplus-hosts.c (internal_gethostbyname2_r): + Likewise. + * nss/nss_files/files-hosts.c (_nss_files_gethostbyname4_r): Handle + TRYAGAIN errors separately. + * sysdeps/posix/getaddrinfo.c (gaih_inet): Fix error handling of + *name4_r after functions. + +2009-12-09 Ulrich Drepper <drepper@redhat.com> + + [BZ #11046] + * sysdeps/unix/sysv/linux/ptsname.c (__ptsname_internal): Fix kernel + version check. + +2009-11-05 Bruno Haible <bruno@clisp.org> + + [BZ #11056] + * posix/unistd.h (execve, fexecve, execv, execvp, execvpe): Mark the + argv argument as non-NULL. + (execle, execl, execlp): Mark the first ARG argument as non-NULL. + +-2009-12-08 Ulrich Drepper <drepper@redhat.com> + + * sysdeps/unix/sysv/linux/bits/socket.h: Define mmsghdr and declare + recvmmsg. + * sysdeps/unix/sysv/linux/syscalls.list: Add entry for recvmmsg. + * sysdeps/unix/sysv/linux/Versions: Add recvmmsg for GLIBC_2.12. + +2009-12-04 Andreas Krebbel <Andreas.Krebbel@de.ibm.com> + + * sysdeps/s390/s390-64/dl-trampoline.S: Add CFI for the call saved + registers. + * sysdeps/s390/s390-32/dl-trampoline.S: Likewise. + * sysdeps/s390/s390-32/s390-mcount.S: Add CFI. + * sysdeps/s390/s390-64/s390x-mcount.S: Add CFI. + +2009-11-30 Ulrich Drepper <drepper@redhat.com> + + * sysdeps/unix/sysv/linux/bits/sched.h: Define SCHED_IDLE and + SCHED_RESET_ON_FORK. + 2009-11-26 Ulrich Drepper <drepper@redhat.com> * sysdeps/unix/sysv/linux/ptsname.c (__ptsname_internal): Avoid code @@ -1,10 +1,15 @@ -GNU C Library NEWS -- history of user-visible changes. 2009-10-30 +GNU C Library NEWS -- history of user-visible changes. 2009-12-8 Copyright (C) 1992-2008, 2009 Free Software Foundation, Inc. See the end for copying conditions. Please send GNU C library bug reports via <http://sources.redhat.com/bugzilla/> using `glibc' in the "product" field. +Version 2.12 + +* New Linux interface: recvmmsg + + Version 2.11 * New interfaces: execvpe, pthread_sigqueue, mkstemps, mkstemps64, mkostemps, diff --git a/nis/nss_nis/nis-hosts.c b/nis/nss_nis/nis-hosts.c index e1db5f531f..18bc77391b 100644 --- a/nis/nss_nis/nis-hosts.c +++ b/nis/nss_nis/nis-hosts.c @@ -70,20 +70,20 @@ LINE_PARSER { assert ((flags & AI_V4MAPPED) == 0 || af != AF_UNSPEC); if (flags & AI_V4MAPPED) - { - map_v4v6_address ((char *) entdata->host_addr, - (char *) entdata->host_addr); - result->h_addrtype = AF_INET6; - result->h_length = IN6ADDRSZ; - } + { + map_v4v6_address ((char *) entdata->host_addr, + (char *) entdata->host_addr); + result->h_addrtype = AF_INET6; + result->h_length = IN6ADDRSZ; + } else - { - result->h_addrtype = AF_INET; - result->h_length = INADDRSZ; - } + { + result->h_addrtype = AF_INET; + result->h_length = INADDRSZ; + } } else if (af != AF_INET - && inet_pton (AF_INET6, addr, entdata->host_addr) > 0) + && inet_pton (AF_INET6, addr, entdata->host_addr) > 0) { result->h_addrtype = AF_INET6; result->h_length = IN6ADDRSZ; @@ -164,14 +164,14 @@ internal_nis_gethostent_r (struct hostent *host, char *buffer, int keylen; int yperr; if (new_start) - yperr = yp_first (domain, "hosts.byname", &outkey, &keylen, &result, + yperr = yp_first (domain, "hosts.byname", &outkey, &keylen, &result, &len); else - yperr = yp_next (domain, "hosts.byname", oldkey, oldkeylen, &outkey, + yperr = yp_next (domain, "hosts.byname", oldkey, oldkeylen, &outkey, &keylen, &result, &len); if (__builtin_expect (yperr != YPERR_SUCCESS, 0)) - { + { enum nss_status retval = yperr2nss (yperr); switch (retval) @@ -191,12 +191,12 @@ internal_nis_gethostent_r (struct hostent *host, char *buffer, } if (__builtin_expect ((size_t) (len + 1) > linebuflen, 0)) - { - free (result); + { + free (result); *h_errnop = NETDB_INTERNAL; - *errnop = ERANGE; - return NSS_STATUS_TRYAGAIN; - } + *errnop = ERANGE; + return NSS_STATUS_TRYAGAIN; + } char *p = strncpy (data->linebuffer, result, len); data->linebuffer[len] = '\0'; @@ -233,7 +233,7 @@ _nss_nis_gethostent_r (struct hostent *host, char *buffer, size_t buflen, __libc_lock_lock (lock); status = internal_nis_gethostent_r (host, buffer, buflen, errnop, h_errnop, - ((_res.options & RES_USE_INET6) ? AF_INET6 : AF_INET), + ((_res.options & RES_USE_INET6) ? AF_INET6 : AF_INET), ((_res.options & RES_USE_INET6) ? AI_V4MAPPED : 0 )); __libc_lock_unlock (lock); @@ -346,7 +346,7 @@ _nss_nis_gethostbyname2_r (const char *name, int af, struct hostent *host, return internal_gethostbyname2_r (name, af, host, buffer, buflen, errnop, h_errnop, - ((_res.options & RES_USE_INET6) ? AI_V4MAPPED : 0)); + ((_res.options & RES_USE_INET6) ? AI_V4MAPPED : 0)); } @@ -456,7 +456,10 @@ _nss_nis_gethostbyname4_r (const char *name, struct gaih_addrtuple **pat, { char *domain; if (yp_get_default_domain (&domain)) - return NSS_STATUS_UNAVAIL; + { + *herrnop = NO_DATA; + return NSS_STATUS_UNAVAIL; + } /* Convert name to lowercase. */ size_t namlen = strlen (name); diff --git a/nis/nss_nisplus/nisplus-hosts.c b/nis/nss_nisplus/nisplus-hosts.c index 37d44773fc..eca64c97e6 100644 --- a/nis/nss_nisplus/nisplus-hosts.c +++ b/nis/nss_nisplus/nisplus-hosts.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1997-2003, 2005, 2006, 2008 Free Software Foundation, Inc. +/* Copyright (C) 1997-2003, 2005, 2006, 2008, 2009 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Thorsten Kukuk <kukuk@suse.de>, 1997. @@ -38,10 +38,10 @@ static nis_name tablename_val; static u_long tablename_len; #define NISENTRYVAL(idx, col, res) \ - (NIS_RES_OBJECT (res)[idx].EN_data.en_cols.en_cols_val[col].ec_value.ec_value_val) + (NIS_RES_OBJECT (res)[idx].EN_data.en_cols.en_cols_val[col].ec_value.ec_value_val) #define NISENTRYLEN(idx, col, res) \ - (NIS_RES_OBJECT (res)[idx].EN_data.en_cols.en_cols_val[col].ec_value.ec_value_len) + (NIS_RES_OBJECT (res)[idx].EN_data.en_cols.en_cols_val[col].ec_value.ec_value_len) /* Get implementation for some internal functions. */ #include <resolv/mapv4v6addr.h> @@ -287,15 +287,15 @@ internal_nisplus_gethostent_r (struct hostent *host, char *buffer, return NSS_STATUS_TRYAGAIN; } if (niserr2nss (result->status) != NSS_STATUS_SUCCESS) - { - enum nss_status retval = niserr2nss (result->status); - if (retval == NSS_STATUS_TRYAGAIN) - { - *herrnop = NETDB_INTERNAL; - *errnop = errno; - } - return retval; - } + { + enum nss_status retval = niserr2nss (result->status); + if (retval == NSS_STATUS_TRYAGAIN) + { + *herrnop = NETDB_INTERNAL; + *errnop = errno; + } + return retval; + } } else @@ -308,18 +308,18 @@ internal_nisplus_gethostent_r (struct hostent *host, char *buffer, return NSS_STATUS_TRYAGAIN; } if (niserr2nss (result->status) != NSS_STATUS_SUCCESS) - { - enum nss_status retval= niserr2nss (result->status); + { + enum nss_status retval= niserr2nss (result->status); nis_freeresult (result); result = saved_res; - if (retval == NSS_STATUS_TRYAGAIN) - { - *herrnop = NETDB_INTERNAL; + if (retval == NSS_STATUS_TRYAGAIN) + { + *herrnop = NETDB_INTERNAL; *errnop = errno; - } - return retval; - } + } + return retval; + } } if (_res.options & RES_USE_INET6) @@ -330,13 +330,13 @@ internal_nisplus_gethostent_r (struct hostent *host, char *buffer, buflen, errnop, 0); if (parse_res == -1) - { + { nis_freeresult (result); result = saved_res; - *herrnop = NETDB_INTERNAL; + *herrnop = NETDB_INTERNAL; *errnop = ERANGE; - return NSS_STATUS_TRYAGAIN; - } + return NSS_STATUS_TRYAGAIN; + } if (saved_res != NULL) nis_freeresult (saved_res); @@ -435,6 +435,7 @@ internal_gethostbyname2_r (const char *name, int af, struct hostent *host, if (result == NULL) { *errnop = ENOMEM; + *herrnop = NETDB_INTERNAL; return NSS_STATUS_TRYAGAIN; } @@ -444,10 +445,13 @@ internal_gethostbyname2_r (const char *name, int af, struct hostent *host, if (retval == NSS_STATUS_TRYAGAIN) { *errnop = errno; - *herrnop = NETDB_INTERNAL; + *herrnop = TRY_AGAIN; } else - __set_errno (olderr); + { + __set_errno (olderr); + *herrnop = NETDB_INTERNAL; + } nis_freeresult (result); return retval; } @@ -502,7 +506,7 @@ _nss_nisplus_gethostbyname_r (const char *name, struct hostent *host, buflen, errnop, h_errnop, AI_V4MAPPED); if (status == NSS_STATUS_SUCCESS) - return status; + return status; } return internal_gethostbyname2_r (name, AF_INET, host, buffer, diff --git a/nptl/ChangeLog b/nptl/ChangeLog index 7e22d35cbe..b0ba4b4f43 100644 --- a/nptl/ChangeLog +++ b/nptl/ChangeLog @@ -1,3 +1,24 @@ +2009-12-01 Dinakar Guniguntala <dino@in.ibm.com> + + * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.h: Define + FUTEX_WAIT_REQUEUE_PI and FUTEX_CMP_REQUEUE_PI. + * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: If mutex + is a non robust PI mutex, then use FUTEX_CMP_REQUEUE_PI. + * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise. + * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: If mutex + is a non robust PI mutex, then use FUTEX_WAIT_REQUEUE_PI. + * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise. + +2009-12-12 Ulrich Drepper <drepper@redhat.com> + + * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S (sem_timedwait): + Don't update nwaiters after invalid timeout is recognized. + +2009-11-27 Thomas Schwinge <thomas@codesourcery.com> + + * sysdeps/unix/sysv/linux/sh/pt-initfini.c (_init): Don't call + __gmon_start__. + 2009-11-27 Andreas Schwab <schwab@redhat.com> * sysdeps/unix/sysv/linux/x86_64/cancellation.S: Reload diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S index 40fb04b31b..a7ca78f78d 100644 --- a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S +++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S @@ -91,12 +91,17 @@ __pthread_cond_broadcast: 8: cmpl $-1, %edi je 9f - /* XXX: The kernel so far doesn't support requeue to PI futex. */ - /* XXX: The kernel only supports FUTEX_CMP_REQUEUE to the same - type of futex (private resp. shared). */ - testl $(PI_BIT | PS_BIT), MUTEX_KIND(%edi) + /* Do not use requeue for pshared condvars. */ + testl $PS_BIT, MUTEX_KIND(%edi) jne 9f + /* Requeue to a non-robust PI mutex if the PI bit is set and + the robust bit is not set. */ + movl MUTEX_KIND(%edi), %eax + andl $(ROBUST_BIT|PI_BIT), %eax + cmpl $PI_BIT, %eax + je 81f + /* Wake up all threads. */ #ifdef __ASSUME_PRIVATE_FUTEX movl $(FUTEX_CMP_REQUEUE|FUTEX_PRIVATE_FLAG), %ecx @@ -138,6 +143,23 @@ __pthread_cond_broadcast: cfi_restore_state +81: movl $(FUTEX_CMP_REQUEUE_PI|FUTEX_PRIVATE_FLAG), %ecx + movl $SYS_futex, %eax + movl $0x7fffffff, %esi + movl $1, %edx + /* Get the address of the futex involved. */ +# if MUTEX_FUTEX != 0 + addl $MUTEX_FUTEX, %edi +# endif + int $0x80 + + /* For any kind of error, which mainly is EAGAIN, we try again + with WAKE. The general test also covers running on old + kernels. */ + cmpl $0xfffff001, %eax + jb 6b + jmp 9f + /* Initial locking failed. */ 1: #if cond_lock == 0 diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S index 013fcc303f..9fc2cbfeaf 100644 --- a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S +++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S @@ -22,6 +22,7 @@ #include <lowlevellock.h> #include <lowlevelcond.h> #include <kernel-features.h> +#include <pthread-pi-defines.h> #include <pthread-errnos.h> @@ -86,7 +87,17 @@ __pthread_cond_signal: #endif cmpl $-1, dep_mutex-cond_futex(%ebx) sete %cl - subl $1, %ecx + je 8f + + movl dep_mutex-cond_futex(%ebx), %edx + /* Requeue to a non-robust PI mutex if the PI bit is set and + the robust bit is not set. */ + movl MUTEX_KIND(%edx), %eax + andl $(ROBUST_BIT|PI_BIT), %eax + cmpl $PI_BIT, %eax + je 9f + +8: subl $1, %ecx #ifdef __ASSUME_PRIVATE_FUTEX andl $FUTEX_PRIVATE_FLAG, %ecx #else @@ -124,8 +135,34 @@ __pthread_cond_signal: cfi_restore_state -7: /* %ecx should be either FUTEX_WAKE_OP or - FUTEX_WAKE_OP|FUTEX_PRIVATE_FLAG from the previous syscall. */ +9: movl $(FUTEX_CMP_REQUEUE_PI|FUTEX_PRIVATE_FLAG), %ecx + movl $SYS_futex, %eax + movl $1, %edx + xorl %esi, %esi + movl dep_mutex-cond_futex(%ebx), %edi + movl (%ebx), %ebp + /* FIXME: Until Ingo fixes 4G/4G vDSO, 6 arg syscalls are broken for + sysenter. + ENTER_KERNEL */ + int $0x80 + popl %ebp + popl %esi + + leal -cond_futex(%ebx), %edi + + /* For any kind of error, we try again with WAKE. + The general test also covers running on old kernels. */ + cmpl $-4095, %eax + jb 4f + +7: +#ifdef __ASSUME_PRIVATE_FUTEX + andl $FUTEX_PRIVATE_FLAG, %ecx +#else + andl %gs:PRIVATE_FUTEX, %ecx +#endif + orl $FUTEX_WAKE, %ecx + xorl $(FUTEX_WAKE ^ FUTEX_WAKE_OP), %ecx movl $SYS_futex, %eax /* %edx should be 1 already from $FUTEX_WAKE_OP syscall. diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S index 8f5088a460..218762a8ad 100644 --- a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S +++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S @@ -22,6 +22,7 @@ #include <lowlevellock.h> #include <lowlevelcond.h> #include <pthread-errnos.h> +#include <pthread-pi-defines.h> #include <kernel-features.h> @@ -95,7 +96,7 @@ __pthread_cond_timedwait: addl $1, cond_futex(%ebx) addl $(1 << nwaiters_shift), cond_nwaiters(%ebx) -#define FRAME_SIZE 24 +#define FRAME_SIZE 32 subl $FRAME_SIZE, %esp cfi_adjust_cfa_offset(FRAME_SIZE) @@ -107,8 +108,10 @@ __pthread_cond_timedwait: movl %edx, 16(%esp) movl %eax, 20(%esp) + /* Reset the pi-requeued flag. */ +8: movl $0, 24(%esp) /* Get the current time. */ -8: movl %ebx, %edx + movl %ebx, %edx #ifdef __NR_clock_gettime /* Get the clock number. */ movl cond_nwaiters(%ebx), %ebx @@ -158,6 +161,7 @@ __pthread_cond_timedwait: movl %edx, 8(%esp) movl cond_futex(%ebx), %edi + movl %edi, 28(%esp) /* Unlock. */ LOCK @@ -172,13 +176,50 @@ __pthread_cond_timedwait: 4: call __pthread_enable_asynccancel movl %eax, (%esp) - leal 4(%esp), %esi #if FUTEX_PRIVATE_FLAG > 255 xorl %ecx, %ecx #endif cmpl $-1, dep_mutex(%ebx) sete %cl - subl $1, %ecx + je 40f + + movl dep_mutex(%ebx), %edi + /* Requeue to a non-robust PI mutex if the PI bit is set and + the robust bit is not set. */ + movl MUTEX_KIND(%edi), %eax + andl $(ROBUST_BIT|PI_BIT), %eax + cmpl $PI_BIT, %eax + jne 40f + + movl $(FUTEX_WAIT_REQUEUE_PI|FUTEX_PRIVATE_FLAG), %ecx + /* The following only works like this because we only support + two clocks, represented using a single bit. */ + testl $1, cond_nwaiters(%ebx) + /* XXX Need to implement using sete instead of a jump. */ + jne 42f + orl $FUTEX_CLOCK_REALTIME, %ecx + + /* Requeue-PI uses absolute timeout */ +42: leal (%ebp), %esi + movl 28(%esp), %edx + addl $cond_futex, %ebx + movl $SYS_futex, %eax + ENTER_KERNEL + subl $cond_futex, %ebx + movl %eax, %esi + /* Set the pi-requeued flag only if the kernel has returned 0. The + kernel does not hold the mutex on ETIMEDOUT or any other error. */ + cmpl $0, %eax + sete 24(%esp) + je 41f + + /* Normal and PI futexes dont mix. Use normal futex functions only + if the kernel does not support the PI futex functions. */ + cmpl $-ENOSYS, %eax + jne 41f + xorl %ecx, %ecx + +40: subl $1, %ecx #ifdef __ASSUME_PRIVATE_FUTEX andl $FUTEX_PRIVATE_FLAG, %ecx #else @@ -187,7 +228,8 @@ __pthread_cond_timedwait: #if FUTEX_WAIT != 0 addl $FUTEX_WAIT, %ecx #endif - movl %edi, %edx + leal 4(%esp), %esi + movl 28(%esp), %edx addl $cond_futex, %ebx .Ladd_cond_futex: movl $SYS_futex, %eax @@ -196,7 +238,7 @@ __pthread_cond_timedwait: .Lsub_cond_futex: movl %eax, %esi - movl (%esp), %eax +41: movl (%esp), %eax call __pthread_disable_asynccancel .LcleanupEND: @@ -284,10 +326,16 @@ __pthread_cond_timedwait: #endif jne 10f +11: xorl %eax, %eax + /* With requeue_pi, the mutex lock is held in the kernel. */ + movl 24(%esp), %ecx + testl %ecx, %ecx + jnz 26f + /* Remove cancellation handler. */ -11: movl 24+FRAME_SIZE(%esp), %eax + movl 24+FRAME_SIZE(%esp), %eax call __pthread_mutex_cond_lock - addl $FRAME_SIZE, %esp +26: addl $FRAME_SIZE, %esp cfi_adjust_cfa_offset(-FRAME_SIZE); /* We return the result of the mutex_lock operation if it failed. */ @@ -317,6 +365,9 @@ __pthread_cond_timedwait: cfi_restore_state +27: call __pthread_mutex_cond_lock_adjust + jmp 26b + /* Initial locking failed. */ 1: #if cond_lock == 0 diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S index 776b95e40c..b3b8bc4be5 100644 --- a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S +++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S @@ -22,6 +22,8 @@ #include <lowlevellock.h> #include <lowlevelcond.h> #include <tcb-offsets.h> +#include <pthread-errnos.h> +#include <pthread-pi-defines.h> #include <kernel-features.h> @@ -43,6 +45,9 @@ __pthread_cond_wait: cfi_lsda(DW_EH_PE_udata4, .LexceptSTART) #endif + pushl %ebp + cfi_adjust_cfa_offset(4) + cfi_rel_offset(%ebp, 0) pushl %edi cfi_adjust_cfa_offset(4) cfi_rel_offset(%edi, 0) @@ -55,7 +60,7 @@ __pthread_cond_wait: cfi_remember_state xorl %esi, %esi - movl 16(%esp), %ebx + movl 20(%esp), %ebx /* Get internal lock. */ movl $1, %edx @@ -71,7 +76,7 @@ __pthread_cond_wait: /* Store the reference to the mutex. If there is already a different value in there this is a bad user bug. */ 2: cmpl $-1, dep_mutex(%ebx) - movl 20(%esp), %eax + movl 24(%esp), %eax je 15f movl %eax, dep_mutex(%ebx) @@ -87,7 +92,7 @@ __pthread_cond_wait: addl $1, cond_futex(%ebx) addl $(1 << nwaiters_shift), cond_nwaiters(%ebx) -#define FRAME_SIZE 16 +#define FRAME_SIZE 20 subl $FRAME_SIZE, %esp cfi_adjust_cfa_offset(FRAME_SIZE) @@ -99,7 +104,9 @@ __pthread_cond_wait: movl %edx, 8(%esp) movl %eax, 12(%esp) -8: movl cond_futex(%ebx), %edi + /* Reset the pi-requeued flag. */ +8: movl $0, 16(%esp) + movl cond_futex(%ebx), %ebp /* Unlock. */ LOCK @@ -114,12 +121,39 @@ __pthread_cond_wait: 4: call __pthread_enable_asynccancel movl %eax, (%esp) -#if FUTEX_PRIVATE_FLAG > 255 xorl %ecx, %ecx -#endif cmpl $-1, dep_mutex(%ebx) sete %cl - subl $1, %ecx + je 18f + + movl dep_mutex(%ebx), %edi + /* Requeue to a non-robust PI mutex if the PI bit is set and + the robust bit is not set. */ + movl MUTEX_KIND(%edi), %eax + andl $(ROBUST_BIT|PI_BIT), %eax + cmpl $PI_BIT, %eax + jne 18f + + movl $(FUTEX_WAIT_REQUEUE_PI|FUTEX_PRIVATE_FLAG), %ecx + movl %ebp, %edx + xorl %esi, %esi + addl $cond_futex, %ebx + movl $SYS_futex, %eax + ENTER_KERNEL + subl $cond_futex, %ebx + /* Set the pi-requeued flag only if the kernel has returned 0. The + kernel does not hold the mutex on error. */ + cmpl $0, %eax + sete 16(%esp) + je 19f + + /* Normal and PI futexes dont mix. Use normal futex functions only + if the kernel does not support the PI futex functions. */ + cmpl $-ENOSYS, %eax + jne 19f + xorl %ecx, %ecx + +18: subl $1, %ecx #ifdef __ASSUME_PRIVATE_FUTEX andl $FUTEX_PRIVATE_FLAG, %ecx #else @@ -128,7 +162,7 @@ __pthread_cond_wait: #if FUTEX_WAIT != 0 addl $FUTEX_WAIT, %ecx #endif - movl %edi, %edx + movl %ebp, %edx addl $cond_futex, %ebx .Ladd_cond_futex: movl $SYS_futex, %eax @@ -136,7 +170,7 @@ __pthread_cond_wait: subl $cond_futex, %ebx .Lsub_cond_futex: - movl (%esp), %eax +19: movl (%esp), %eax call __pthread_disable_asynccancel .LcleanupEND: @@ -212,9 +246,15 @@ __pthread_cond_wait: #endif jne 10f -11: movl 20+FRAME_SIZE(%esp), %eax + /* With requeue_pi, the mutex lock is held in the kernel. */ +11: xorl %eax, %eax + movl 16(%esp), %ecx + testl %ecx, %ecx + jnz 20f + + movl 24+FRAME_SIZE(%esp), %eax call __pthread_mutex_cond_lock - addl $FRAME_SIZE, %esp +20: addl $FRAME_SIZE, %esp cfi_adjust_cfa_offset(-FRAME_SIZE); 14: popl %ebx @@ -226,12 +266,19 @@ __pthread_cond_wait: popl %edi cfi_adjust_cfa_offset(-4) cfi_restore(%edi) + popl %ebp + cfi_adjust_cfa_offset(-4) + cfi_restore(%ebp) /* We return the result of the mutex_lock operation. */ ret cfi_restore_state +21: call __pthread_mutex_cond_lock_adjust + xorl %eax, %eax + jmp 20b + /* Initial locking failed. */ 1: #if cond_lock == 0 @@ -484,7 +531,7 @@ __condvar_w_cleanup: movl $0x7fffffff, %edx ENTER_KERNEL -5: movl 20+FRAME_SIZE(%esp), %eax +5: movl 24+FRAME_SIZE(%esp), %eax call __pthread_mutex_cond_lock movl %esi, (%esp) diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S index 13a36d64cc..18013a8df4 100644 --- a/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S +++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S @@ -1,4 +1,4 @@ -/* Copyright (C) 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. +/* Copyright (C) 2002, 2003, 2004, 2005, 2007, 2009 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -131,10 +131,10 @@ sem_timedwait: xorl %eax, %eax -10: LOCK + LOCK decl NWAITERS(%ebx) - addl $12, %esp +10: addl $12, %esp .Ladd_esp: popl %ebx .Lpop_ebx: @@ -268,19 +268,19 @@ sem_wait_cleanup: .byte 14 # DW_CFA_def_cfa_offset .uleb128 8 .byte 0x86 # DW_CFA_offset %esi - .uleb128 2 + .uleb128 2 .byte 4 # DW_CFA_advance_loc4 .long .Lpush_edi-.Lpush_esi .byte 14 # DW_CFA_def_cfa_offset .uleb128 12 .byte 0x87 # DW_CFA_offset %edi - .uleb128 3 + .uleb128 3 .byte 4 # DW_CFA_advance_loc4 .long .Lpush_ebx-.Lpush_edi .byte 14 # DW_CFA_def_cfa_offset .uleb128 16 .byte 0x83 # DW_CFA_offset %ebx - .uleb128 4 + .uleb128 4 .byte 4 # DW_CFA_advance_loc4 .long .Lsub_esp-.Lpush_ebx .byte 14 # DW_CFA_def_cfa_offset @@ -309,11 +309,11 @@ sem_wait_cleanup: .byte 14 # DW_CFA_def_cfa_offset .uleb128 28 .byte 0x86 # DW_CFA_offset %esi - .uleb128 2 + .uleb128 2 .byte 0x87 # DW_CFA_offset %edi - .uleb128 3 + .uleb128 3 .byte 0x83 # DW_CFA_offset %ebx - .uleb128 4 + .uleb128 4 .align 4 .LENDFDE: diff --git a/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h b/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h index 66e0e628fd..4bb585af3b 100644 --- a/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h +++ b/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h @@ -54,6 +54,8 @@ #define FUTEX_TRYLOCK_PI 8 #define FUTEX_WAIT_BITSET 9 #define FUTEX_WAKE_BITSET 10 +#define FUTEX_WAIT_REQUEUE_PI 11 +#define FUTEX_CMP_REQUEUE_PI 12 #define FUTEX_PRIVATE_FLAG 128 #define FUTEX_CLOCK_REALTIME 256 diff --git a/nptl/sysdeps/unix/sysv/linux/sh/pt-initfini.c b/nptl/sysdeps/unix/sysv/linux/sh/pt-initfini.c index 5391d5cc8b..82c97c352a 100644 --- a/nptl/sysdeps/unix/sysv/linux/sh/pt-initfini.c +++ b/nptl/sysdeps/unix/sysv/linux/sh/pt-initfini.c @@ -1,5 +1,5 @@ -/* Special .init and .fini section support for SH. NPTL version. - Copyright (C) 2003 Free Software Foundation, Inc. +/* Special .init and .fini section support for SH. NPTL version. + Copyright (C) 2003, 2009 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it @@ -62,19 +62,12 @@ _init:\n\ mov.l .L24,r1\n\ add r0,r1\n\ jsr @r1\n\ - nop\n\ - mova .L23,r0\n\ - mov.l .L23,r1\n\ - add r0,r1\n\ - jsr @r1\n\ mov r15,r14\n\ bra 1f\n\ nop\n\ .align 2\n\ .L22:\n\ .long _GLOBAL_OFFSET_TABLE_\n\ -.L23:\n\ - .long __gmon_start__@PLT\n\ .L24:\n\ .long __pthread_initialize_minimal_internal@PLT\n\ 1:\n\ @@ -91,16 +84,6 @@ _init:\n\ rts \n\ mov.l @r15+,r12\n\ END_INIT\n\ - .section .text\n\ - .align 5\n\ - .weak __gmon_start__\n\ - .type __gmon_start__,@function\n\ -__gmon_start__:\n\ - mov.l r14,@-r15\n\ - mov r15,r14\n\ - mov r14,r15\n\ - rts \n\ - mov.l @r15+,r14\n\ \n\ /*@_init_EPILOG_ENDS*/\n\ \n\ diff --git a/nss/nss_files/files-hosts.c b/nss/nss_files/files-hosts.c index 68fb969937..e5f5b48b72 100644 --- a/nss/nss_files/files-hosts.c +++ b/nss/nss_files/files-hosts.c @@ -423,6 +423,11 @@ _nss_files_gethostbyname4_r (const char *name, struct gaih_addrtuple **pat, if (! keep_stream) internal_endent (); } + else if (status == NSS_STATUS_TRYAGAIN) + { + *errnop = errno; + *herrnop = TRY_AGAIN; + } else { *errnop = errno; diff --git a/posix/unistd.h b/posix/unistd.h index d9ecb5e788..b46a885afa 100644 --- a/posix/unistd.h +++ b/posix/unistd.h @@ -544,47 +544,47 @@ extern char **environ; /* Replace the current process, executing PATH with arguments ARGV and environment ENVP. ARGV and ENVP are terminated by NULL pointers. */ extern int execve (__const char *__path, char *__const __argv[], - char *__const __envp[]) __THROW __nonnull ((1)); + char *__const __envp[]) __THROW __nonnull ((1, 2)); #ifdef __USE_XOPEN2K8 /* Execute the file FD refers to, overlaying the running program image. ARGV and ENVP are passed to the new program, as for `execve'. */ extern int fexecve (int __fd, char *__const __argv[], char *__const __envp[]) - __THROW; + __THROW __nonnull ((2)); #endif /* Execute PATH with arguments ARGV and environment from `environ'. */ extern int execv (__const char *__path, char *__const __argv[]) - __THROW __nonnull ((1)); + __THROW __nonnull ((1, 2)); /* Execute PATH with all arguments after PATH until a NULL pointer, and the argument after that for environment. */ extern int execle (__const char *__path, __const char *__arg, ...) - __THROW __nonnull ((1)); + __THROW __nonnull ((1, 2)); /* Execute PATH with all arguments after PATH until a NULL pointer and environment from `environ'. */ extern int execl (__const char *__path, __const char *__arg, ...) - __THROW __nonnull ((1)); + __THROW __nonnull ((1, 2)); /* Execute FILE, searching in the `PATH' environment variable if it contains no slashes, with arguments ARGV and environment from `environ'. */ extern int execvp (__const char *__file, char *__const __argv[]) - __THROW __nonnull ((1)); + __THROW __nonnull ((1, 2)); /* Execute FILE, searching in the `PATH' environment variable if it contains no slashes, with all arguments after FILE until a NULL pointer and environment from `environ'. */ extern int execlp (__const char *__file, __const char *__arg, ...) - __THROW __nonnull ((1)); + __THROW __nonnull ((1, 2)); #ifdef __USE_GNU /* Execute FILE, searching in the `PATH' environment variable if it contains no slashes, with arguments ARGV and environment from `environ'. */ extern int execvpe (__const char *__file, char *__const __argv[], char *__const __envp[]) - __THROW __nonnull ((1)); + __THROW __nonnull ((1, 2)); #endif diff --git a/sysdeps/i386/i686/multiarch/strcspn.S b/sysdeps/i386/i686/multiarch/strcspn.S index 73e7eb45a8..b2310e4a8b 100644 --- a/sysdeps/i386/i686/multiarch/strcspn.S +++ b/sysdeps/i386/i686/multiarch/strcspn.S @@ -23,7 +23,7 @@ #ifdef HAVE_SSE4_SUPPORT #include <sysdep.h> -#include <ifunc-defines.h> +#include <init-arch.h> #ifdef USE_AS_STRPBRK #define STRCSPN_SSE42 __strpbrk_sse42 @@ -64,7 +64,7 @@ ENTRY(STRCSPN) jne 1f call __init_cpu_features 1: leal STRCSPN_IA32@GOTOFF(%ebx), %eax - testl $(1<<20), CPUID_OFFSET+COMMON_CPUID_INDEX_1*CPUID_SIZE+CPUID_ECX_OFFSET+__cpu_features@GOTOFF(%ebx) + testl $bit_SSE4_2, CPUID_OFFSET+index_SSE4_2+__cpu_features@GOTOFF(%ebx) jz 2f leal STRCSPN_SSE42@GOTOFF(%ebx), %eax 2: popl %ebx @@ -80,7 +80,7 @@ ENTRY(STRCSPN) jne 1f call __init_cpu_features 1: leal STRCSPN_IA32, %eax - testl $(1<<20), CPUID_OFFSET+COMMON_CPUID_INDEX_1*CPUID_SIZE+CPUID_ECX_OFFSET+__cpu_features + testl $bit_SSE4_2, CPUID_OFFSET+index_SSE4_2+__cpu_features jz 2f leal STRCSPN_SSE42, %eax 2: ret diff --git a/sysdeps/i386/i686/multiarch/strlen.S b/sysdeps/i386/i686/multiarch/strlen.S index 0c1e8646ff..9786add745 100644 --- a/sysdeps/i386/i686/multiarch/strlen.S +++ b/sysdeps/i386/i686/multiarch/strlen.S @@ -19,7 +19,7 @@ 02111-1307 USA. */ #include <sysdep.h> -#include <ifunc-defines.h> +#include <init-arch.h> /* Define multiple versions only for the definition in libc and for the DSO. In static binaries, we need strlen before the initialization @@ -46,7 +46,7 @@ ENTRY(strlen) jne 1f call __init_cpu_features 1: leal __strlen_ia32@GOTOFF(%ebx), %eax - testl $(1<<26), CPUID_OFFSET+COMMON_CPUID_INDEX_1*CPUID_SIZE+CPUID_EDX_OFFSET+__cpu_features@GOTOFF(%ebx) + testl $bit_SSE2, CPUID_OFFSET+index_SSE2+__cpu_features@GOTOFF(%ebx) jz 2f leal __strlen_sse2@GOTOFF(%ebx), %eax 2: popl %ebx diff --git a/sysdeps/i386/i686/multiarch/strspn.S b/sysdeps/i386/i686/multiarch/strspn.S index f306d2d1fb..7fe6f97f41 100644 --- a/sysdeps/i386/i686/multiarch/strspn.S +++ b/sysdeps/i386/i686/multiarch/strspn.S @@ -23,7 +23,7 @@ #ifdef HAVE_SSE4_SUPPORT #include <sysdep.h> -#include <ifunc-defines.h> +#include <init-arch.h> /* Define multiple versions only for the definition in libc. */ #ifndef NOT_IN_libc @@ -49,7 +49,7 @@ ENTRY(strspn) jne 1f call __init_cpu_features 1: leal __strspn_ia32@GOTOFF(%ebx), %eax - testl $(1<<20), CPUID_OFFSET+COMMON_CPUID_INDEX_1*CPUID_SIZE+CPUID_ECX_OFFSET+__cpu_features@GOTOFF(%ebx) + testl $bit_SSE4_2, CPUID_OFFSET+index_SSE4_2+__cpu_features@GOTOFF(%ebx) jz 2f leal __strspn_sse42@GOTOFF(%ebx), %eax 2: popl %ebx @@ -65,7 +65,7 @@ ENTRY(strspn) 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 + testl $index_SSE2, CPUID_OFFSET+index_SSE4_2+__cpu_features jz 2f leal __strspn_sse42, %eax 2: ret diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c index a788d18fee..62c38f69be 100644 --- a/sysdeps/posix/getaddrinfo.c +++ b/sysdeps/posix/getaddrinfo.c @@ -719,13 +719,8 @@ gaih_inet (const char *name, const struct gaih_service *service, if (status != NSS_STATUS_TRYAGAIN || rc != ERANGE || herrno != NETDB_INTERNAL) { - if (herrno == NETDB_INTERNAL) - { - __set_h_errno (herrno); - _res.options = old_res_options; - return -EAI_SYSTEM; - } - if (herrno == TRY_AGAIN) + if (status == NSS_STATUS_TRYAGAIN + && herrno == TRY_AGAIN) no_data = EAI_AGAIN; else no_data = herrno == NO_DATA; diff --git a/sysdeps/s390/s390-32/dl-trampoline.S b/sysdeps/s390/s390-32/dl-trampoline.S index fbbbc189db..cedef46382 100644 --- a/sysdeps/s390/s390-32/dl-trampoline.S +++ b/sysdeps/s390/s390-32/dl-trampoline.S @@ -45,6 +45,7 @@ _dl_runtime_resolve: stm %r2,%r5,32(%r15) # save registers st %r14,8(%r15) + cfi_offset (r14, -88) lr %r0,%r15 # create stack frame ahi %r15,-96 cfi_adjust_cfa_offset (96) @@ -76,6 +77,11 @@ _dl_runtime_profile: st %r6,8(%r15) st %r12,12(%r15) st %r14,16(%r15) + cfi_offset (r6, -64) + cfi_offset (f0, -40) + cfi_offset (f2, -32) + cfi_offset (r12, -84) + cfi_offset (r14, -80) lr %r12,%r15 # create stack frame cfi_def_cfa_register (12) ahi %r15,-96 diff --git a/sysdeps/s390/s390-32/s390-mcount.S b/sysdeps/s390/s390-32/s390-mcount.S index 6d11f9bbdb..aae433bbc5 100644 --- a/sysdeps/s390/s390-32/s390-mcount.S +++ b/sysdeps/s390/s390-32/s390-mcount.S @@ -50,11 +50,15 @@ ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(_mcount) ASM_TYPE_DIRECTIVE(C_SYMBOL_NAME(_mcount), @function) + cfi_startproc .align ALIGNARG(4) C_LABEL(_mcount) /* Save the caller-clobbered registers. */ ahi %r15,-128 + cfi_adjust_cfa_offset (128) stm %r14,%r5,96(%r15) + cfi_offset (r14, 0) + cfi_offset (r15, 4) l %r2,132(%r15) # callers address = first parameter la %r2,0(%r2) # clear bit 0 la %r3,0(%r14) # callees address = second parameter @@ -77,7 +81,9 @@ C_LABEL(_mcount) */ lm %r14,%r5,96(%r15) ahi %r15,128 + cfi_adjust_cfa_offset (-128) br %r14 + cfi_endproc ASM_SIZE_DIRECTIVE(C_SYMBOL_NAME(_mcount)) #undef mcount diff --git a/sysdeps/s390/s390-64/dl-trampoline.S b/sysdeps/s390/s390-64/dl-trampoline.S index 72043c9779..b49c68108d 100644 --- a/sysdeps/s390/s390-64/dl-trampoline.S +++ b/sysdeps/s390/s390-64/dl-trampoline.S @@ -42,6 +42,7 @@ _dl_runtime_resolve: stmg 2,5,64(15) # save registers stg 14,96(15) + cfi_offset (r14, -64) lgr 0,15 # create stack frame aghi 15,-160 cfi_adjust_cfa_offset (160) @@ -72,6 +73,13 @@ _dl_runtime_profile: stg %r6,16(%r15) stg %r12,24(%r15) stg %r14,32(%r15) + cfi_offset (r6, -96) + cfi_offset (f0, -56) + cfi_offset (f2, -48) + cfi_offset (f4, -40) + cfi_offset (f6, -32) + cfi_offset (r12, -136) + cfi_offset (r14, -128) lgr %r12,%r15 # create stack frame cfi_def_cfa_register (12) aghi %r15,-160 diff --git a/sysdeps/s390/s390-64/s390x-mcount.S b/sysdeps/s390/s390-64/s390x-mcount.S index 78b55218a9..e866c3f5a9 100644 --- a/sysdeps/s390/s390-64/s390x-mcount.S +++ b/sysdeps/s390/s390-64/s390x-mcount.S @@ -46,11 +46,15 @@ ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(_mcount) ASM_TYPE_DIRECTIVE(C_SYMBOL_NAME(_mcount), @function) + cfi_startproc .align ALIGNARG(4) C_LABEL(_mcount) /* Save the caller-clobbered registers. */ aghi %r15,-224 + cfi_adjust_cfa_offset (224) stmg %r14,%r5,160(%r15) + cfi_offset (r14, 0) + cfi_offset (r15, 8) lg %r2,232(%r15) # callers address = first parameter la %r2,0(%r2) # clear bit 0 la %r3,0(%r14) # callees address = second parameter @@ -65,7 +69,9 @@ C_LABEL(_mcount) return value. */ lmg %r14,%r5,160(%r15) aghi %r15,224 + cfi_adjust_cfa_offset (-224) br %r14 + cfi_endproc ASM_SIZE_DIRECTIVE(C_SYMBOL_NAME(_mcount)) #undef mcount diff --git a/sysdeps/sh/elf/initfini.c b/sysdeps/sh/elf/initfini.c index 6c8ed85292..2ae328caa2 100644 --- a/sysdeps/sh/elf/initfini.c +++ b/sysdeps/sh/elf/initfini.c @@ -1,5 +1,5 @@ /* Special .init and .fini section support for SH. - Copyright (C) 2000, 2002 Free Software Foundation, Inc. + Copyright (C) 2000, 2002, 2009 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -47,52 +47,48 @@ __asm__ ("\ \n\ #include \"defs.h\"\n\ -#define SHARED\n\ \n\ /*@HEADER_ENDS*/\n\ \n\ /*@TESTS_BEGIN*/\n\ -\n\ + .align 5\n\ /*@TESTS_END*/\n\ \n\ /*@_init_PROLOG_BEGINS*/\n\ - .section .init\n\ + .section .init,\"ax\",@progbits\n\ .align 5\n\ .global _init\n\ - .type _init,@function\n\ + .type _init, @function\n\ _init:\n\ mov.l r12,@-r15\n\ + mova .L12,r0\n\ + mov.l .L12,r12\n\ mov.l r14,@-r15\n\ - sts.l pr,@-r15\n\ -#ifdef SHARED\n\ - mova .L22,r0\n\ - mov.l .L22,r12\n\ add r0,r12\n\ - mova .L23,r0\n\ - mov.l .L23,r1\n\ - add r0,r1\n\ -#else\n\ - mov.l .L23,r1\n\ -#endif\n\ - jsr @r1\n\ - mov r15,r14\n\ + mov.l .L13,r0\n\ + sts.l pr,@-r15\n\ + mov.l @(r0,r12),r1\n\ + tst r1,r1\n\ + bt/s .L8\n\ + mov r15,r14\n\ + mov.l .L14,r1\n\ + bsrf r1\n\ +.LPCS0:\n\ + nop\n\ +.L8:\n\ bra 1f\n\ - nop\n\ + nop\n\ .align 2\n\ -#ifdef SHARED\n\ -.L22:\n\ +.L12:\n\ .long _GLOBAL_OFFSET_TABLE_\n\ -.L23:\n\ - .long __gmon_start__@PLT\n\ -#else\n\ -.L23:\n\ - .long __gmon_start__\n\ -#endif\n\ +.L13:\n\ + .long __gmon_start__@GOT\n\ +.L14:\n\ + .long __gmon_start__@PLT-(.LPCS0+2-(.))\n\ 1:\n\ ALIGN\n\ END_INIT\n\ \n\ - \n\ /*@_init_PROLOG_ENDS*/\n\ \n\ /*@_init_EPILOG_BEGINS*/\n\ @@ -100,60 +96,58 @@ _init:\n\ mov r14,r15\n\ lds.l @r15+,pr\n\ mov.l @r15+,r14\n\ - rts \n\ mov.l @r15+,r12\n\ - END_INIT\n\ - .section .text\n\ - .align 5\n\ - .weak __gmon_start__\n\ - .type __gmon_start__,@function\n\ -__gmon_start__:\n\ - mov.l r14,@-r15\n\ - mov r15,r14\n\ - mov r14,r15\n\ rts \n\ - mov.l @r15+,r14\n\ - \n\ + nop\n\ + END_INIT\n\ +\n\ /*@_init_EPILOG_ENDS*/\n\ \n\ /*@_fini_PROLOG_BEGINS*/\n\ - .section .fini\n\ + .section .fini,\"ax\",@progbits\n\ .align 5\n\ .global _fini\n\ - .type _fini,@function\n\ + .type _fini, @function\n\ _fini:\n\ mov.l r12,@-r15\n\ + mova .L19,r0\n\ mov.l r14,@-r15\n\ sts.l pr,@-r15\n\ -#ifdef SHARED\n\ - mova .L27,r0\n\ - mov.l .L27,r12\n\ - add r0,r12\n\ -#endif\n\ + mov.l .L19,r12\n\ mov r15,r14\n\ + add r0,r12\n\ + bra 0f\n\ + nop\n\ + .align 2\n\ +.L19:\n\ + .long _GLOBAL_OFFSET_TABLE_\n\ +0:\n\ ALIGN\n\ END_FINI\n\ -#ifdef SHARED\n\ +\n\ +/*@_fini_PROLOG_ENDS*/\n\ + mov.l .L20,r1\n\ + bsrf r1\n\ +.LPCS1:\n\ + nop\n\ bra 1f\n\ - nop\n\ - .align 2\n\ -.L27:\n\ - .long _GLOBAL_OFFSET_TABLE_\n\ -#endif\n\ + nop\n\ + .align 2\n\ +.L20:\n\ + .long i_am_not_a_leaf@PLT-(.LPCS1+2-(.))\n\ 1:\n\ -/*@_fini_PROLOG_ENDS*/\n\ -\n\ /*@_fini_EPILOG_BEGINS*/\n\ .section .fini\n\ mov r14,r15\n\ lds.l @r15+,pr\n\ mov.l @r15+,r14\n\ - rts \n\ mov.l @r15+,r12\n\ -\n\ + rts \n\ + nop\n\ END_FINI\n\ - \n\ +\n\ /*@_fini_EPILOG_ENDS*/\n\ \n\ -/*@TRAILER_BEGINS*/\ +/*@TRAILER_BEGINS*/\n\ + .weak __gmon_start__\n\ "); diff --git a/sysdeps/sh/sh4/fpu/fpu_control.h b/sysdeps/sh/sh4/fpu/fpu_control.h index 43eb9e5492..d1be46d12f 100644 --- a/sysdeps/sh/sh4/fpu/fpu_control.h +++ b/sysdeps/sh/sh4/fpu/fpu_control.h @@ -1,5 +1,5 @@ /* FPU control word definitions. SH version. - Copyright (C) 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2009 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -45,6 +45,8 @@ typedef unsigned int fpu_control_t; #define _FPU_GETCW(cw) __asm__ ("sts fpscr,%0" : "=r" (cw)) #if defined __GNUC__ +/* GCC provides this function. */ +extern void __set_fpscr (unsigned long); #define _FPU_SETCW(cw) __set_fpscr ((cw)) #else #define _FPU_SETCW(cw) __asm__ ("lds %0,fpscr" : : "r" (cw)) diff --git a/sysdeps/unix/sysv/linux/Versions b/sysdeps/unix/sysv/linux/Versions index 50c70513ff..f09ef6d983 100644 --- a/sysdeps/unix/sysv/linux/Versions +++ b/sysdeps/unix/sysv/linux/Versions @@ -146,6 +146,8 @@ libc { _sys_errlist; sys_errlist; _sys_nerr; sys_nerr; ntp_gettimex; + + recvmmsg; } GLIBC_PRIVATE { # functions used in other libraries diff --git a/sysdeps/unix/sysv/linux/bits/sched.h b/sysdeps/unix/sysv/linux/bits/sched.h index 18269a99b9..8ba9eed6f0 100644 --- a/sysdeps/unix/sysv/linux/bits/sched.h +++ b/sysdeps/unix/sysv/linux/bits/sched.h @@ -27,11 +27,14 @@ /* Scheduling algorithms. */ -#define SCHED_OTHER 0 -#define SCHED_FIFO 1 -#define SCHED_RR 2 +#define SCHED_OTHER 0 +#define SCHED_FIFO 1 +#define SCHED_RR 2 #ifdef __USE_GNU -# define SCHED_BATCH 3 +# define SCHED_BATCH 3 +# define SCHED_IDLE 5 + +# define SCHED_RESET_ON_FORK 0x40000000 #endif #ifdef __USE_MISC diff --git a/sysdeps/unix/sysv/linux/bits/socket.h b/sysdeps/unix/sysv/linux/bits/socket.h index f23b338a35..aa78087a72 100644 --- a/sysdeps/unix/sysv/linux/bits/socket.h +++ b/sysdeps/unix/sysv/linux/bits/socket.h @@ -234,8 +234,8 @@ enum #define MSG_MORE MSG_MORE MSG_CMSG_CLOEXEC = 0x40000000 /* Set close_on_exit for file - descriptor received through - SCM_RIGHTS. */ + descriptor received through + SCM_RIGHTS. */ #define MSG_CMSG_CLOEXEC MSG_CMSG_CLOEXEC }; @@ -259,6 +259,15 @@ struct msghdr int msg_flags; /* Flags on received message. */ }; +#ifdef __USE_GNU +/* For `recvmmsg'. */ +struct mmsghdr + { + struct msghdr msg_hdr; /* Actual message header. */ + unsigned int msg_len; /* Number of received bytes for the entry. */ + }; +#endif + /* Structure used for storage of ancillary data object information. */ struct cmsghdr { @@ -403,4 +412,18 @@ struct linger int l_linger; /* Time to linger. */ }; + +__BEGIN_DECLS + +/* Receive a message as described by MESSAGE from socket FD. + Returns the number of bytes read or -1 for errors. + + This function is a cancellation point and therefore not marked with + __THROW. */ +extern int recvmmsg (int __fd, struct mmsghdr *__vmessages, + unsigned int __vlen, int __flags, + __const struct timespec *__tmo); + +__END_DECLS + #endif /* bits/socket.h */ diff --git a/sysdeps/unix/sysv/linux/i386/bits/fcntl.h b/sysdeps/unix/sysv/linux/i386/bits/fcntl.h index f57a461b67..8eaf7c368b 100644 --- a/sysdeps/unix/sysv/linux/i386/bits/fcntl.h +++ b/sysdeps/unix/sysv/linux/i386/bits/fcntl.h @@ -29,7 +29,7 @@ /* open/fcntl - O_SYNC is only implemented on blocks devices and on files - located on an ext2 file system */ + located on a few file systems. */ #define O_ACCMODE 0003 #define O_RDONLY 00 #define O_WRONLY 01 @@ -41,7 +41,7 @@ #define O_APPEND 02000 #define O_NONBLOCK 04000 #define O_NDELAY O_NONBLOCK -#define O_SYNC 010000 +#define O_SYNC 04010000 #define O_FSYNC O_SYNC #define O_ASYNC 020000 @@ -57,7 +57,7 @@ We define the symbols here but let them do the same as O_SYNC since this is a superset. */ #if defined __USE_POSIX199309 || defined __USE_UNIX98 -# define O_DSYNC O_SYNC /* Synchronize data. */ +# define O_DSYNC 010000 /* Synchronize data. */ # define O_RSYNC O_SYNC /* Synchronize read operations. */ #endif diff --git a/sysdeps/unix/sysv/linux/ia64/bits/fcntl.h b/sysdeps/unix/sysv/linux/ia64/bits/fcntl.h index a98ca3a208..c65a11e1ca 100644 --- a/sysdeps/unix/sysv/linux/ia64/bits/fcntl.h +++ b/sysdeps/unix/sysv/linux/ia64/bits/fcntl.h @@ -28,7 +28,7 @@ #endif /* open/fcntl - O_SYNC is only implemented on blocks devices and on files - located on an ext2 file system */ + located on a few file systems. */ #define O_ACCMODE 0003 #define O_RDONLY 00 #define O_WRONLY 01 @@ -40,7 +40,7 @@ #define O_APPEND 02000 #define O_NONBLOCK 04000 #define O_NDELAY O_NONBLOCK -#define O_SYNC 010000 +#define O_SYNC 04010000 #define O_FSYNC O_SYNC #define O_ASYNC 020000 @@ -61,7 +61,7 @@ We define the symbols here but let them do the same as O_SYNC since this is a superset. */ #if defined __USE_POSIX199309 || defined __USE_UNIX98 -# define O_DSYNC O_SYNC /* Synchronize data. */ +# define O_DSYNC 010000 /* Synchronize data. */ # define O_RSYNC O_SYNC /* Synchronize read operations. */ #endif diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h b/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h index 010483a945..40fe1e50d7 100644 --- a/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h +++ b/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h @@ -29,7 +29,7 @@ /* open/fcntl - O_SYNC is only implemented on blocks devices and on files - located on an ext2 file system */ + located on a few file systems. */ #define O_ACCMODE 0003 #define O_RDONLY 00 #define O_WRONLY 01 @@ -41,7 +41,7 @@ #define O_APPEND 02000 #define O_NONBLOCK 04000 #define O_NDELAY O_NONBLOCK -#define O_SYNC 010000 +#define O_SYNC 04010000 #define O_FSYNC O_SYNC #define O_ASYNC 020000 @@ -61,7 +61,7 @@ We define the symbols here but let them do the same as O_SYNC since this is a superset. */ #if defined __USE_POSIX199309 || defined __USE_UNIX98 -# define O_DSYNC O_SYNC /* Synchronize data. */ +# define O_DSYNC 010000 /* Synchronize data. */ # define O_RSYNC O_SYNC /* Synchronize read operations. */ #endif diff --git a/sysdeps/unix/sysv/linux/ptsname.c b/sysdeps/unix/sysv/linux/ptsname.c index 129d09085e..1f1c64bc8c 100644 --- a/sysdeps/unix/sysv/linux/ptsname.c +++ b/sysdeps/unix/sysv/linux/ptsname.c @@ -128,7 +128,7 @@ __ptsname_internal (int fd, char *buf, size_t buflen, struct stat64 *stp) } ptyno = minor (stp->st_rdev); -#if __LINUX_KERNEL_VERSION >= 131443 +#if __LINUX_KERNEL_VERSION < 131443 /* This is for the old BSD pseudo terminals. As of Linux 2.1.115 these are no longer supported. */ if (major (stp->st_rdev) == 4) diff --git a/sysdeps/unix/sysv/linux/s390/bits/fcntl.h b/sysdeps/unix/sysv/linux/s390/bits/fcntl.h index 8815eca868..c9e6a4504b 100644 --- a/sysdeps/unix/sysv/linux/s390/bits/fcntl.h +++ b/sysdeps/unix/sysv/linux/s390/bits/fcntl.h @@ -29,7 +29,7 @@ /* open/fcntl - O_SYNC is only implemented on blocks devices and on files - located on an ext2 file system */ + located on a few file systems. */ #define O_ACCMODE 0003 #define O_RDONLY 00 #define O_WRONLY 01 @@ -41,7 +41,7 @@ #define O_APPEND 02000 #define O_NONBLOCK 04000 #define O_NDELAY O_NONBLOCK -#define O_SYNC 010000 +#define O_SYNC 04010000 #define O_FSYNC O_SYNC #define O_ASYNC 020000 @@ -66,7 +66,7 @@ We define the symbols here but let them do the same as O_SYNC since this is a superset. */ #if defined __USE_POSIX199309 || defined __USE_UNIX98 -# define O_DSYNC O_SYNC /* Synchronize data. */ +# define O_DSYNC 010000 /* Synchronize data. */ # define O_RSYNC O_SYNC /* Synchronize read operations. */ #endif diff --git a/sysdeps/unix/sysv/linux/sh/bits/fcntl.h b/sysdeps/unix/sysv/linux/sh/bits/fcntl.h index f57a461b67..8eaf7c368b 100644 --- a/sysdeps/unix/sysv/linux/sh/bits/fcntl.h +++ b/sysdeps/unix/sysv/linux/sh/bits/fcntl.h @@ -29,7 +29,7 @@ /* open/fcntl - O_SYNC is only implemented on blocks devices and on files - located on an ext2 file system */ + located on a few file systems. */ #define O_ACCMODE 0003 #define O_RDONLY 00 #define O_WRONLY 01 @@ -41,7 +41,7 @@ #define O_APPEND 02000 #define O_NONBLOCK 04000 #define O_NDELAY O_NONBLOCK -#define O_SYNC 010000 +#define O_SYNC 04010000 #define O_FSYNC O_SYNC #define O_ASYNC 020000 @@ -57,7 +57,7 @@ We define the symbols here but let them do the same as O_SYNC since this is a superset. */ #if defined __USE_POSIX199309 || defined __USE_UNIX98 -# define O_DSYNC O_SYNC /* Synchronize data. */ +# define O_DSYNC 010000 /* Synchronize data. */ # define O_RSYNC O_SYNC /* Synchronize read operations. */ #endif diff --git a/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h b/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h index 08c5c999fb..03c5ba59bd 100644 --- a/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h +++ b/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h @@ -29,7 +29,7 @@ #endif /* open/fcntl - O_SYNC is only implemented on blocks devices and on files - located on an ext2 file system */ + located on a few file systems. */ #define O_RDONLY 0x0000 #define O_WRONLY 0x0001 #define O_RDWR 0x0002 @@ -39,7 +39,7 @@ #define O_CREAT 0x0200 /* not fcntl */ #define O_TRUNC 0x0400 /* not fcntl */ #define O_EXCL 0x0800 /* not fcntl */ -#define O_SYNC 0x2000 +#define O_SYNC 0x802000 #define O_NONBLOCK 0x4000 #define O_NDELAY (0x0004 | O_NONBLOCK) #define O_NOCTTY 0x8000 /* not fcntl */ @@ -64,7 +64,7 @@ operations. We define the symbols here but let them do the same as O_SYNC since this is a superset. */ #if defined __USE_POSIX199309 || defined __USE_UNIX98 -# define O_DSYNC O_SYNC /* Synchronize data. */ +# define O_DSYNC 0x2000 /* Synchronize data. */ # define O_RSYNC O_SYNC /* Synchronize read operations. */ #endif diff --git a/sysdeps/unix/sysv/linux/syscalls.list b/sysdeps/unix/sysv/linux/syscalls.list index a87906a4e3..a1a449eb4b 100644 --- a/sysdeps/unix/sysv/linux/syscalls.list +++ b/sysdeps/unix/sysv/linux/syscalls.list @@ -53,6 +53,7 @@ prctl EXTRA prctl i:iiiii __prctl prctl putpmsg - putpmsg i:ippii putpmsg query_module EXTRA query_module i:sipip query_module quotactl EXTRA quotactl i:isip quotactl +recvmmsg EXTRA recvmmsg Ci:ipiip recvmmsg remap_file_pages - remap_file_pages i:piiii __remap_file_pages remap_file_pages sched_getp - sched_getparam i:ip __sched_getparam sched_getparam sched_gets - sched_getscheduler i:i __sched_getscheduler sched_getscheduler diff --git a/sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h b/sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h index f5dfd8b0b9..43835081c0 100644 --- a/sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h +++ b/sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h @@ -29,7 +29,7 @@ /* open/fcntl - O_SYNC is only implemented on blocks devices and on files - located on an ext2 file system */ + located on a few file systems. */ #define O_ACCMODE 0003 #define O_RDONLY 00 #define O_WRONLY 01 @@ -41,7 +41,7 @@ #define O_APPEND 02000 #define O_NONBLOCK 04000 #define O_NDELAY O_NONBLOCK -#define O_SYNC 010000 +#define O_SYNC 04010000 #define O_FSYNC O_SYNC #define O_ASYNC 020000 @@ -57,7 +57,7 @@ We define the symbols here but let them do the same as O_SYNC since this is a superset. */ #if defined __USE_POSIX199309 || defined __USE_UNIX98 -# define O_DSYNC O_SYNC /* Synchronize data. */ +# define O_DSYNC 010000 /* Synchronize data. */ # define O_RSYNC O_SYNC /* Synchronize read operations. */ #endif diff --git a/sysdeps/x86_64/multiarch/init-arch.h b/sysdeps/x86_64/multiarch/init-arch.h index 9b12831a6e..0f8f77a8a1 100644 --- a/sysdeps/x86_64/multiarch/init-arch.h +++ b/sysdeps/x86_64/multiarch/init-arch.h @@ -16,6 +16,20 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ +#ifdef __ASSEMBLER__ + +#include <ifunc-defines.h> + +#define bit_SSE2 (1 << 26) +#define bit_SSSE3 (1 << 9) +#define bit_SSE4_2 (1 << 20) + +#define index_SSE2 COMMON_CPUID_INDEX_1*CPUID_SIZE+CPUID_EDX_OFFSET +#define index_SSSE3 COMMON_CPUID_INDEX_1*CPUID_SIZE+CPUID_ECX_OFFSET +#define index_SSE4_2 COMMON_CPUID_INDEX_1*CPUID_SIZE+CPUID_ECX_OFFSET + +#else /* __ASSEMBLER__ */ + #include <sys/param.h> enum @@ -71,3 +85,5 @@ extern const struct cpu_features *__get_cpu_features (void) #define HAS_POPCOUNT HAS_CPU_FEATURE (COMMON_CPUID_INDEX_1, ecx, 23) #define HAS_SSE4_2 HAS_CPU_FEATURE (COMMON_CPUID_INDEX_1, ecx, 20) #define HAS_FMA HAS_CPU_FEATURE (COMMON_CPUID_INDEX_1, ecx, 12) + +#endif /* __ASSEMBLER__ */ diff --git a/sysdeps/x86_64/multiarch/rawmemchr.S b/sysdeps/x86_64/multiarch/rawmemchr.S index 08fd8769fc..2a8a6909ef 100644 --- a/sysdeps/x86_64/multiarch/rawmemchr.S +++ b/sysdeps/x86_64/multiarch/rawmemchr.S @@ -18,7 +18,7 @@ 02111-1307 USA. */ #include <sysdep.h> -#include <ifunc-defines.h> +#include <init-arch.h> /* Define multiple versions only for the definition in lib. */ @@ -30,7 +30,7 @@ ENTRY(rawmemchr) jne 1f call __init_cpu_features 1: leaq __rawmemchr_sse2(%rip), %rax - testl $(1<<20), __cpu_features+CPUID_OFFSET+COMMON_CPUID_INDEX_1*CPUID_SIZE+CPUID_ECX_OFFSET(%rip) + testl $bit_SSE4_2, __cpu_features+CPUID_OFFSET+index_SSE4_2(%rip) jz 2f leaq __rawmemchr_sse42(%rip), %rax 2: ret diff --git a/sysdeps/x86_64/multiarch/strchr.S b/sysdeps/x86_64/multiarch/strchr.S index b35566d1a5..27eead9852 100644 --- a/sysdeps/x86_64/multiarch/strchr.S +++ b/sysdeps/x86_64/multiarch/strchr.S @@ -18,7 +18,7 @@ 02111-1307 USA. */ #include <sysdep.h> -#include <ifunc-defines.h> +#include <init-arch.h> /* Define multiple versions only for the definition in libc. */ @@ -30,7 +30,7 @@ ENTRY(strchr) jne 1f call __init_cpu_features 1: leaq __strchr_sse2(%rip), %rax - testl $(1<<20), __cpu_features+CPUID_OFFSET+COMMON_CPUID_INDEX_1*CPUID_SIZE+CPUID_ECX_OFFSET(%rip) + testl $bit_SSE4_2, __cpu_features+CPUID_OFFSET+index_SSE4_2(%rip) jz 2f leaq __strchr_sse42(%rip), %rax 2: ret diff --git a/sysdeps/x86_64/multiarch/strcmp.S b/sysdeps/x86_64/multiarch/strcmp.S index 05adf1e2e6..1d939195aa 100644 --- a/sysdeps/x86_64/multiarch/strcmp.S +++ b/sysdeps/x86_64/multiarch/strcmp.S @@ -19,7 +19,7 @@ 02111-1307 USA. */ #include <sysdep.h> -#include <ifunc-defines.h> +#include <init-arch.h> #ifdef USE_AS_STRNCMP /* Since the counter, %r11, is unsigned, we branch to strcmp_exitz @@ -64,10 +64,10 @@ ENTRY(STRCMP) call __init_cpu_features 1: leaq STRCMP_SSE42(%rip), %rax - testl $(1<<20), __cpu_features+CPUID_OFFSET+COMMON_CPUID_INDEX_1*CPUID_SIZE+CPUID_ECX_OFFSET(%rip) + testl $bit_SSE4_2, __cpu_features+CPUID_OFFSET+index_SSE4_2(%rip) jnz 2f leaq STRCMP_SSSE3(%rip), %rax - testl $(1<<9), __cpu_features+CPUID_OFFSET+COMMON_CPUID_INDEX_1*CPUID_SIZE+CPUID_ECX_OFFSET(%rip) + testl $bit_SSSE3, __cpu_features+CPUID_OFFSET+index_SSSE3(%rip) jnz 2f leaq STRCMP_SSE2(%rip), %rax 2: ret diff --git a/sysdeps/x86_64/multiarch/strcpy.S b/sysdeps/x86_64/multiarch/strcpy.S index 7e400a9140..02fa8d0710 100644 --- a/sysdeps/x86_64/multiarch/strcpy.S +++ b/sysdeps/x86_64/multiarch/strcpy.S @@ -19,7 +19,7 @@ 02111-1307 USA. */ #include <sysdep.h> -#include <ifunc-defines.h> +#include <init-arch.h> #if !defined (USE_AS_STPCPY) && !defined (USE_AS_STRNCPY) # ifndef STRCPY @@ -63,7 +63,7 @@ ENTRY(STRCPY) jne 1f call __init_cpu_features 1: leaq STRCPY_SSE2(%rip), %rax - testl $(1<<9), __cpu_features+CPUID_OFFSET+COMMON_CPUID_INDEX_1*CPUID_SIZE+CPUID_ECX_OFFSET(%rip) + testl $bit_SSSE3, __cpu_features+CPUID_OFFSET+index_SSSE3(%rip) jz 2f leaq STRCPY_SSSE3(%rip), %rax 2: ret diff --git a/sysdeps/x86_64/multiarch/strcspn.S b/sysdeps/x86_64/multiarch/strcspn.S index cc75ab70e6..f00d52c2c0 100644 --- a/sysdeps/x86_64/multiarch/strcspn.S +++ b/sysdeps/x86_64/multiarch/strcspn.S @@ -23,7 +23,7 @@ #ifdef HAVE_SSE4_SUPPORT #include <sysdep.h> -#include <ifunc-defines.h> +#include <init-arch.h> #ifdef USE_AS_STRPBRK #define STRCSPN_SSE42 __strpbrk_sse42 @@ -49,7 +49,7 @@ ENTRY(STRCSPN) jne 1f call __init_cpu_features 1: leaq STRCSPN_SSE2(%rip), %rax - testl $(1<<20), __cpu_features+CPUID_OFFSET+COMMON_CPUID_INDEX_1*CPUID_SIZE+CPUID_ECX_OFFSET(%rip) + testl $bit_SSE4_2, __cpu_features+CPUID_OFFSET+index_SSE4_2(%rip) jz 2f leaq STRCSPN_SSE42(%rip), %rax 2: ret diff --git a/sysdeps/x86_64/multiarch/strlen.S b/sysdeps/x86_64/multiarch/strlen.S index 4342c6cdab..509f9c9605 100644 --- a/sysdeps/x86_64/multiarch/strlen.S +++ b/sysdeps/x86_64/multiarch/strlen.S @@ -19,7 +19,7 @@ 02111-1307 USA. */ #include <sysdep.h> -#include <ifunc-defines.h> +#include <init-arch.h> /* Define multiple versions only for the definition in libc and for @@ -33,7 +33,7 @@ ENTRY(strlen) jne 1f call __init_cpu_features 1: leaq __strlen_sse2(%rip), %rax - testl $(1<<20), __cpu_features+CPUID_OFFSET+COMMON_CPUID_INDEX_1*CPUID_SIZE+CPUID_ECX_OFFSET(%rip) + testl $bit_SSE4_2, __cpu_features+CPUID_OFFSET+index_SSE4_2(%rip) jz 2f leaq __strlen_sse42(%rip), %rax 2: ret diff --git a/sysdeps/x86_64/multiarch/strrchr.S b/sysdeps/x86_64/multiarch/strrchr.S index f6665f34b7..0d17fdb585 100644 --- a/sysdeps/x86_64/multiarch/strrchr.S +++ b/sysdeps/x86_64/multiarch/strrchr.S @@ -18,7 +18,7 @@ 02111-1307 USA. */ #include <sysdep.h> -#include <ifunc-defines.h> +#include <init-arch.h> /* Define multiple versions only for the definition in libc and for @@ -32,7 +32,7 @@ ENTRY(strrchr) jne 1f call __init_cpu_features 1: leaq __strrchr_sse2(%rip), %rax - testl $(1<<20), __cpu_features+CPUID_OFFSET+COMMON_CPUID_INDEX_1*CPUID_SIZE+CPUID_ECX_OFFSET(%rip) + testl $bit_SSE4_2, __cpu_features+CPUID_OFFSET+index_SSE4_2(%rip) jz 2f leaq __strrchr_sse42(%rip), %rax 2: ret diff --git a/sysdeps/x86_64/multiarch/strspn.S b/sysdeps/x86_64/multiarch/strspn.S index 4183a2cf60..1c5662692b 100644 --- a/sysdeps/x86_64/multiarch/strspn.S +++ b/sysdeps/x86_64/multiarch/strspn.S @@ -23,7 +23,7 @@ #ifdef HAVE_SSE4_SUPPORT #include <sysdep.h> -#include <ifunc-defines.h> +#include <init-arch.h> /* Define multiple versions only for the definition in libc. */ #ifndef NOT_IN_libc @@ -34,7 +34,7 @@ ENTRY(strspn) jne 1f call __init_cpu_features 1: leaq __strspn_sse2(%rip), %rax - testl $(1<<20), __cpu_features+CPUID_OFFSET+COMMON_CPUID_INDEX_1*CPUID_SIZE+CPUID_ECX_OFFSET(%rip) + testl $bit_SSE4_2, __cpu_features+CPUID_OFFSET+index_SSE4_2(%rip) jz 2f leaq __strspn_sse42(%rip), %rax 2: ret |