[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[commits] r8520 - in /trunk/libc: ./ csu/ elf/ include/ nptl_db/ sysdeps/generic/ sysdeps/i386/ sysdeps/ieee754/ldbl-128/ sysdeps/s390...



Author: joseph
Date: Mon Jun  1 06:59:14 2009
New Revision: 8520

Log:
Merge changes between r8486 and r8519 from /fsf/trunk.

Added:
    trunk/libc/sysdeps/generic/dl-irel.h
      - copied unchanged from r8519, fsf/trunk/libc/sysdeps/generic/dl-irel.h
    trunk/libc/sysdeps/i386/dl-irel.h
      - copied unchanged from r8519, fsf/trunk/libc/sysdeps/i386/dl-irel.h
    trunk/libc/sysdeps/s390/s390-32/____longjmp_chk.c
      - copied unchanged from r8519, fsf/trunk/libc/sysdeps/s390/s390-32/____longjmp_chk.c
    trunk/libc/sysdeps/s390/s390-64/____longjmp_chk.c
      - copied unchanged from r8519, fsf/trunk/libc/sysdeps/s390/s390-64/____longjmp_chk.c
    trunk/libc/sysdeps/unix/sysv/linux/i386/internal_accept4.S
      - copied unchanged from r8519, fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/internal_accept4.S
    trunk/libc/sysdeps/x86_64/dl-irel.h
      - copied unchanged from r8519, fsf/trunk/libc/sysdeps/x86_64/dl-irel.h
Modified:
    trunk/libc/.gitignore
    trunk/libc/ChangeLog
    trunk/libc/NEWS
    trunk/libc/configure
    trunk/libc/configure.in
    trunk/libc/csu/elf-init.c
    trunk/libc/elf/elf.h
    trunk/libc/include/libc-symbols.h
    trunk/libc/nptl_db/ChangeLog
    trunk/libc/nptl_db/db-symbols.awk
    trunk/libc/sysdeps/i386/dl-machine.h
    trunk/libc/sysdeps/ieee754/ldbl-128/s_cosl.c
    trunk/libc/sysdeps/ieee754/ldbl-128/s_expm1l.c
    trunk/libc/sysdeps/ieee754/ldbl-128/s_sinl.c
    trunk/libc/sysdeps/ieee754/ldbl-128/s_tanl.c
    trunk/libc/sysdeps/s390/s390-32/__longjmp.c
    trunk/libc/sysdeps/s390/s390-64/__longjmp.c
    trunk/libc/sysdeps/unix/sysv/linux/i386/sysconf.c
    trunk/libc/sysdeps/x86_64/cacheinfo.c
    trunk/libc/sysdeps/x86_64/dl-machine.h
    trunk/libc/sysdeps/x86_64/multiarch/init-arch.c
    trunk/libc/sysdeps/x86_64/multiarch/init-arch.h
    trunk/libc/sysdeps/x86_64/multiarch/sched_cpucount.c

Modified: trunk/libc/.gitignore
==============================================================================
--- trunk/libc/.gitignore (original)
+++ trunk/libc/.gitignore Mon Jun  1 06:59:14 2009
@@ -23,12 +23,7 @@
 
 configparms
 
-sun[43]*
-i[345]86*
-hp300*
-
 ieeetest
-hppa-sysdeps
 regex
 
 gpl2lgpl.sed

Modified: trunk/libc/ChangeLog
==============================================================================
--- trunk/libc/ChangeLog (original)
+++ trunk/libc/ChangeLog Mon Jun  1 06:59:14 2009
@@ -1,3 +1,80 @@
+2009-05-31  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* sysdeps/x86_64/multiarch/sched_cpucount.c: Also use optimized code
+	for !SHARED.
+
+2009-05-29  H.J. Lu  <hongjiu.lu@xxxxxxxxx>
+
+	* csu/elf-init.c: Include <link.h> and <dl-irel.h> if LIBC_NONSHARED
+	is not defined.
+	(__rela_iplt_start): New declaration.
+	(__rela_iplt_end): Likewise.
+	(__rel_iplt_start): Likewise.
+	(__rel_iplt_end): Likewise.
+	(__libc_csu_init): Process __rela_iplt_start and __rel_iplt_start.
+	* elf/elf.h (R_386_IRELATIVE): New macro.
+	(R_X86_64_IRELATIVE): New macro.
+	(R_386_NUM): Updated.
+	(R_X86_64_NUM): Likewise.
+	* include/libc-symbols.h (libc_ifunc_hidden_def1): New macro.
+	(libc_ifunc_hidden_def): New macro.
+	* sysdeps/generic/dl-irel.h: New file.
+	* sysdeps/i386/dl-irel.h: New file.
+	* sysdeps/x86_64/dl-irel.h: New file.
+	* sysdeps/i386/dl-machine.h (elf_machine_rel): Handle R_386_IRELATIVE.
+	(elf_machine_rela): Check SHN_UNDEF for STT_GNU_IFUNC symbol.
+	Handle R_386_IRELATIVE.
+	(elf_machine_lazy_rel): Handle R_386_IRELATIVE.
+	(elf_machine_lazy_rela): Likewise.
+	* sysdeps/x86_64/dl-machine.h (elf_machine_rela): Handle
+	R_X86_64_IRELATIVE.
+	(elf_machine_lazy_rel): Handle R_X86_64_IRELATIVE.
+
+2009-05-31  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* sysdeps/x86_64/multiarch/init-arch.h: Define COMMON_CPUID_INDEX_1
+	instead of INTEL_CPUID_INDEX_1 and AMD_CPUID_INDEX_1.  So far there
+	are no differences.  If an architecture has bits in CPUID index 1
+	meaning different things the values for the COMMON_CPUID_INDEX_1
+	index must not be set.
+	(INTEL_HAS_POPCOUNT, AMD_HAS_POPCOUNT): Removed in favor of...
+	(HAS_POPCOUNT): ...this.  New macro.
+	* sysdeps/x86_64/multiarch/init-arch.c: Use COMMON_CPUID_INDEX_1
+	instead of INTEL_CPUID_INDEX_1 and AMD_CPUID_INDEX_1.  Unify code
+	to set the value for Intel and AMD architectures.
+	* sysdeps/x86_64/cacheinfo.c: Use COMMON_CPUID_INDEX_1 instead of
+	INTEL_CPUID_INDEX_1.
+	* sysdeps/x86_64/multiarch/sched_cpucount.c: Adjust for HAS_POPCOUNT
+	change.
+
+2009-05-30  Andreas Schwab  <schwab@xxxxxxxxxxxxxx>
+
+	* configure.in: Move AC_CANONICAL_HOST before first use of $host
+	and $build.
+
+2009-05-29  Jakub Jelinek  <jakub@xxxxxxxxxx>
+
+	* sysdeps/ieee754/ldbl-128/s_expm1l.c: Include <errno.h>.
+	(__expm1l): Set errno to ERANGE on overflow.
+	* sysdeps/ieee754/ldbl-128/s_tanl.c: Include <errno.h>.
+	(__tanl): Set errno to EDOM for ±Inf.
+	* sysdeps/ieee754/ldbl-128/s_cosl.c: Include <errno.h>.
+	(__cosl): Set errno to EDOM for ±Inf.
+	* sysdeps/ieee754/ldbl-128/s_sinl.c: Include <errno.h>.
+	(__sinl): Set errno to EDOM for ±Inf.
+
+	* sysdeps/s390/s390-32/__longjmp.c (__longjmp): If CHECK_SP is
+	defined, use it.
+	* sysdeps/s390/s390-64/__longjmp.c (__longjmp): Likewise.
+	* sysdeps/s390/s390-32/____longjmp_chk.c: New file.
+	* sysdeps/s390/s390-64/____longjmp_chk.c: New file.
+
+2009-05-29  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* sysdeps/x86_64/cacheinfo.c: Compact intel_02_known array.  Adjust
+	code accessing it.
+	* sysdeps/unix/sysv/linux/i386/sysconf.c: Likewise.
+
 2009-05-22  Andreas Schwab  <schwab@xxxxxxxxxxxxxx>
 
 	* sysdeps/ieee754/ldbl-128ibm/s_sinl.c: Set errno for ±Inf.

Modified: trunk/libc/NEWS
==============================================================================
--- trunk/libc/NEWS (original)
+++ trunk/libc/NEWS Mon Jun  1 06:59:14 2009
@@ -1,4 +1,4 @@
-GNU C Library NEWS -- history of user-visible changes.  2009-5-15
+GNU C Library NEWS -- history of user-visible changes.  2009-5-31
 Copyright (C) 1992-2008, 2009 Free Software Foundation, Inc.
 See the end for copying conditions.
 
@@ -9,6 +9,9 @@
 
 * checking version of longjmp added that fails if an uninitialized stack
   frame would be created.  Implemented by Ulrich Drepper.
+
+* STT_GNU_IFUNC is now supported in static executables.
+  Implemented by H.J. Lu.
 
 
 Version 2.10

Modified: trunk/libc/configure
==============================================================================
--- trunk/libc/configure (original)
+++ trunk/libc/configure Mon Jun  1 06:59:14 2009
@@ -313,7 +313,7 @@
 # include <unistd.h>
 #endif"
 
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC OBJEXT BUILD_CC cross_compiling CPP CXX CXXFLAGS ac_ct_CXX with_fp with_cvs enable_check_abi oldest_abi bindnow force_install all_warnings PKGVERSION REPORT_BUGS_TO REPORT_BUGS_TEXI multi_arch experimental_malloc libc_cv_nss_crypt build build_cpu build_vendor build_os host host_cpu host_vendor host_os subdirs add_ons add_on_subdirs base_machine submachine sysnames sysdeps_add_ons INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S AR NM OBJDUMP RANLIB ac_ct_RANLIB MIG AS LD PWD_P MAKE MSGFMT MAKEINFO SED AUTOCONF SYSINCLUDES CXX_SYSINCLUDES libc_cv_gcc_static_libgcc BASH_SHELL libc_cv_have_bash2 KSH libc_cv_have_ksh AWK PERL INSTALL_INFO BISON VERSIONING libc_cv_cc_with_libunwind libc_cv_Bgroup libc_cv_libgcc_s_suffix libc_cv_as_needed ASFLAGS_config libc_cv_z_combreloc libc_cv_z_execstack libc_cv_fpie libc_cv_hashstyle fno_unit_at_a_time libc_cv_ssp libc_cv_gnu89_inline libc_cv_have_initfini no_whole_archive exceptions libc_cv_cc_submachine LIBGD have_libaudit have_libcap have_selinux EGREP sizeof_long_double libc_cv_gcc_unwind_find_fde uname_sysname uname_release uname_version old_glibc_headers libc_cv_slibdir libc_cv_localedir libc_cv_sysconfdir libc_cv_rootsbindir libc_cv_forced_unwind libc_cv_cpp_asm_debuginfo use_ldconfig ldd_rewrite_script elf xcoff static shared libc_cv_pic_default profile omitfp bounded static_nss nopic_initfini DEFINES mach_interface_list VERSION RELEASE LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC OBJEXT BUILD_CC cross_compiling CPP CXX CXXFLAGS ac_ct_CXX with_fp with_cvs enable_check_abi oldest_abi bindnow force_install all_warnings PKGVERSION REPORT_BUGS_TO REPORT_BUGS_TEXI multi_arch experimental_malloc libc_cv_nss_crypt subdirs add_ons add_on_subdirs base_machine submachine sysnames sysdeps_add_ons INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S AR NM OBJDUMP RANLIB ac_ct_RANLIB MIG AS LD PWD_P MAKE MSGFMT MAKEINFO SED AUTOCONF SYSINCLUDES CXX_SYSINCLUDES libc_cv_gcc_static_libgcc BASH_SHELL libc_cv_have_bash2 KSH libc_cv_have_ksh AWK PERL INSTALL_INFO BISON VERSIONING libc_cv_cc_with_libunwind libc_cv_Bgroup libc_cv_libgcc_s_suffix libc_cv_as_needed ASFLAGS_config libc_cv_z_combreloc libc_cv_z_execstack libc_cv_fpie libc_cv_hashstyle fno_unit_at_a_time libc_cv_ssp libc_cv_gnu89_inline libc_cv_have_initfini no_whole_archive exceptions libc_cv_cc_submachine LIBGD have_libaudit have_libcap have_selinux EGREP sizeof_long_double libc_cv_gcc_unwind_find_fde uname_sysname uname_release uname_version old_glibc_headers libc_cv_slibdir libc_cv_localedir libc_cv_sysconfdir libc_cv_rootsbindir libc_cv_forced_unwind libc_cv_cpp_asm_debuginfo use_ldconfig ldd_rewrite_script elf xcoff static shared libc_cv_pic_default profile omitfp bounded static_nss nopic_initfini DEFINES mach_interface_list VERSION RELEASE LIBOBJS LTLIBOBJS'
 ac_subst_files=''
 
 # Initialize some variables set by options.
@@ -1403,6 +1403,61 @@
 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
 
 
+# Make sure we can run config.sub.
+$ac_config_sub sun4 >/dev/null 2>&1 ||
+  { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5
+echo "$as_me: error: cannot run $ac_config_sub" >&2;}
+   { (exit 1); exit 1; }; }
+
+echo "$as_me:$LINENO: checking build system type" >&5
+echo $ECHO_N "checking build system type... $ECHO_C" >&6
+if test "${ac_cv_build+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_build_alias=$build_alias
+test -z "$ac_cv_build_alias" &&
+  ac_cv_build_alias=`$ac_config_guess`
+test -z "$ac_cv_build_alias" &&
+  { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
+echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
+   { (exit 1); exit 1; }; }
+ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
+  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_build" >&5
+echo "${ECHO_T}$ac_cv_build" >&6
+build=$ac_cv_build
+build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+
+echo "$as_me:$LINENO: checking host system type" >&5
+echo $ECHO_N "checking host system type... $ECHO_C" >&6
+if test "${ac_cv_host+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_host_alias=$host_alias
+test -z "$ac_cv_host_alias" &&
+  ac_cv_host_alias=$ac_cv_build_alias
+ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
+  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_host" >&5
+echo "${ECHO_T}$ac_cv_host" >&6
+host=$ac_cv_host
+host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+
+
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -3312,61 +3367,6 @@
 else
   libc_cv_nss_crypt=no
 fi
-
-
-# Make sure we can run config.sub.
-$ac_config_sub sun4 >/dev/null 2>&1 ||
-  { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5
-echo "$as_me: error: cannot run $ac_config_sub" >&2;}
-   { (exit 1); exit 1; }; }
-
-echo "$as_me:$LINENO: checking build system type" >&5
-echo $ECHO_N "checking build system type... $ECHO_C" >&6
-if test "${ac_cv_build+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_cv_build_alias=$build_alias
-test -z "$ac_cv_build_alias" &&
-  ac_cv_build_alias=`$ac_config_guess`
-test -z "$ac_cv_build_alias" &&
-  { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
-echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
-   { (exit 1); exit 1; }; }
-ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
-  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5
-echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;}
-   { (exit 1); exit 1; }; }
-
-fi
-echo "$as_me:$LINENO: result: $ac_cv_build" >&5
-echo "${ECHO_T}$ac_cv_build" >&6
-build=$ac_cv_build
-build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-
-
-echo "$as_me:$LINENO: checking host system type" >&5
-echo $ECHO_N "checking host system type... $ECHO_C" >&6
-if test "${ac_cv_host+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_cv_host_alias=$host_alias
-test -z "$ac_cv_host_alias" &&
-  ac_cv_host_alias=$ac_cv_build_alias
-ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
-  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5
-echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
-   { (exit 1); exit 1; }; }
-
-fi
-echo "$as_me:$LINENO: result: $ac_cv_host" >&5
-echo "${ECHO_T}$ac_cv_host" >&6
-host=$ac_cv_host
-host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-
 
 
 # The way shlib-versions is used to generate soversions.mk uses a
@@ -8732,6 +8732,14 @@
 s,@ECHO_N@,$ECHO_N,;t t
 s,@ECHO_T@,$ECHO_T,;t t
 s,@LIBS@,$LIBS,;t t
+s,@build@,$build,;t t
+s,@build_cpu@,$build_cpu,;t t
+s,@build_vendor@,$build_vendor,;t t
+s,@build_os@,$build_os,;t t
+s,@host@,$host,;t t
+s,@host_cpu@,$host_cpu,;t t
+s,@host_vendor@,$host_vendor,;t t
+s,@host_os@,$host_os,;t t
 s,@CC@,$CC,;t t
 s,@CFLAGS@,$CFLAGS,;t t
 s,@LDFLAGS@,$LDFLAGS,;t t
@@ -8757,14 +8765,6 @@
 s,@multi_arch@,$multi_arch,;t t
 s,@experimental_malloc@,$experimental_malloc,;t t
 s,@libc_cv_nss_crypt@,$libc_cv_nss_crypt,;t t
-s,@build@,$build,;t t
-s,@build_cpu@,$build_cpu,;t t
-s,@build_vendor@,$build_vendor,;t t
-s,@build_os@,$build_os,;t t
-s,@host@,$host,;t t
-s,@host_cpu@,$host_cpu,;t t
-s,@host_vendor@,$host_vendor,;t t
-s,@host_os@,$host_os,;t t
 s,@subdirs@,$subdirs,;t t
 s,@add_ons@,$add_ons,;t t
 s,@add_on_subdirs@,$add_on_subdirs,;t t

Modified: trunk/libc/configure.in
==============================================================================
--- trunk/libc/configure.in (original)
+++ trunk/libc/configure.in Mon Jun  1 06:59:14 2009
@@ -5,6 +5,8 @@
 AC_CONFIG_SRCDIR([include/features.h])
 AC_CONFIG_HEADERS([config.h])
 AC_CONFIG_AUX_DIR([scripts])
+
+AC_CANONICAL_HOST
 
 AC_PROG_CC
 if test $host != $build; then
@@ -320,8 +322,6 @@
   libc_cv_nss_crypt=no
 fi
 AC_SUBST(libc_cv_nss_crypt)
-
-AC_CANONICAL_HOST
 
 # The way shlib-versions is used to generate soversions.mk uses a
 # fairly simplistic model for name recognition that can't distinguish

Modified: trunk/libc/csu/elf-init.c
==============================================================================
--- trunk/libc/csu/elf-init.c (original)
+++ trunk/libc/csu/elf-init.c Mon Jun  1 06:59:14 2009
@@ -36,6 +36,20 @@
 
 #include <stddef.h>
 
+#ifndef LIBC_NONSHARED
+# include <link.h>
+# include <dl-irel.h>
+
+# ifdef ELF_MACHINE_IRELA
+extern const ElfW(Rela) __rela_iplt_start [];
+extern const ElfW(Rela) __rela_iplt_end [];
+# endif
+
+# ifdef ELF_MACHINE_IREL
+extern const ElfW(Rel) __rel_iplt_start [];
+extern const ElfW(Rel) __rel_iplt_end [];
+# endif
+#endif	/* LIBC_NONSHARED */
 
 /* These magic symbols are provided by the linker.  */
 extern void (*__preinit_array_start []) (int, char **, char **)
@@ -67,6 +81,22 @@
      the dynamic linker (before initializing any shared object.  */
 
 #ifndef LIBC_NONSHARED
+# ifdef ELF_MACHINE_IRELA
+  {
+    const size_t size = __rela_iplt_end - __rela_iplt_start;
+    for (size_t i = 0; i < size; i++)
+      elf_irela (&__rela_iplt_start [i]);
+  }
+# endif
+
+# ifdef ELF_MACHINE_IREL
+  {
+    const size_t size = __rel_iplt_end - __rel_iplt_start;
+    for (size_t i = 0; i < size; i++)
+      elf_irel (&__rel_iplt_start [i]);
+  }
+# endif
+
   /* For static executables, preinit happens rights before init.  */
   {
     const size_t size = __preinit_array_end - __preinit_array_start;

Modified: trunk/libc/elf/elf.h
==============================================================================
--- trunk/libc/elf/elf.h (original)
+++ trunk/libc/elf/elf.h Mon Jun  1 06:59:14 2009
@@ -1177,8 +1177,9 @@
 					   pointer to code and to
 					   argument, returning the TLS
 					   offset for the symbol.  */
+#define R_386_IRELATIVE	   42		/* Adjust indirectly by program base */
 /* Keep this the last entry.  */
-#define R_386_NUM	   42
+#define R_386_NUM	   43
 
 /* SUN SPARC specific definitions.  */
 
@@ -2625,8 +2626,9 @@
 #define R_X86_64_TLSDESC_CALL   35	/* Marker for call through TLS
 					   descriptor.  */
 #define R_X86_64_TLSDESC        36	/* TLS descriptor.  */
-
-#define R_X86_64_NUM		37
+#define R_X86_64_IRELATIVE	37	/* Adjust indirectly by program base */
+
+#define R_X86_64_NUM		38
 
 
 /* AM33 relocations.  */

Modified: trunk/libc/include/libc-symbols.h
==============================================================================
--- trunk/libc/include/libc-symbols.h (original)
+++ trunk/libc/include/libc-symbols.h Mon Jun  1 06:59:14 2009
@@ -845,4 +845,21 @@
   }									\
   __asm__ (".type " #name ", %gnu_indirect_function");
 
+#ifdef HAVE_ASM_SET_DIRECTIVE
+# define libc_ifunc_hidden_def1(local, name)				\
+    __asm__ (declare_symbol_alias_1_stringify (ASM_GLOBAL_DIRECTIVE)	\
+	     " " #local "\n\t"						\
+	     ".hidden " #local "\n\t"					\
+	     ".set " #local ", " #name);
+#else
+# define libc_ifunc_hidden_def1(local, name)				\
+    __asm__ (declare_symbol_alias_1_stringify (ASM_GLOBAL_DIRECTIVE)	\
+	     " " #local "\n\t"						\
+	     ".hidden " #local "\n\t"					\
+	     #local " = " #name);
+#endif
+
+#define libc_ifunc_hidden_def(name) \
+  libc_ifunc_hidden_def1 (__GI_##name, name)
+
 #endif /* libc-symbols.h */

Modified: trunk/libc/nptl_db/ChangeLog
==============================================================================
--- trunk/libc/nptl_db/ChangeLog (original)
+++ trunk/libc/nptl_db/ChangeLog Mon Jun  1 06:59:14 2009
@@ -1,3 +1,9 @@
+2009-05-25  Aurelien Jarno  <aurelien@xxxxxxxxxxx>
+
+	[BZ #10200]
+	* db-symbols.awk: Use the last field for the symbol name instead
+	of the 8th one.
+
 2009-03-19  Roland McGrath  <roland@xxxxxxxxxx>
 
 	* td_symbol_list.c (DB_LOOKUP_NAME, DB_LOOKUP_NAME_TH_UNIQUE):

Modified: trunk/libc/nptl_db/db-symbols.awk
==============================================================================
--- trunk/libc/nptl_db/db-symbols.awk (original)
+++ trunk/libc/nptl_db/db-symbols.awk Mon Jun  1 06:59:14 2009
@@ -14,7 +14,7 @@
 
 !in_symtab { next }
 
-NF >= 8 && $7 != "UND" { seen[$8] = 1 }
+NF >= 8 && $7 != "UND" { seen[$NF] = 1 }
 
 END {
   status = 0;

Modified: trunk/libc/sysdeps/i386/dl-machine.h
==============================================================================
--- trunk/libc/sysdeps/i386/dl-machine.h (original)
+++ trunk/libc/sysdeps/i386/dl-machine.h Mon Jun  1 06:59:14 2009
@@ -345,6 +345,7 @@
       Elf32_Addr value = sym_map == NULL ? 0 : sym_map->l_addr + sym->st_value;
 
       if (sym != NULL
+	  && __builtin_expect (sym->st_shndx != SHN_UNDEF, 1)
 	  && __builtin_expect (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC,
 			       0))
 	value = ((Elf32_Addr (*) (void)) value) ();
@@ -471,6 +472,11 @@
 	  memcpy (reloc_addr_arg, (void *) value,
 		  MIN (sym->st_size, refsym->st_size));
 	  break;
+	case R_386_IRELATIVE:
+	  value = map->l_addr + *reloc_addr;
+	  value = ((Elf32_Addr (*) (void)) value) ();
+	  *reloc_addr = value;
+	  break;
 	default:
 	  _dl_reloc_bad_type (map, r_type, 0);
 	  break;
@@ -500,6 +506,7 @@
       Elf32_Addr value = sym == NULL ? 0 : sym_map->l_addr + sym->st_value;
 
       if (sym != NULL
+	  && __builtin_expect (sym->st_shndx != SHN_UNDEF, 1)
 	  && __builtin_expect (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC,
 			       0))
 	value = ((Elf32_Addr (*) (void)) value) ();
@@ -609,6 +616,11 @@
 		  MIN (sym->st_size, refsym->st_size));
 	  break;
 #  endif /* !RESOLVE_CONFLICT_FIND_MAP */
+	case R_386_IRELATIVE:
+	  value = map->l_addr + reloc->r_addend;
+	  value = ((Elf32_Addr (*) (void)) value) ();
+	  *reloc_addr = value;
+	  break;
 	default:
 	  /* We add these checks in the version to relocate ld.so only
 	     if we are still debugging.  */
@@ -703,6 +715,12 @@
 # endif
 	}
     }
+  else if (__builtin_expect (r_type == R_386_IRELATIVE, 0))
+    {
+      Elf32_Addr value = map->l_addr + *reloc_addr;
+      value = ((Elf32_Addr (*) (void)) value) ();
+      *reloc_addr = value;
+    }
   else
     _dl_reloc_bad_type (map, r_type, 1);
 }
@@ -726,6 +744,12 @@
       td->arg = (void*)reloc;
       td->entry = _dl_tlsdesc_resolve_rela;
     }
+  else if (__builtin_expect (r_type == R_386_IRELATIVE, 0))
+    {
+      Elf32_Addr value = map->l_addr + reloc->r_addend;
+      value = ((Elf32_Addr (*) (void)) value) ();
+      *reloc_addr = value;
+    }
   else
     _dl_reloc_bad_type (map, r_type, 1);
 }

Modified: trunk/libc/sysdeps/ieee754/ldbl-128/s_cosl.c
==============================================================================
--- trunk/libc/sysdeps/ieee754/ldbl-128/s_cosl.c (original)
+++ trunk/libc/sysdeps/ieee754/ldbl-128/s_cosl.c Mon Jun  1 06:59:14 2009
@@ -44,6 +44,7 @@
  *	TRIG(x) returns trig(x) nearly rounded
  */
 
+#include <errno.h>
 #include "math.h"
 #include "math_private.h"
 
@@ -66,7 +67,14 @@
 	  return __kernel_cosl(x,z);
 
     /* cos(Inf or NaN) is NaN */
-	else if (ix>=0x7fff000000000000LL) return x-x;
+	else if (ix>=0x7fff000000000000LL) {
+	    if (ix == 0x7fff000000000000LL) {
+		GET_LDOUBLE_LSW64(n,x);
+		if (n == 0)
+		    __set_errno (EDOM);
+	    }
+	    return x-x;
+	}
 
     /* argument reduction needed */
 	else {

Modified: trunk/libc/sysdeps/ieee754/ldbl-128/s_expm1l.c
==============================================================================
--- trunk/libc/sysdeps/ieee754/ldbl-128/s_expm1l.c (original)
+++ trunk/libc/sysdeps/ieee754/ldbl-128/s_expm1l.c Mon Jun  1 06:59:14 2009
@@ -53,6 +53,7 @@
 
 
 
+#include <errno.h>
 #include "math.h"
 #include "math_private.h"
 
@@ -121,7 +122,10 @@
 
   /* Overflow.  */
   if (x > maxlog)
-    return (big * big);
+    {
+      __set_errno (ERANGE);
+      return (big * big);
+    }
 
   /* Minimum value.  */
   if (x < minarg)

Modified: trunk/libc/sysdeps/ieee754/ldbl-128/s_sinl.c
==============================================================================
--- trunk/libc/sysdeps/ieee754/ldbl-128/s_sinl.c (original)
+++ trunk/libc/sysdeps/ieee754/ldbl-128/s_sinl.c Mon Jun  1 06:59:14 2009
@@ -44,6 +44,7 @@
  *	TRIG(x) returns trig(x) nearly rounded
  */
 
+#include <errno.h>
 #include "math.h"
 #include "math_private.h"
 
@@ -66,7 +67,14 @@
 	  return __kernel_sinl(x,z,0);
 
     /* sin(Inf or NaN) is NaN */
-	else if (ix>=0x7fff000000000000LL) return x-x;
+	else if (ix>=0x7fff000000000000LL) {
+	    if (ix == 0x7fff000000000000LL) {
+		GET_LDOUBLE_LSW64(n,x);
+		if (n == 0)
+		    __set_errno (EDOM);
+	    }
+	    return x-x;
+	}
 
     /* argument reduction needed */
 	else {

Modified: trunk/libc/sysdeps/ieee754/ldbl-128/s_tanl.c
==============================================================================
--- trunk/libc/sysdeps/ieee754/ldbl-128/s_tanl.c (original)
+++ trunk/libc/sysdeps/ieee754/ldbl-128/s_tanl.c Mon Jun  1 06:59:14 2009
@@ -44,6 +44,7 @@
  *	TRIG(x) returns trig(x) nearly rounded
  */
 
+#include <errno.h>
 #include "math.h"
 #include "math_private.h"
 
@@ -65,7 +66,14 @@
 	if(ix <= 0x3ffe921fb54442d1LL) return __kernel_tanl(x,z,1);
 
     /* tanl(Inf or NaN) is NaN */
-	else if (ix>=0x7fff000000000000LL) return x-x;		/* NaN */
+	else if (ix>=0x7fff000000000000LL) {
+	    if (ix == 0x7fff000000000000LL) {
+		GET_LDOUBLE_LSW64(n,x);
+		if (n == 0)
+		    __set_errno (EDOM);
+	    }
+	    return x-x;		/* NaN */
+	}
 
     /* argument reduction needed */
 	else {

Modified: trunk/libc/sysdeps/s390/s390-32/__longjmp.c
==============================================================================
--- trunk/libc/sysdeps/s390/s390-32/__longjmp.c (original)
+++ trunk/libc/sysdeps/s390/s390-32/__longjmp.c Mon Jun  1 06:59:14 2009
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2001, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2001, 2005, 2009 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Martin Schwidefsky (schwidefsky@xxxxxxxxxx).
 
@@ -33,6 +33,11 @@
 #ifdef PTR_DEMANGLE
   register uintptr_t r3 __asm ("%r3") = THREAD_GET_POINTER_GUARD ();
   register void *r1 __asm ("%r1") = (void *) env;
+# ifdef CHECK_SP
+  CHECK_SP (env, r3);
+# endif
+#elif defined CHECK_SP
+  CHECK_SP (env, 0);
 #endif
   /* Restore registers and jump back.  */
   asm volatile ("ld   %%f6,48(%1)\n\t"

Modified: trunk/libc/sysdeps/s390/s390-64/__longjmp.c
==============================================================================
--- trunk/libc/sysdeps/s390/s390-64/__longjmp.c (original)
+++ trunk/libc/sysdeps/s390/s390-64/__longjmp.c Mon Jun  1 06:59:14 2009
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2001, 2005, 2009 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Martin Schwidefsky (schwidefsky@xxxxxxxxxx).
 
@@ -33,6 +33,11 @@
 #ifdef PTR_DEMANGLE
   register uintptr_t r3 __asm ("%r3") = THREAD_GET_POINTER_GUARD ();
   register void *r1 __asm ("%r1") = (void *) env;
+# ifdef CHECK_SP
+  CHECK_SP (env, r3);
+# endif
+#elif defined CHECK_SP
+  CHECK_SP (env, 0);
 #endif
   /* Restore registers and jump back.  */
   asm volatile ("ld   %%f7,104(%1)\n\t"

Modified: trunk/libc/sysdeps/unix/sysv/linux/i386/sysconf.c
==============================================================================
--- trunk/libc/sysdeps/unix/sysv/linux/i386/sysconf.c (original)
+++ trunk/libc/sysdeps/unix/sysv/linux/i386/sysconf.c Mon Jun  1 06:59:14 2009
@@ -1,5 +1,5 @@
 /* Get file-specific information about a file.  Linux version.
-   Copyright (C) 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2004, 2006, 2007, 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
@@ -67,76 +67,77 @@
 
 static const struct intel_02_cache_info
 {
-  unsigned int idx;
-  int name;
-  long int size;
-  long int assoc;
-  long int linesize;
-} intel_02_known[] =
+  unsigned char idx;
+  unsigned char assoc;
+  unsigned char linesize;
+  unsigned char rel_name;
+  unsigned int size;
+} intel_02_known [] =
   {
-    { 0x06, _SC_LEVEL1_ICACHE_SIZE, 8192, 4, 32 },
-    { 0x08, _SC_LEVEL1_ICACHE_SIZE, 16384, 4, 32 },
-    { 0x09, _SC_LEVEL1_ICACHE_SIZE, 32768, 4, 32 },
-    { 0x0a, _SC_LEVEL1_DCACHE_SIZE, 8192, 2, 32 },
-    { 0x0c, _SC_LEVEL1_DCACHE_SIZE, 16384, 4, 32 },
-    { 0x0d, _SC_LEVEL1_DCACHE_SIZE, 16384, 4, 64 },
-    { 0x21, _SC_LEVEL2_CACHE_SIZE, 262144, 8, 64 },
-    { 0x22, _SC_LEVEL3_CACHE_SIZE, 524288, 4, 64 },
-    { 0x23, _SC_LEVEL3_CACHE_SIZE, 1048576, 8, 64 },
-    { 0x25, _SC_LEVEL3_CACHE_SIZE, 2097152, 8, 64 },
-    { 0x29, _SC_LEVEL3_CACHE_SIZE, 4194304, 8, 64 },
-    { 0x2c, _SC_LEVEL1_DCACHE_SIZE, 32768, 8, 64 },
-    { 0x30, _SC_LEVEL1_ICACHE_SIZE, 32768, 8, 64 },
-    { 0x39, _SC_LEVEL2_CACHE_SIZE, 131072, 4, 64 },
-    { 0x3a, _SC_LEVEL2_CACHE_SIZE, 196608, 6, 64 },
-    { 0x3b, _SC_LEVEL2_CACHE_SIZE, 131072, 2, 64 },
-    { 0x3c, _SC_LEVEL2_CACHE_SIZE, 262144, 4, 64 },
-    { 0x3d, _SC_LEVEL2_CACHE_SIZE, 393216, 6, 64 },
-    { 0x3e, _SC_LEVEL2_CACHE_SIZE, 524288, 4, 64 },
-    { 0x3f, _SC_LEVEL2_CACHE_SIZE, 262144, 2, 64 },
-    { 0x41, _SC_LEVEL2_CACHE_SIZE, 131072, 4, 32 },
-    { 0x42, _SC_LEVEL2_CACHE_SIZE, 262144, 4, 32 },
-    { 0x43, _SC_LEVEL2_CACHE_SIZE, 524288, 4, 32 },
-    { 0x44, _SC_LEVEL2_CACHE_SIZE, 1048576, 4, 32 },
-    { 0x45, _SC_LEVEL2_CACHE_SIZE, 2097152, 4, 32 },
-    { 0x46, _SC_LEVEL3_CACHE_SIZE, 4194304, 4, 64 },
-    { 0x47, _SC_LEVEL3_CACHE_SIZE, 8388608, 8, 64 },
-    { 0x48, _SC_LEVEL2_CACHE_SIZE, 3145728, 12, 64 },
-    { 0x49, _SC_LEVEL2_CACHE_SIZE, 4194304, 16, 64 },
-    { 0x4a, _SC_LEVEL3_CACHE_SIZE, 6291456, 12, 64 },
-    { 0x4b, _SC_LEVEL3_CACHE_SIZE, 8388608, 16, 64 },
-    { 0x4c, _SC_LEVEL3_CACHE_SIZE, 12582912, 12, 64 },
-    { 0x4d, _SC_LEVEL3_CACHE_SIZE, 16777216, 16, 64 },
-    { 0x4e, _SC_LEVEL2_CACHE_SIZE, 6291456, 24, 64 },
-    { 0x60, _SC_LEVEL1_DCACHE_SIZE, 16384, 8, 64 },
-    { 0x66, _SC_LEVEL1_DCACHE_SIZE, 8192, 4, 64 },
-    { 0x67, _SC_LEVEL1_DCACHE_SIZE, 16384, 4, 64 },
-    { 0x68, _SC_LEVEL1_DCACHE_SIZE, 32768, 4, 64 },
-    { 0x78, _SC_LEVEL2_CACHE_SIZE, 1048576, 8, 64 },
-    { 0x79, _SC_LEVEL2_CACHE_SIZE, 131072, 8, 64 },
-    { 0x7a, _SC_LEVEL2_CACHE_SIZE, 262144, 8, 64 },
-    { 0x7b, _SC_LEVEL2_CACHE_SIZE, 524288, 8, 64 },
-    { 0x7c, _SC_LEVEL2_CACHE_SIZE, 1048576, 8, 64 },
-    { 0x7d, _SC_LEVEL2_CACHE_SIZE, 2097152, 8, 64 },
-    { 0x7f, _SC_LEVEL2_CACHE_SIZE, 524288, 2, 64 },
-    { 0x82, _SC_LEVEL2_CACHE_SIZE, 262144, 8, 32 },
-    { 0x83, _SC_LEVEL2_CACHE_SIZE, 524288, 8, 32 },
-    { 0x84, _SC_LEVEL2_CACHE_SIZE, 1048576, 8, 32 },
-    { 0x85, _SC_LEVEL2_CACHE_SIZE, 2097152, 8, 32 },
-    { 0x86, _SC_LEVEL2_CACHE_SIZE, 524288, 4, 64 },
-    { 0x87, _SC_LEVEL2_CACHE_SIZE, 1048576, 8, 64 },
-    { 0xd0, _SC_LEVEL3_CACHE_SIZE, 524288, 4, 64 },
-    { 0xd1, _SC_LEVEL3_CACHE_SIZE, 1048576, 4, 64 },
-    { 0xd2, _SC_LEVEL3_CACHE_SIZE, 2097152, 4, 64 },
-    { 0xd6, _SC_LEVEL3_CACHE_SIZE, 1048576, 8, 64 },
-    { 0xd7, _SC_LEVEL3_CACHE_SIZE, 2097152, 8, 64 },
-    { 0xd8, _SC_LEVEL3_CACHE_SIZE, 4194304, 8, 64 },
-    { 0xdc, _SC_LEVEL3_CACHE_SIZE, 2097152, 12, 64 },
-    { 0xdd, _SC_LEVEL3_CACHE_SIZE, 4194304, 12, 64 },
-    { 0xde, _SC_LEVEL3_CACHE_SIZE, 8388608, 12, 64 },
-    { 0xe3, _SC_LEVEL3_CACHE_SIZE, 2097152, 16, 64 },
-    { 0xe3, _SC_LEVEL3_CACHE_SIZE, 4194304, 16, 64 },
-    { 0xe4, _SC_LEVEL3_CACHE_SIZE, 8388608, 16, 64 },
+#define M(sc) ((sc) - _SC_LEVEL1_ICACHE_SIZE)
+    { 0x06,  4, 32, M(_SC_LEVEL1_ICACHE_SIZE),    8192 },
+    { 0x08,  4, 32, M(_SC_LEVEL1_ICACHE_SIZE),   16384 },
+    { 0x09,  4, 32, M(_SC_LEVEL1_ICACHE_SIZE),   32768 },
+    { 0x0a,  2, 32, M(_SC_LEVEL1_DCACHE_SIZE),    8192 },
+    { 0x0c,  4, 32, M(_SC_LEVEL1_DCACHE_SIZE),   16384 },
+    { 0x0d,  4, 64, M(_SC_LEVEL1_DCACHE_SIZE),   16384 },
+    { 0x21,  8, 64, M(_SC_LEVEL2_CACHE_SIZE),   262144 },
+    { 0x22,  4, 64, M(_SC_LEVEL3_CACHE_SIZE),   524288 },
+    { 0x23,  8, 64, M(_SC_LEVEL3_CACHE_SIZE),  1048576 },
+    { 0x25,  8, 64, M(_SC_LEVEL3_CACHE_SIZE),  2097152 },
+    { 0x29,  8, 64, M(_SC_LEVEL3_CACHE_SIZE),  4194304 },
+    { 0x2c,  8, 64, M(_SC_LEVEL1_DCACHE_SIZE),   32768 },
+    { 0x30,  8, 64, M(_SC_LEVEL1_ICACHE_SIZE),   32768 },
+    { 0x39,  4, 64, M(_SC_LEVEL2_CACHE_SIZE),   131072 },
+    { 0x3a,  6, 64, M(_SC_LEVEL2_CACHE_SIZE),   196608 },
+    { 0x3b,  2, 64, M(_SC_LEVEL2_CACHE_SIZE),   131072 },
+    { 0x3c,  4, 64, M(_SC_LEVEL2_CACHE_SIZE),   262144 },
+    { 0x3d,  6, 64, M(_SC_LEVEL2_CACHE_SIZE),   393216 },
+    { 0x3e,  4, 64, M(_SC_LEVEL2_CACHE_SIZE),   524288 },
+    { 0x3f,  2, 64, M(_SC_LEVEL2_CACHE_SIZE),   262144 },
+    { 0x41,  4, 32, M(_SC_LEVEL2_CACHE_SIZE),   131072 },
+    { 0x42,  4, 32, M(_SC_LEVEL2_CACHE_SIZE),   262144 },
+    { 0x43,  4, 32, M(_SC_LEVEL2_CACHE_SIZE),   524288 },
+    { 0x44,  4, 32, M(_SC_LEVEL2_CACHE_SIZE),  1048576 },
+    { 0x45,  4, 32, M(_SC_LEVEL2_CACHE_SIZE),  2097152 },
+    { 0x46,  4, 64, M(_SC_LEVEL3_CACHE_SIZE),  4194304 },
+    { 0x47,  8, 64, M(_SC_LEVEL3_CACHE_SIZE),  8388608 },
+    { 0x48, 12, 64, M(_SC_LEVEL2_CACHE_SIZE),  3145728 },
+    { 0x49, 16, 64, M(_SC_LEVEL2_CACHE_SIZE),  4194304 },
+    { 0x4a, 12, 64, M(_SC_LEVEL3_CACHE_SIZE),  6291456 },
+    { 0x4b, 16, 64, M(_SC_LEVEL3_CACHE_SIZE),  8388608 },
+    { 0x4c, 12, 64, M(_SC_LEVEL3_CACHE_SIZE), 12582912 },
+    { 0x4d, 16, 64, M(_SC_LEVEL3_CACHE_SIZE), 16777216 },
+    { 0x4e, 24, 64, M(_SC_LEVEL2_CACHE_SIZE),  6291456 },
+    { 0x60,  8, 64, M(_SC_LEVEL1_DCACHE_SIZE),   16384 },
+    { 0x66,  4, 64, M(_SC_LEVEL1_DCACHE_SIZE),    8192 },
+    { 0x67,  4, 64, M(_SC_LEVEL1_DCACHE_SIZE),   16384 },
+    { 0x68,  4, 64, M(_SC_LEVEL1_DCACHE_SIZE),   32768 },
+    { 0x78,  8, 64, M(_SC_LEVEL2_CACHE_SIZE),  1048576 },
+    { 0x79,  8, 64, M(_SC_LEVEL2_CACHE_SIZE),   131072 },
+    { 0x7a,  8, 64, M(_SC_LEVEL2_CACHE_SIZE),   262144 },
+    { 0x7b,  8, 64, M(_SC_LEVEL2_CACHE_SIZE),   524288 },
+    { 0x7c,  8, 64, M(_SC_LEVEL2_CACHE_SIZE),  1048576 },
+    { 0x7d,  8, 64, M(_SC_LEVEL2_CACHE_SIZE),  2097152 },
+    { 0x7f,  2, 64, M(_SC_LEVEL2_CACHE_SIZE),   524288 },
+    { 0x82,  8, 32, M(_SC_LEVEL2_CACHE_SIZE),   262144 },
+    { 0x83,  8, 32, M(_SC_LEVEL2_CACHE_SIZE),   524288 },
+    { 0x84,  8, 32, M(_SC_LEVEL2_CACHE_SIZE),  1048576 },
+    { 0x85,  8, 32, M(_SC_LEVEL2_CACHE_SIZE),  2097152 },
+    { 0x86,  4, 64, M(_SC_LEVEL2_CACHE_SIZE),   524288 },
+    { 0x87,  8, 64, M(_SC_LEVEL2_CACHE_SIZE),  1048576 },
+    { 0xd0,  4, 64, M(_SC_LEVEL3_CACHE_SIZE),   524288 },
+    { 0xd1,  4, 64, M(_SC_LEVEL3_CACHE_SIZE),  1048576 },
+    { 0xd2,  4, 64, M(_SC_LEVEL3_CACHE_SIZE),  2097152 },
+    { 0xd6,  8, 64, M(_SC_LEVEL3_CACHE_SIZE),  1048576 },
+    { 0xd7,  8, 64, M(_SC_LEVEL3_CACHE_SIZE),  2097152 },
+    { 0xd8,  8, 64, M(_SC_LEVEL3_CACHE_SIZE),  4194304 },
+    { 0xdc, 12, 64, M(_SC_LEVEL3_CACHE_SIZE),  2097152 },
+    { 0xdd, 12, 64, M(_SC_LEVEL3_CACHE_SIZE),  4194304 },
+    { 0xde, 12, 64, M(_SC_LEVEL3_CACHE_SIZE),  8388608 },
+    { 0xe3, 16, 64, M(_SC_LEVEL3_CACHE_SIZE),  2097152 },
+    { 0xe3, 16, 64, M(_SC_LEVEL3_CACHE_SIZE),  4194304 },
+    { 0xe4, 16, 64, M(_SC_LEVEL3_CACHE_SIZE),  8388608 },
   };
 #define nintel_02_known (sizeof (intel_02_known) / sizeof (intel_02_known[0]))
 
@@ -168,8 +169,7 @@
 
   /* Fold the name.  The _SC_ constants are always in the order SIZE,
      ASSOC, LINESIZE.  */
-  int folded_name = (_SC_LEVEL1_ICACHE_SIZE
-		     + ((name - _SC_LEVEL1_ICACHE_SIZE) / 3) * 3);
+  int folded_rel_name = (M(name) / 3) * 3;
 
   while (value != 0)
     {
@@ -179,13 +179,13 @@
 	{
 	  *no_level_2_or_3 = true;
 
-	  if (folded_name == _SC_LEVEL3_CACHE_SIZE)
+	  if (folded_rel_name == M(_SC_LEVEL3_CACHE_SIZE))
 	    /* No need to look further.  */
 	    break;
 	}
       else
 	{
-	  if (byte == 0x49 && folded_name == _SC_LEVEL3_CACHE_SIZE)
+	  if (byte == 0x49 && folded_rel_name == M(_SC_LEVEL3_CACHE_SIZE))
 	    {
 	      /* Intel reused this value.  For family 15, model 6 it
 		 specifies the 3rd level cache.  Otherwise the 2nd
@@ -208,7 +208,7 @@
 		     the caller asked for the level 2 cache.  */
 		  name = (_SC_LEVEL2_CACHE_SIZE
 			  + (name - _SC_LEVEL3_CACHE_SIZE));
-		  folded_name = _SC_LEVEL3_CACHE_SIZE;
+		  folded_rel_name = M(_SC_LEVEL2_CACHE_SIZE);
 		}
 	    }
 
@@ -220,9 +220,9 @@
 			   sizeof (intel_02_known[0]), intel_02_known_compare);
 	  if (found != NULL)
 	    {
-	      if (found->name == folded_name)
+	      if (found->rel_name == folded_rel_name)
 		{
-		  unsigned int offset = name - folded_name;
+		  unsigned int offset = M(name) - folded_rel_name;
 
 		  if (offset == 0)
 		    /* Cache size.  */
@@ -234,7 +234,7 @@
 		  return found->linesize;
 		}
 
-	      if (found->name == _SC_LEVEL2_CACHE_SIZE)
+	      if (found->rel_name == M(_SC_LEVEL2_CACHE_SIZE))
 		*has_level_2 = true;
 	    }
 	}

Modified: trunk/libc/sysdeps/x86_64/cacheinfo.c
==============================================================================
--- trunk/libc/sysdeps/x86_64/cacheinfo.c (original)
+++ trunk/libc/sysdeps/x86_64/cacheinfo.c Mon Jun  1 06:59:14 2009
@@ -1,5 +1,5 @@
 /* x86_64 cache info.
-   Copyright (C) 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2004, 2006, 2007, 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
@@ -29,76 +29,77 @@
 
 static const struct intel_02_cache_info
 {
-  unsigned int idx;
-  int name;
-  long int size;
-  long int assoc;
-  long int linesize;
+  unsigned char idx;
+  unsigned char assoc;
+  unsigned char linesize;
+  unsigned char rel_name;
+  unsigned int size;
 } intel_02_known [] =
   {
-    { 0x06, _SC_LEVEL1_ICACHE_SIZE,    8192,  4, 32 },
-    { 0x08, _SC_LEVEL1_ICACHE_SIZE,   16384,  4, 32 },
-    { 0x09, _SC_LEVEL1_ICACHE_SIZE,   32768,  4, 32 },
-    { 0x0a, _SC_LEVEL1_DCACHE_SIZE,    8192,  2, 32 },
-    { 0x0c, _SC_LEVEL1_DCACHE_SIZE,   16384,  4, 32 },
-    { 0x0d, _SC_LEVEL1_DCACHE_SIZE,   16384,  4, 64 },
-    { 0x21, _SC_LEVEL2_CACHE_SIZE,   262144,  8, 64 },
-    { 0x22, _SC_LEVEL3_CACHE_SIZE,   524288,  4, 64 },
-    { 0x23, _SC_LEVEL3_CACHE_SIZE,  1048576,  8, 64 },
-    { 0x25, _SC_LEVEL3_CACHE_SIZE,  2097152,  8, 64 },
-    { 0x29, _SC_LEVEL3_CACHE_SIZE,  4194304,  8, 64 },
-    { 0x2c, _SC_LEVEL1_DCACHE_SIZE,   32768,  8, 64 },
-    { 0x30, _SC_LEVEL1_ICACHE_SIZE,   32768,  8, 64 },
-    { 0x39, _SC_LEVEL2_CACHE_SIZE,   131072,  4, 64 },
-    { 0x3a, _SC_LEVEL2_CACHE_SIZE,   196608,  6, 64 },
-    { 0x3b, _SC_LEVEL2_CACHE_SIZE,   131072,  2, 64 },
-    { 0x3c, _SC_LEVEL2_CACHE_SIZE,   262144,  4, 64 },
-    { 0x3d, _SC_LEVEL2_CACHE_SIZE,   393216,  6, 64 },
-    { 0x3e, _SC_LEVEL2_CACHE_SIZE,   524288,  4, 64 },
-    { 0x3f, _SC_LEVEL2_CACHE_SIZE,   262144,  2, 64 },
-    { 0x41, _SC_LEVEL2_CACHE_SIZE,   131072,  4, 32 },
-    { 0x42, _SC_LEVEL2_CACHE_SIZE,   262144,  4, 32 },
-    { 0x43, _SC_LEVEL2_CACHE_SIZE,   524288,  4, 32 },
-    { 0x44, _SC_LEVEL2_CACHE_SIZE,  1048576,  4, 32 },
-    { 0x45, _SC_LEVEL2_CACHE_SIZE,  2097152,  4, 32 },
-    { 0x46, _SC_LEVEL3_CACHE_SIZE,  4194304,  4, 64 },
-    { 0x47, _SC_LEVEL3_CACHE_SIZE,  8388608,  8, 64 },
-    { 0x48, _SC_LEVEL2_CACHE_SIZE,  3145728, 12, 64 },
-    { 0x49, _SC_LEVEL2_CACHE_SIZE,  4194304, 16, 64 },
-    { 0x4a, _SC_LEVEL3_CACHE_SIZE,  6291456, 12, 64 },
-    { 0x4b, _SC_LEVEL3_CACHE_SIZE,  8388608, 16, 64 },
-    { 0x4c, _SC_LEVEL3_CACHE_SIZE, 12582912, 12, 64 },
-    { 0x4d, _SC_LEVEL3_CACHE_SIZE, 16777216, 16, 64 },
-    { 0x4e, _SC_LEVEL2_CACHE_SIZE,  6291456, 24, 64 },
-    { 0x60, _SC_LEVEL1_DCACHE_SIZE,   16384,  8, 64 },
-    { 0x66, _SC_LEVEL1_DCACHE_SIZE,    8192,  4, 64 },
-    { 0x67, _SC_LEVEL1_DCACHE_SIZE,   16384,  4, 64 },
-    { 0x68, _SC_LEVEL1_DCACHE_SIZE,   32768,  4, 64 },
-    { 0x78, _SC_LEVEL2_CACHE_SIZE,  1048576,  8, 64 },
-    { 0x79, _SC_LEVEL2_CACHE_SIZE,   131072,  8, 64 },
-    { 0x7a, _SC_LEVEL2_CACHE_SIZE,   262144,  8, 64 },
-    { 0x7b, _SC_LEVEL2_CACHE_SIZE,   524288,  8, 64 },
-    { 0x7c, _SC_LEVEL2_CACHE_SIZE,  1048576,  8, 64 },
-    { 0x7d, _SC_LEVEL2_CACHE_SIZE,  2097152,  8, 64 },
-    { 0x7f, _SC_LEVEL2_CACHE_SIZE,   524288,  2, 64 },
-    { 0x82, _SC_LEVEL2_CACHE_SIZE,   262144,  8, 32 },
-    { 0x83, _SC_LEVEL2_CACHE_SIZE,   524288,  8, 32 },
-    { 0x84, _SC_LEVEL2_CACHE_SIZE,  1048576,  8, 32 },
-    { 0x85, _SC_LEVEL2_CACHE_SIZE,  2097152,  8, 32 },
-    { 0x86, _SC_LEVEL2_CACHE_SIZE,   524288,  4, 64 },
-    { 0x87, _SC_LEVEL2_CACHE_SIZE,  1048576,  8, 64 },
-    { 0xd0, _SC_LEVEL3_CACHE_SIZE,   524288,  4, 64 },
-    { 0xd1, _SC_LEVEL3_CACHE_SIZE,  1048576,  4, 64 },
-    { 0xd2, _SC_LEVEL3_CACHE_SIZE,  2097152,  4, 64 },
-    { 0xd6, _SC_LEVEL3_CACHE_SIZE,  1048576,  8, 64 },
-    { 0xd7, _SC_LEVEL3_CACHE_SIZE,  2097152,  8, 64 },
-    { 0xd8, _SC_LEVEL3_CACHE_SIZE,  4194304,  8, 64 },
-    { 0xdc, _SC_LEVEL3_CACHE_SIZE,  2097152, 12, 64 },
-    { 0xdd, _SC_LEVEL3_CACHE_SIZE,  4194304, 12, 64 },
-    { 0xde, _SC_LEVEL3_CACHE_SIZE,  8388608, 12, 64 },
-    { 0xe3, _SC_LEVEL3_CACHE_SIZE,  2097152, 16, 64 },
-    { 0xe3, _SC_LEVEL3_CACHE_SIZE,  4194304, 16, 64 },
-    { 0xe4, _SC_LEVEL3_CACHE_SIZE,  8388608, 16, 64 },
+#define M(sc) ((sc) - _SC_LEVEL1_ICACHE_SIZE)
+    { 0x06,  4, 32, M(_SC_LEVEL1_ICACHE_SIZE),    8192 },
+    { 0x08,  4, 32, M(_SC_LEVEL1_ICACHE_SIZE),   16384 },
+    { 0x09,  4, 32, M(_SC_LEVEL1_ICACHE_SIZE),   32768 },
+    { 0x0a,  2, 32, M(_SC_LEVEL1_DCACHE_SIZE),    8192 },
+    { 0x0c,  4, 32, M(_SC_LEVEL1_DCACHE_SIZE),   16384 },
+    { 0x0d,  4, 64, M(_SC_LEVEL1_DCACHE_SIZE),   16384 },
+    { 0x21,  8, 64, M(_SC_LEVEL2_CACHE_SIZE),   262144 },
+    { 0x22,  4, 64, M(_SC_LEVEL3_CACHE_SIZE),   524288 },
+    { 0x23,  8, 64, M(_SC_LEVEL3_CACHE_SIZE),  1048576 },
+    { 0x25,  8, 64, M(_SC_LEVEL3_CACHE_SIZE),  2097152 },
+    { 0x29,  8, 64, M(_SC_LEVEL3_CACHE_SIZE),  4194304 },
+    { 0x2c,  8, 64, M(_SC_LEVEL1_DCACHE_SIZE),   32768 },
+    { 0x30,  8, 64, M(_SC_LEVEL1_ICACHE_SIZE),   32768 },
+    { 0x39,  4, 64, M(_SC_LEVEL2_CACHE_SIZE),   131072 },
+    { 0x3a,  6, 64, M(_SC_LEVEL2_CACHE_SIZE),   196608 },
+    { 0x3b,  2, 64, M(_SC_LEVEL2_CACHE_SIZE),   131072 },
+    { 0x3c,  4, 64, M(_SC_LEVEL2_CACHE_SIZE),   262144 },
+    { 0x3d,  6, 64, M(_SC_LEVEL2_CACHE_SIZE),   393216 },
+    { 0x3e,  4, 64, M(_SC_LEVEL2_CACHE_SIZE),   524288 },
+    { 0x3f,  2, 64, M(_SC_LEVEL2_CACHE_SIZE),   262144 },
+    { 0x41,  4, 32, M(_SC_LEVEL2_CACHE_SIZE),   131072 },
+    { 0x42,  4, 32, M(_SC_LEVEL2_CACHE_SIZE),   262144 },
+    { 0x43,  4, 32, M(_SC_LEVEL2_CACHE_SIZE),   524288 },
+    { 0x44,  4, 32, M(_SC_LEVEL2_CACHE_SIZE),  1048576 },
+    { 0x45,  4, 32, M(_SC_LEVEL2_CACHE_SIZE),  2097152 },
+    { 0x46,  4, 64, M(_SC_LEVEL3_CACHE_SIZE),  4194304 },
+    { 0x47,  8, 64, M(_SC_LEVEL3_CACHE_SIZE),  8388608 },
+    { 0x48, 12, 64, M(_SC_LEVEL2_CACHE_SIZE),  3145728 },
+    { 0x49, 16, 64, M(_SC_LEVEL2_CACHE_SIZE),  4194304 },
+    { 0x4a, 12, 64, M(_SC_LEVEL3_CACHE_SIZE),  6291456 },
+    { 0x4b, 16, 64, M(_SC_LEVEL3_CACHE_SIZE),  8388608 },
+    { 0x4c, 12, 64, M(_SC_LEVEL3_CACHE_SIZE), 12582912 },
+    { 0x4d, 16, 64, M(_SC_LEVEL3_CACHE_SIZE), 16777216 },
+    { 0x4e, 24, 64, M(_SC_LEVEL2_CACHE_SIZE),  6291456 },
+    { 0x60,  8, 64, M(_SC_LEVEL1_DCACHE_SIZE),   16384 },
+    { 0x66,  4, 64, M(_SC_LEVEL1_DCACHE_SIZE),    8192 },
+    { 0x67,  4, 64, M(_SC_LEVEL1_DCACHE_SIZE),   16384 },
+    { 0x68,  4, 64, M(_SC_LEVEL1_DCACHE_SIZE),   32768 },
+    { 0x78,  8, 64, M(_SC_LEVEL2_CACHE_SIZE),  1048576 },
+    { 0x79,  8, 64, M(_SC_LEVEL2_CACHE_SIZE),   131072 },
+    { 0x7a,  8, 64, M(_SC_LEVEL2_CACHE_SIZE),   262144 },
+    { 0x7b,  8, 64, M(_SC_LEVEL2_CACHE_SIZE),   524288 },
+    { 0x7c,  8, 64, M(_SC_LEVEL2_CACHE_SIZE),  1048576 },
+    { 0x7d,  8, 64, M(_SC_LEVEL2_CACHE_SIZE),  2097152 },
+    { 0x7f,  2, 64, M(_SC_LEVEL2_CACHE_SIZE),   524288 },
+    { 0x82,  8, 32, M(_SC_LEVEL2_CACHE_SIZE),   262144 },
+    { 0x83,  8, 32, M(_SC_LEVEL2_CACHE_SIZE),   524288 },
+    { 0x84,  8, 32, M(_SC_LEVEL2_CACHE_SIZE),  1048576 },
+    { 0x85,  8, 32, M(_SC_LEVEL2_CACHE_SIZE),  2097152 },
+    { 0x86,  4, 64, M(_SC_LEVEL2_CACHE_SIZE),   524288 },
+    { 0x87,  8, 64, M(_SC_LEVEL2_CACHE_SIZE),  1048576 },
+    { 0xd0,  4, 64, M(_SC_LEVEL3_CACHE_SIZE),   524288 },
+    { 0xd1,  4, 64, M(_SC_LEVEL3_CACHE_SIZE),  1048576 },
+    { 0xd2,  4, 64, M(_SC_LEVEL3_CACHE_SIZE),  2097152 },
+    { 0xd6,  8, 64, M(_SC_LEVEL3_CACHE_SIZE),  1048576 },
+    { 0xd7,  8, 64, M(_SC_LEVEL3_CACHE_SIZE),  2097152 },
+    { 0xd8,  8, 64, M(_SC_LEVEL3_CACHE_SIZE),  4194304 },
+    { 0xdc, 12, 64, M(_SC_LEVEL3_CACHE_SIZE),  2097152 },
+    { 0xdd, 12, 64, M(_SC_LEVEL3_CACHE_SIZE),  4194304 },
+    { 0xde, 12, 64, M(_SC_LEVEL3_CACHE_SIZE),  8388608 },
+    { 0xe3, 16, 64, M(_SC_LEVEL3_CACHE_SIZE),  2097152 },
+    { 0xe3, 16, 64, M(_SC_LEVEL3_CACHE_SIZE),  4194304 },
+    { 0xe4, 16, 64, M(_SC_LEVEL3_CACHE_SIZE),  8388608 },
   };
 
 #define nintel_02_known (sizeof (intel_02_known) / sizeof (intel_02_known [0]))
@@ -130,8 +131,7 @@
 
   /* Fold the name.  The _SC_ constants are always in the order SIZE,
      ASSOC, LINESIZE.  */
-  int folded_name = (_SC_LEVEL1_ICACHE_SIZE
-		     + ((name - _SC_LEVEL1_ICACHE_SIZE) / 3) * 3);
+  int folded_rel_name = (M(name) / 3) * 3;
 
   while (value != 0)
     {
@@ -141,13 +141,13 @@
 	{
 	  *no_level_2_or_3 = true;
 
-	  if (folded_name == _SC_LEVEL3_CACHE_SIZE)
+	  if (folded_rel_name == M(_SC_LEVEL3_CACHE_SIZE))
 	    /* No need to look further.  */
 	    break;
 	}
       else
 	{
-	  if (byte == 0x49 && folded_name == _SC_LEVEL3_CACHE_SIZE)
+	  if (byte == 0x49 && folded_rel_name == M(_SC_LEVEL3_CACHE_SIZE))
 	    {
 	      /* Intel reused this value.  For family 15, model 6 it
 		 specifies the 3rd level cache.  Otherwise the 2nd
@@ -170,7 +170,7 @@
 		     the caller asked for the level 2 cache.  */
 		  name = (_SC_LEVEL2_CACHE_SIZE
 			  + (name - _SC_LEVEL3_CACHE_SIZE));
-		  folded_name = _SC_LEVEL3_CACHE_SIZE;
+		  folded_rel_name = M(_SC_LEVEL2_CACHE_SIZE);
 		}
 	    }
 
@@ -182,9 +182,9 @@
 			   sizeof (intel_02_known[0]), intel_02_known_compare);
 	  if (found != NULL)
 	    {
-	      if (found->name == folded_name)
+	      if (found->rel_name == folded_rel_name)
 		{
-		  unsigned int offset = name - folded_name;
+		  unsigned int offset = M(name) - folded_rel_name;
 
 		  if (offset == 0)
 		    /* Cache size.  */
@@ -196,7 +196,7 @@
 		  return found->linesize;
 		}
 
-	      if (found->name == _SC_LEVEL2_CACHE_SIZE)
+	      if (found->rel_name == M(_SC_LEVEL2_CACHE_SIZE))
 		*has_level_2 = true;
 	    }
 	}
@@ -489,10 +489,10 @@
 	}
 
 #ifdef USE_MULTIARCH
-      eax = __cpu_features.cpuid[INTEL_CPUID_INDEX_1].eax;
-      ebx = __cpu_features.cpuid[INTEL_CPUID_INDEX_1].ebx;
-      ecx = __cpu_features.cpuid[INTEL_CPUID_INDEX_1].ecx;
-      edx = __cpu_features.cpuid[INTEL_CPUID_INDEX_1].edx;
+      eax = __cpu_features.cpuid[COMMON_CPUID_INDEX_1].eax;
+      ebx = __cpu_features.cpuid[COMMON_CPUID_INDEX_1].ebx;
+      ecx = __cpu_features.cpuid[COMMON_CPUID_INDEX_1].ecx;
+      edx = __cpu_features.cpuid[COMMON_CPUID_INDEX_1].edx;
 #else
       asm volatile ("cpuid"
 		    : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx)

Modified: trunk/libc/sysdeps/x86_64/dl-machine.h
==============================================================================
--- trunk/libc/sysdeps/x86_64/dl-machine.h (original)
+++ trunk/libc/sysdeps/x86_64/dl-machine.h Mon Jun  1 06:59:14 2009
@@ -297,6 +297,7 @@
 			  : (Elf64_Addr) sym_map->l_addr + sym->st_value);
 
       if (sym != NULL
+	  && __builtin_expect (sym->st_shndx != SHN_UNDEF, 1)
 	  && __builtin_expect (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC,
 			       0))
 	value = ((Elf64_Addr (*) (void)) value) ();
@@ -442,6 +443,11 @@
 	    }
 	  break;
 #  endif
+	case R_X86_64_IRELATIVE:
+	  value = map->l_addr + reloc->r_addend;
+	  value = ((Elf64_Addr (*) (void)) value) ();
+	  *reloc_addr = value;
+	  break;
 	default:
 	  _dl_reloc_bad_type (map, r_type, 0);
 	  break;
@@ -488,6 +494,12 @@
       td->entry = (void*)(D_PTR (map, l_info[ADDRIDX (DT_TLSDESC_PLT)])
 			  + map->l_addr);
     }
+  else if (__builtin_expect (r_type == R_X86_64_IRELATIVE, 0))
+    {
+      Elf64_Addr value = map->l_addr + reloc->r_addend;
+      value = ((Elf64_Addr (*) (void)) value) ();
+      *reloc_addr = value;
+    }
   else
     _dl_reloc_bad_type (map, r_type, 1);
 }

Modified: trunk/libc/sysdeps/x86_64/multiarch/init-arch.c
==============================================================================
--- trunk/libc/sysdeps/x86_64/multiarch/init-arch.c (original)
+++ trunk/libc/sysdeps/x86_64/multiarch/init-arch.c Mon Jun  1 06:59:14 2009
@@ -1,6 +1,6 @@
 /* Initialize CPU feature data.
    This file is part of the GNU C Library.
-   Copyright (C) 2008 Free Software Foundation, Inc.
+   Copyright (C) 2008, 2009 Free Software Foundation, Inc.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -41,11 +41,12 @@
     {
       __cpu_features.kind = arch_kind_intel;
 
+    get_common_cpuid:
       asm volatile ("cpuid"
-		    : "=a" (__cpu_features.cpuid[INTEL_CPUID_INDEX_1].eax),
-		      "=b" (__cpu_features.cpuid[INTEL_CPUID_INDEX_1].ebx),
-		      "=c" (__cpu_features.cpuid[INTEL_CPUID_INDEX_1].ecx),
-		      "=d" (__cpu_features.cpuid[INTEL_CPUID_INDEX_1].edx)
+		    : "=a" (__cpu_features.cpuid[COMMON_CPUID_INDEX_1].eax),
+		      "=b" (__cpu_features.cpuid[COMMON_CPUID_INDEX_1].ebx),
+		      "=c" (__cpu_features.cpuid[COMMON_CPUID_INDEX_1].ecx),
+		      "=d" (__cpu_features.cpuid[COMMON_CPUID_INDEX_1].edx)
 		    : "0" (1));
     }
   /* This spells out "AuthenticAMD".  */
@@ -53,12 +54,7 @@
     {
       __cpu_features.kind = arch_kind_amd;
 
-      asm volatile ("cpuid"
-		    : "=a" (__cpu_features.cpuid[AMD_CPUID_INDEX_1].eax),
-		      "=b" (__cpu_features.cpuid[AMD_CPUID_INDEX_1].ebx),
-		      "=c" (__cpu_features.cpuid[AMD_CPUID_INDEX_1].ecx),
-		      "=d" (__cpu_features.cpuid[AMD_CPUID_INDEX_1].edx)
-		    : "0" (1));
+      goto get_common_cpuid;
     }
   else
     __cpu_features.kind = arch_kind_other;

Modified: trunk/libc/sysdeps/x86_64/multiarch/init-arch.h
==============================================================================
--- trunk/libc/sysdeps/x86_64/multiarch/init-arch.h (original)
+++ trunk/libc/sysdeps/x86_64/multiarch/init-arch.h Mon Jun  1 06:59:14 2009
@@ -1,5 +1,5 @@
 /* This file is part of the GNU C Library.
-   Copyright (C) 2008 Free Software Foundation, Inc.
+   Copyright (C) 2008, 2009 Free Software Foundation, Inc.
 
    The GNU C Library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
@@ -20,16 +20,9 @@
 
 enum
   {
-    INTEL_CPUID_INDEX_1 = 0,
+    COMMON_CPUID_INDEX_1 = 0,
     /* Keep the following line at the end.  */
-    INTEL_CPUID_INDEX_MAX
-  };
-
-enum
-  {
-    AMD_CPUID_INDEX_1 = 0,
-    /* Keep the following line at the end.  */
-    AMD_CPUID_INDEX_MAX
+    COMMON_CPUID_INDEX_MAX
   };
 
 extern struct cpu_features
@@ -48,7 +41,7 @@
     unsigned int ebx;
     unsigned int ecx;
     unsigned int edx;
-  } cpuid[MAX (INTEL_CPUID_INDEX_MAX, AMD_CPUID_INDEX_MAX)];
+  } cpuid[COMMON_CPUID_INDEX_MAX];
 } __cpu_features attribute_hidden;
 
 
@@ -61,10 +54,5 @@
 
 /* Following are the feature tests used throughout libc.  */
 
-#define INTEL_HAS_POPCOUNT \
-  (__cpu_features.kind == arch_kind_intel				\
-   && (__cpu_features.cpuid[INTEL_CPUID_INDEX_1].ecx & (1 << 23)) != 0)
-
-#define AMD_HAS_POPCOUNT \
-  (__cpu_features.kind == arch_kind_amd				\
-   && (__cpu_features.cpuid[AMD_CPUID_INDEX_1].ecx & (1 << 23)) != 0)
+#define HAS_POPCOUNT \
+  ((__cpu_features.cpuid[COMMON_CPUID_INDEX_1].ecx & (1 << 23)) != 0)

Modified: trunk/libc/sysdeps/x86_64/multiarch/sched_cpucount.c
==============================================================================
--- trunk/libc/sysdeps/x86_64/multiarch/sched_cpucount.c (original)
+++ trunk/libc/sysdeps/x86_64/multiarch/sched_cpucount.c Mon Jun  1 06:59:14 2009
@@ -1,6 +1,6 @@
 /* Count bits in CPU set.  x86-64 multi-arch version.
    This file is part of the GNU C Library.
-   Copyright (C) 2008 Free Software Foundation, Inc.
+   Copyright (C) 2008, 2009 Free Software Foundation, Inc.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -18,25 +18,20 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
-#ifdef SHARED
-# include <sched.h>
-# include "init-arch.h"
+#include <sched.h>
+#include "init-arch.h"
 
-# define __sched_cpucount static generic_cpucount
-# include <posix/sched_cpucount.c>
-# undef __sched_cpucount
+#define __sched_cpucount static generic_cpucount
+#include <posix/sched_cpucount.c>
+#undef __sched_cpucount
 
-# define POPCNT(l) \
+#define POPCNT(l) \
   ({ __cpu_mask r; \
      asm ("popcntq %1, %0" : "=r" (r) : "0" (l));\
      r; })
-# define __sched_cpucount static popcount_cpucount
-# include <posix/sched_cpucount.c>
-# undef __sched_cpucount
+#define __sched_cpucount static popcount_cpucount
+#include <posix/sched_cpucount.c>
+#undef __sched_cpucount
 
 libc_ifunc (__sched_cpucount,
-	    INTEL_HAS_POPCOUNT || AMD_HAS_POPCOUNT
-	    ? popcount_cpucount : generic_cpucount);
-#else
-# include_next <sched_cpucount.c>
-#endif
+	    HAS_POPCOUNT ? popcount_cpucount : generic_cpucount);