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

[Commits] r18661 - in /fsf/trunk/libc: ./ localedata/ localedata/locales/ nss/ sysdeps/powerpc/powerpc32/power6/fpu/ sysdeps/powerpc/p...



Author: eglibc
Date: Wed May 23 00:03:52 2012
New Revision: 18661

Log:
Import glibc-mainline for 2012-05-23

Added:
    fsf/trunk/libc/localedata/locales/mag_IN
    fsf/trunk/libc/sysdeps/unix/sysv/linux/bits/sysctl.h
    fsf/trunk/libc/sysdeps/unix/sysv/linux/sysctl.mk
    fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/bits/sysctl.h
    fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/x32/arch_prctl.c
    fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/x32/sysctl.mk
Modified:
    fsf/trunk/libc/ChangeLog
    fsf/trunk/libc/Makerules
    fsf/trunk/libc/NEWS
    fsf/trunk/libc/localedata/ChangeLog
    fsf/trunk/libc/localedata/SUPPORTED
    fsf/trunk/libc/nss/nsswitch.c
    fsf/trunk/libc/sysdeps/powerpc/powerpc32/power6/fpu/s_copysign.S
    fsf/trunk/libc/sysdeps/powerpc/powerpc32/power7/fpu/s_finite.S
    fsf/trunk/libc/sysdeps/powerpc/powerpc32/power7/fpu/s_logb.c
    fsf/trunk/libc/sysdeps/powerpc/powerpc64/power6/fpu/s_copysign.S
    fsf/trunk/libc/sysdeps/powerpc/powerpc64/power7/fpu/s_finite.S
    fsf/trunk/libc/sysdeps/unix/make-syscalls.sh
    fsf/trunk/libc/sysdeps/unix/sysv/linux/Makefile
    fsf/trunk/libc/sysdeps/unix/sysv/linux/bits/resource.h
    fsf/trunk/libc/sysdeps/unix/sysv/linux/dl-vdso.h
    fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/sysdep.h
    fsf/trunk/libc/sysdeps/unix/sysv/linux/sys/sysctl.h
    fsf/trunk/libc/sysdeps/unix/sysv/linux/wordsize-64/posix_fallocate.c
    fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h
    fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/sched_getcpu.S
    fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/sysdep.h
    fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/x32/Makefile
    fsf/trunk/libc/time/mktime.c

Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Wed May 23 00:03:52 2012
@@ -1,3 +1,119 @@
+2012-05-22  Roland McGrath  <roland@xxxxxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/dl-vdso.h (CHECK_HASH): Macro removed.
+	(PREPARE_VERSION): Just use assert instead, it will be elided
+	under [NDEBUG] anyway.
+
+2012-05-22  H.J. Lu  <hongjiu.lu@xxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/Makefile: Include
+	$(firstword $(wildcard $(sysdirs:=/sysctl.mk))).
+	(sysdep_routines): Remove sysctl.
+	* sysdeps/unix/sysv/linux/bits/sysctl.h: New file.
+	* sysdeps/unix/sysv/linux/sysctl.mk: Likewise.
+	* sysdeps/unix/sysv/linux/x86_64/bits/sysctl.h: Likewise.
+	* sysdeps/unix/sysv/linux/x86_64/x32/sysctl.mk: Likewise.
+	* sysdeps/unix/sysv/linux/sys/sysctl.h: Include <bits/sysctl.h>.
+
+2012-05-22  Andreas Jaeger  <aj@xxxxxxx>
+
+	* sysdeps/unix/sysv/linux/x86_64/sched_getcpu.S: Rearrange code so
+	that pseudo_end is just ret and the stack pointer is correct also
+	for static library in error case.
+
+2012-05-22  Paul Pluzhnikov  <ppluzhnikov@xxxxxxxxxx>
+
+	[BZ #14122]
+	* nss/nsswitch.c (defconfig_entries): New variable.
+	(__nss_database_lookup): Don't leak defconfig entries.
+	(nss_parse_service_list): Don't leak on error paths.
+	(free_database_entries): New function.
+	(free_defconfig): New function.
+	(free_mem): Move common code to free_database_entries.
+
+2012-05-22  H.J. Lu  <hongjiu.lu@xxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/x86_64/x32/Makefile (sysdep_routines):
+	Add arch_prctl.
+	* sysdeps/unix/sysv/linux/x86_64/x32/arch_prctl.c: New file.
+
+	* sysdeps/unix/sysv/linux/wordsize-64/posix_fallocate.c
+	(posix_fallocate): Use INTERNAL_SYSCALL_TYPES if it is defined.
+	* sysdeps/unix/sysv/linux/x86_64/sysdep.h (INLINE_SYSCALL_TYPES):
+	New macro.
+	(INTERNAL_SYSCALL_NCS_TYPES): Likewise.
+	(INTERNAL_SYSCALL_TYPES): Likewise.
+	(LOAD_ARGS_TYPES_[1-6]): Likewise.
+	(LOAD_REGS_TYPES_[1-6]): Likewise.
+	(LOAD_ARGS_[1-6]): Use LOAD_ARGS_TYPES_[1-6].
+	(LOAD_REGS_[1-6]): Use LOAD_REGS_TYPES_[1-6].
+
+2012-05-22  Adhemerval Zanella  <azanella@xxxxxxxxxxxxxxxxxx>
+
+	* sysdeps/powerpc/powerpc32/power6/fpu/s_copysign.S: Add compat symbol
+	copysignl for GLIBC_2_0.
+	* sysdeps/powerpc/powerpc32/power7/fpu/s_finite.S: Add compat symbol
+	finitel for GLIBC_2.0 and __finitel for GLIBC_2_1.
+	* sysdeps/powerpc/powerpc32/power7/fpu/s_logb.c: Add compat symbol
+	logbl for GLIBC_2_0.
+	* sysdeps/powerpc/powerpc64/power6/fpu/s_copysign.S: Likewise.
+	* sysdeps/powerpc/powerpc64/power7/fpu/s_finite.S: Likewise.
+
+2012-05-22  H.J. Lu  <hongjiu.lu@xxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h: Don't include
+	<bits/wordsize.h>.  Check __x86_64__ instead of __WORDSIZE.
+
+	* sysdeps/unix/sysv/linux/i386/sysdep.h (SYSCALL_ERROR_HANDLER):
+	Use "neg %eax".
+
+	* time/mktime.c: Update copyright years.
+
+2012-05-22  Paul Eggert  <eggert@xxxxxxxxxxx>
+
+	mktime: merge comment-quoting-style change from gnulib
+	* time/mktime.c: Quote 'like this' in comments.
+	The GNU coding standards suggest that we no longer quote `like this',
+	as "`" and "'" are typically rendered asymmetrically nowadays.
+	The typical gnulib style is to quote 'like this' when quoting
+	code, and "like this" when quoting English.
+
+	* time/mktime.c (compile-command): Add "-I.".
+
+	mktime: merge mktime-internal.h change from gnulib
+	* time/mktime.c [!_LIBC]: Include "mktime-internal.h".
+
+	mktime: merge time_r change from gnulib
+	* time/mktime.c [!_LIBC]: Do not include "time_r.h".
+
+	mktime: merge DEBUG change from gnulib
+	* time/mktime.c (mktime) [DEBUG]: #undef before #define-ing, in
+	case system <time.h> has a #define.
+
+	mktime: merge <sys/types.h> change from gnulib
+	* time/mktime.c: Do not include <sys/types.h>; no longer needed,
+	since <time.t> is now guaranteed to define time_t.
+
+	mktime: merge HAVE_CONFIG_H change from gnulib
+	* time/mktime.c: Include <config.h> if !_LIBC, not if HAVE_CONFIG_H.
+
+2012-05-22  H.J. Lu  <hongjiu.lu@xxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/x86_64/sysdep.h (SYSCALL_SET_ERRNO):
+	Use "neg %eax".
+
+	* sysdeps/unix/sysv/linux/bits/resource.h (RLIM_INFINITY): Use
+	__rlim_t cast.
+	(struct rusage): Use anonymous union to pad each field to
+	__syscall_slong_t.
+
+2012-05-21  David S. Miller  <davem@xxxxxxxxxxxxx>
+
+	* Makefules (o-iterator): Remove .s cases.
+	(compile-command.s): Delete.
+	(COMPILE.s): Delete.
+	* sysdeps/unix/make-syscalls.sh: Remove .s file tests.
+
 2012-05-21  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
 
 	* configure.in (libc_cv_predef_stack_protector): Only consider

Modified: fsf/trunk/libc/Makerules
==============================================================================
--- fsf/trunk/libc/Makerules (original)
+++ fsf/trunk/libc/Makerules Wed May 23 00:03:52 2012
@@ -275,12 +275,6 @@
 include $(o-iterator)
 
 define o-iterator-doit
-$(objpfx)%$o: %.s $(before-compile); $$(compile-command.s)
-endef
-object-suffixes-left := $(all-object-suffixes)
-include $(o-iterator)
-
-define o-iterator-doit
 $(objpfx)%$o: %.c $(before-compile); $$(compile-command.c)
 endef
 object-suffixes-left := $(all-object-suffixes)
@@ -299,12 +293,6 @@
 # Generated source files will end up there.
 define o-iterator-doit
 $(objpfx)%$o: $(objpfx)%.S $(before-compile); $$(compile-command.S)
-endef
-object-suffixes-left := $(all-object-suffixes)
-include $(o-iterator)
-
-define o-iterator-doit
-$(objpfx)%$o: $(objpfx)%.s $(before-compile); $$(compile-command.s)
 endef
 object-suffixes-left := $(all-object-suffixes)
 include $(o-iterator)
@@ -365,7 +353,6 @@
 # Generate .dT files as we compile.
 compile-mkdep-flags = -MD -MP -MF $@.dt -MT $@
 compile-command.S = $(compile.S) $(OUTPUT_OPTION) $(compile-mkdep-flags)
-compile-command.s = $(COMPILE.s) $< $(OUTPUT_OPTION) $(compile-mkdep-flags)
 compile-command.c = $(compile.c) $(OUTPUT_OPTION) $(compile-mkdep-flags)
 compile-command.cc = $(compile.cc) $(OUTPUT_OPTION) $(compile-mkdep-flags)
 
@@ -381,7 +368,6 @@
 		  $(ASFLAGS) $(ASFLAGS-$(suffix $@))
 COMPILE.S = $(CC) -c $(CPPFLAGS) $(S-CPPFLAGS) \
 		  $(ASFLAGS) $(ASFLAGS-$(suffix $@))
-COMPILE.s = $(filter-out -pipe,$(CC)) -c $(ASFLAGS)
 
 # We need this for the output to go in the right place.  It will default to
 # empty if make was configured to work with a cc that can't grok -c and -o

Modified: fsf/trunk/libc/NEWS
==============================================================================
--- fsf/trunk/libc/NEWS (original)
+++ fsf/trunk/libc/NEWS Wed May 23 00:03:52 2012
@@ -25,9 +25,10 @@
   13871, 13872, 13873, 13879, 13883, 13884, 13885, 13886, 13892, 13895,
   13908, 13910, 13911, 13912, 13913, 13914, 13915, 13916, 13917, 13918,
   13919, 13920, 13921, 13922, 13923, 13924, 13926, 13927, 13928, 13938,
-  13941, 13942, 13954, 13955, 13956, 13963, 13967, 13970, 13973, 13979,
-  13983, 13986, 14012, 14027, 14033, 14034, 14040, 14043, 14044, 14049,
-  14053, 14055, 14059, 14064, 14080, 14083, 14103, 14104, 14109, 14123
+  13941, 13942, 13954, 13955, 13956, 13963, 13967, 13968, 13970, 13973,
+  13979, 13983, 13986, 14012, 14027, 14033, 14034, 14040, 14043, 14044,
+  14049, 14053, 14055, 14059, 14064, 14080, 14083, 14103, 14104, 14109,
+  14122, 14123
 
 * ISO C11 support:
 
@@ -69,6 +70,8 @@
 * Compatibility code for Linux kernel versions before 2.2 has been removed.
   Note that glibc is not expected to work with any Linux kernel version
   before 2.6.
+
+* New locales: mag_IN
 
 Version 2.15
 

Modified: fsf/trunk/libc/localedata/ChangeLog
==============================================================================
--- fsf/trunk/libc/localedata/ChangeLog (original)
+++ fsf/trunk/libc/localedata/ChangeLog Wed May 23 00:03:52 2012
@@ -1,3 +1,9 @@
+2012-04-20  Chandan Kumar  <chandankumar.093047@xxxxxxxxx>
+
+	[BZ#13968]
+	* locales/mag_IN: New file.
+	* SUPPORTED (SUPPORTED-LOCALES): Add appropriate entry.
+
 2012-05-21  Bruno Haible  <bruno@xxxxxxxxx>
 	    Andreas Jaeger  <aj@xxxxxxx>
 

Modified: fsf/trunk/libc/localedata/SUPPORTED
==============================================================================
--- fsf/trunk/libc/localedata/SUPPORTED (original)
+++ fsf/trunk/libc/localedata/SUPPORTED Wed May 23 00:03:52 2012
@@ -285,6 +285,7 @@
 lt_LT/ISO-8859-13 \
 lv_LV.UTF-8/UTF-8 \
 lv_LV/ISO-8859-13 \
+mag_IN/UTF-8 \
 mai_IN/UTF-8 \
 mg_MG.UTF-8/UTF-8 \
 mg_MG/ISO-8859-15 \

Added: fsf/trunk/libc/localedata/locales/mag_IN
==============================================================================
--- fsf/trunk/libc/localedata/locales/mag_IN (added)
+++ fsf/trunk/libc/localedata/locales/mag_IN Wed May 23 00:03:52 2012
@@ -1,0 +1,168 @@
+comment_char    %
+escape_char     /
+% Magahi language locale for India.
+% Contributed by Chandan Kumar <chandankumar.093047@xxxxxxxxx>,
+# Rajesh Ranjan <rajeshkajha@xxxxxxxxx>
+% and Pravin Satpute <psatpute@xxxxxxxxxx>
+
+LC_IDENTIFICATION
+title      "Magahi language locale for India"
+source     ""
+address    ""
+contact    ""
+email      "bhashaghar@xxxxxxxxxxxxxxxx"
+tel        ""
+fax        ""
+language   "Magahi"
+territory  "India"
+revision   "0.1"
+date       "2012-04-11"
+%
+category  "mag_IN:2012";LC_IDENTIFICATION
+category  "mag_IN:2012";LC_CTYPE
+category  "mag_IN:2012";LC_COLLATE
+category  "mag_IN:2012";LC_TIME
+category  "mag_IN:2012";LC_NUMERIC
+category  "mag_IN:2012";LC_MONETARY
+category  "mag_IN:2012";LC_MESSAGES
+category  "mag_IN:2012";LC_PAPER
+category  "mag_IN:2012";LC_NAME
+category  "mag_IN:2012";LC_ADDRESS
+category  "mag_IN:2012";LC_TELEPHONE
+
+END LC_IDENTIFICATION
+
+LC_CTYPE
+copy "hi_IN"
+END LC_CTYPE
+
+LC_COLLATE
+copy "hi_IN"
+END LC_COLLATE
+
+LC_MONETARY
+copy "hi_IN"
+END LC_MONETARY
+
+
+LC_NUMERIC
+copy "hi_IN"
+END LC_NUMERIC
+
+
+LC_TIME
+% This is the POSIX Locale definition for the LC_TIME category.
+% These are generated based on XML base Locale definition file
+% for IBM Class for Unicode/Java
+%
+% Abbreviated weekday names (%a)
+abday       "<U090f><U0924><U0935><U093e><U0930><U0020>";/
+            "<U0938><U094b><U092e><U093e><U0930><U0020>";/
+            "<U092e><U0902><U0917><U0930><U0020>";/
+            "<U092c><U0941><U0927><U0020>";/
+            "<U092c><U093f><U092b><U0947><U0020>";/
+            "<U0938><U0942><U0915><U0020>";/
+            "<U0938><U0928><U093f><U091a><U0930><U0020>"
+%
+% Full weekday names (%A)
+day         "<U090f><U0924><U0935><U093e><U0930><U0020>";/
+            "<U0938><U094b><U092e><U093e><U0930><U0020>";/
+            "<U092e><U0902><U0917><U0930><U0020>";/
+            "<U092c><U0941><U0927><U0020>";/
+            "<U092c><U093f><U092b><U0947><U0020>";/
+            "<U0938><U0942><U0915><U0020>";/
+            "<U0938><U0928><U093f><U091a><U0930><U0020>"
+%
+% Abbreviated month names (%b)
+abmon       "<U091C><U0928><U0935><U0930><U0940>";/
+            "<U092B><U093C><U0930><U0935><U0930><U0940>";/
+            "<U092E><U093E><U0930><U094D><U091A>";/
+            "<U0905><U092A><U094D><U0930><U0947><U0932>";/
+            "<U092E><U0908>";"<U091C><U0942><U0928>";/
+            "<U091C><U0941><U0932><U093E><U0908>";/
+            "<U0905><U0917><U0938><U094D><U0924>";/
+            "<U0938><U093F><U0924><U092E><U094D><U092C><U0930>";/
+            "<U0905><U0915><U094D><U091F><U0942><U092C><U0930>";/
+            "<U0928><U0935><U092E><U094D><U092C><U0930>";/
+            "<U0926><U093F><U0938><U092E><U094D><U092C><U0930>"
+%
+% Full month names (%B)
+mon         "<U091C><U0928><U0935><U0930><U0940>";/
+            "<U092B><U093C><U0930><U0935><U0930><U0940>";/
+            "<U092E><U093E><U0930><U094D><U091A>";/
+            "<U0905><U092A><U094D><U0930><U0947><U0932>";/
+            "<U092E><U0908>";"<U091C><U0942><U0928>";/
+            "<U091C><U0941><U0932><U093E><U0908>";/
+            "<U0905><U0917><U0938><U094D><U0924>";/
+            "<U0938><U093F><U0924><U092E><U094D><U092C><U0930>";/
+            "<U0905><U0915><U094D><U091F><U0942><U092C><U0930>";/
+            "<U0928><U0935><U092E><U094D><U092C><U0930>";/
+            "<U0926><U093F><U0938><U092E><U094D><U092C><U0930>"
+%
+% Equivalent of AM PM
+am_pm       "<U092A><U0942><U0930><U094D><U0935><U093E><U0939><U094D><U0928>";/
+            "<U0905><U092A><U0930><U093E><U0939><U094D><U0928>"
+%
+% Appropriate date and time representation
+% %A %d %b %Y%I:%M:%S  %Z
+d_t_fmt     "<U0025><U0041><U0020><U0025><U0064><U0020><U0025><U0062>/
+<U0020><U0025><U0059><U0020><U0025><U0049><U003A><U0025><U004D><U003A>/
+<U0025><U0053><U0020><U0025><U0070><U0020><U0025><U005A>"
+%
+% Appropriate date representation
+% %A %d %b %Y
+d_fmt       "<U0025><U0041><U0020><U0025><U0064><U0020><U0025><U0062>/
+<U0020><U0025><U0059>"
+%
+% Appropriate time representation
+% %I:%M:%S  %Z
+t_fmt       "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053>/
+<U0020><U0020><U0025><U005A>"
+%
+% Appropriate 12 h time representation (%r)
+t_fmt_ampm  "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053>/
+<U0020><U0025><U0070><U0020><U0025><U005A>"
+%
+date_fmt       "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065>/
+<U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020>/
+<U0025><U005A><U0020><U0025><U0059>"
+END LC_TIME
+
+LC_MESSAGES
+copy "hi_IN"
+END LC_MESSAGES
+
+
+LC_PAPER
+copy "hi_IN"
+END LC_PAPER
+
+
+LC_NAME
+% This is the ISO_IEC TR14652 Locale definition for the
+% LC_NAME category.
+%
+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0066><U0025><U0074>/
+<U0025><U0067>"
+name_gen    ""
+name_mr     "<U0936><U094d><U0930><U0940><U002E>"
+name_mrs    "U0936><U094d><U0930><U0940><U092e><U0924><U0940><U002E>"
+name_miss   "<U0938><U0941><U0936><U094d><U0930><U0940><U002E>"
+name_ms     "<U0938><U0941><U0936><U094d><U0930><U0940><U002E>"
+
+END LC_NAME
+
+
+LC_ADDRESS
+copy "hi_IN"
+END LC_ADDRESS
+
+
+LC_TELEPHONE
+copy "hi_IN"
+END LC_TELEPHONE
+
+
+LC_MEASUREMENT
+copy "hi_IN"
+END LC_MEASUREMENT

Modified: fsf/trunk/libc/nss/nsswitch.c
==============================================================================
--- fsf/trunk/libc/nss/nsswitch.c (original)
+++ fsf/trunk/libc/nss/nsswitch.c Wed May 23 00:03:52 2012
@@ -1,5 +1,4 @@
-/* Copyright (C) 1996-2012
-   Free Software Foundation, Inc.
+/* Copyright (C) 1996-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1996.
 
@@ -86,6 +85,12 @@
 /* The root of the whole data base.  */
 static name_database *service_table;
 
+/* List of default service lists that were generated by glibc because
+   /etc/nsswitch.conf did not provide a value.
+   The list is only maintained so we can free such service lists in
+   __libc_freeres.  */
+static name_database_entry *defconfig_entries;
+
 
 /* Nonzero if this is the nscd process.  */
 static bool is_nscd;
@@ -141,8 +146,27 @@
      DEFCONFIG specifies the default service list for this database,
      or null to use the most common default.  */
   if (*ni == NULL)
-    *ni = nss_parse_service_list (defconfig
-				  ?: "nis [NOTFOUND=return] files");
+    {
+      *ni = nss_parse_service_list (defconfig
+				    ?: "nis [NOTFOUND=return] files");
+      if (*ni != NULL)
+	{
+	  /* Record the memory we've just allocated in defconfig_entries list,
+	     so we can free it later.  */
+	  name_database_entry *entry;
+
+	  /* Allocate ENTRY plus size of name (1 here).  */
+	  entry = (name_database_entry *) malloc (sizeof (*entry) + 1);
+
+	  if (entry != NULL)
+	    {
+	      entry->next = defconfig_entries;
+	      entry->service = *ni;
+	      entry->name[0] = '\0';
+	      defconfig_entries = entry;
+	    }
+	}
+    }
 
   __libc_lock_unlock (lock);
 
@@ -644,7 +668,7 @@
 		  else if (__strncasecmp (name, "UNAVAIL", 7) == 0)
 		    status = NSS_STATUS_UNAVAIL;
 		  else
-		    return result;
+		    goto finish;
 		}
 	      else if (line - name == 8)
 		{
@@ -653,15 +677,15 @@
 		  else if (__strncasecmp (name, "TRYAGAIN", 8) == 0)
 		    status = NSS_STATUS_TRYAGAIN;
 		  else
-		    return result;
+		    goto finish;
 		}
 	      else
-		return result;
+		goto finish;
 
 	      while (isspace (line[0]))
 		++line;
 	      if (line[0] != '=')
-		return result;
+		goto finish;
 	      do
 		++line;
 	      while (isspace (line[0]));
@@ -677,7 +701,7 @@
 		       && __strncasecmp (name, "CONTINUE", 8) == 0)
 		action = NSS_ACTION_CONTINUE;
 	      else
-		return result;
+		goto finish;
 
 	      if (not)
 		{
@@ -705,6 +729,11 @@
 
       *nextp = new_service;
       nextp = &new_service->next;
+      continue;
+
+    finish:
+      free (new_service);
+      return result;
     }
 }
 
@@ -816,12 +845,48 @@
 }
 #endif
 
+static void
+free_database_entries (name_database_entry *entry)
+{
+  while (entry != NULL)
+    {
+      name_database_entry *olde = entry;
+      service_user *service = entry->service;
+
+      while (service != NULL)
+	{
+	  service_user *olds = service;
+
+	  if (service->known != NULL)
+	    __tdestroy (service->known, free);
+
+	  service = service->next;
+	  free (olds);
+	}
+
+      entry = entry->next;
+      free (olde);
+    }
+}
 
 /* Free all resources if necessary.  */
+libc_freeres_fn (free_defconfig)
+{
+  name_database_entry *entry = defconfig_entries;
+
+  if (entry == NULL)
+    /* defconfig was not used.  */
+    return;
+
+  /* Don't disturb ongoing other threads (if there are any).  */
+  defconfig_entries = NULL;
+
+  free_database_entries (entry);
+}
+
 libc_freeres_fn (free_mem)
 {
   name_database *top = service_table;
-  name_database_entry *entry;
   service_library *library;
 
   if (top == NULL)
@@ -831,26 +896,7 @@
   /* Don't disturb ongoing other threads (if there are any).  */
   service_table = NULL;
 
-  entry = top->entry;
-  while (entry != NULL)
-    {
-      name_database_entry *olde = entry;
-      service_user *service = entry->service;
-
-      while (service != NULL)
-	{
-	  service_user *olds = service;
-
-	  if (service->known != NULL)
-	    __tdestroy (service->known, free);
-
-	  service = service->next;
-	  free (olds);
-	}
-
-      entry = entry->next;
-      free (olde);
-    }
+  free_database_entries (top->entry);
 
   library = top->library;
   while (library != NULL)

Modified: fsf/trunk/libc/sysdeps/powerpc/powerpc32/power6/fpu/s_copysign.S
==============================================================================
--- fsf/trunk/libc/sysdeps/powerpc/powerpc32/power6/fpu/s_copysign.S (original)
+++ fsf/trunk/libc/sysdeps/powerpc/powerpc32/power6/fpu/s_copysign.S Wed May 23 00:03:52 2012
@@ -47,9 +47,12 @@
 weak_alias (__copysign, copysignl)
 #endif
 
-#ifndef IS_IN_libm
-# if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
-compat_symbol (libc, __copysign, __copysignl, GLIBC_2_0);
+#ifdef IS_IN_libm
+# if LONG_DOUBLE_COMPAT (libm, GLIBC_2_0)
+compat_symbol (libm, copysign, copysignl, GLIBC_2_0)
+# endif
+#else
+# if LONG_DOUBLE_COMPAT (libc, GLIBC_2_0)
 compat_symbol (libc, copysign, copysignl, GLIBC_2_0);
 # endif
 #endif

Modified: fsf/trunk/libc/sysdeps/powerpc/powerpc32/power7/fpu/s_finite.S
==============================================================================
--- fsf/trunk/libc/sysdeps/powerpc/powerpc32/power7/fpu/s_finite.S (original)
+++ fsf/trunk/libc/sysdeps/powerpc/powerpc32/power7/fpu/s_finite.S Wed May 23 00:03:52 2012
@@ -79,8 +79,15 @@
 weak_alias (__finite, finitel)
 #endif
 
-#ifndef IS_IN_libm
-# if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
+#ifdef IS_IN_libm
+# if LONG_DOUBLE_COMPAT (libm, GLIBC_2_0)
+compat_symbol (libm, finite, finitel, GLIBC_2_0)
+# endif
+# if LONG_DOUBLE_COMPAT (libm, GLIBC_2_1)
+compat_symbol (libm, __finite, __finitel, GLIBC_2_1)
+# endif
+#else
+# if LONG_DOUBLE_COMPAT (libc, GLIBC_2_0)
 compat_symbol (libc, __finite, __finitel, GLIBC_2_0);
 compat_symbol (libc, finite, finitel, GLIBC_2_0);
 # endif

Modified: fsf/trunk/libc/sysdeps/powerpc/powerpc32/power7/fpu/s_logb.c
==============================================================================
--- fsf/trunk/libc/sysdeps/powerpc/powerpc32/power7/fpu/s_logb.c (original)
+++ fsf/trunk/libc/sysdeps/powerpc/powerpc32/power7/fpu/s_logb.c Wed May 23 00:03:52 2012
@@ -16,7 +16,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include "math_private.h"
+#include <math_ldbl_opt.h>
 
 /* This implementation avoids FP to INT conversions by using VSX
    bitwise instructions over FP values.  */
@@ -66,10 +66,12 @@
   /* Test to avoid logb_downward (0.0) == -0.0.  */
   return ret == -0.0 ? 0.0 : ret;
 }
-
 weak_alias (__logb, logb)
-
 #ifdef NO_LONG_DOUBLE
 strong_alias (__logb, __logbl)
 weak_alias (__logb, logbl)
 #endif
+
+#if LONG_DOUBLE_COMPAT (libm, GLIBC_2_0)
+compat_symbol (libm, logb, logbl, GLIBC_2_0);
+#endif

Modified: fsf/trunk/libc/sysdeps/powerpc/powerpc64/power6/fpu/s_copysign.S
==============================================================================
--- fsf/trunk/libc/sysdeps/powerpc/powerpc64/power6/fpu/s_copysign.S (original)
+++ fsf/trunk/libc/sysdeps/powerpc/powerpc64/power6/fpu/s_copysign.S Wed May 23 00:03:52 2012
@@ -47,9 +47,12 @@
 weak_alias (__copysign, copysignl)
 #endif
 
-#ifndef IS_IN_libm
+#ifdef IS_IN_libm
+# if LONG_DOUBLE_COMPAT (libm, GLIBC_2_0)
+compat_symbol (libm, copysign, copysignl, GLIBC_2_0)
+# endif
+#else
 # if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
-compat_symbol (libc, __copysign, __copysignl, GLIBC_2_0);
 compat_symbol (libc, copysign, copysignl, GLIBC_2_0);
 # endif
 #endif

Modified: fsf/trunk/libc/sysdeps/powerpc/powerpc64/power7/fpu/s_finite.S
==============================================================================
--- fsf/trunk/libc/sysdeps/powerpc/powerpc64/power7/fpu/s_finite.S (original)
+++ fsf/trunk/libc/sysdeps/powerpc/powerpc64/power7/fpu/s_finite.S Wed May 23 00:03:52 2012
@@ -59,8 +59,13 @@
 hidden_def (__finitef)
 weak_alias (__finitef, finitef)
 
-#ifndef IS_IN_libm
-# if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
+#ifdef IS_IN_libm
+# if LONG_DOUBLE_COMPAT (libm, GLIBC_2_0)
+compat_symbol (libm, __finite, __finitel, GLIBC_2_0)
+compat_symbol (libm, finite, finitel, GLIBC_2_0)
+# endif
+#else
+# if LONG_DOUBLE_COMPAT (libc, GLIBC_2_0)
 compat_symbol (libc, __finite, __finitel, GLIBC_2_0);
 compat_symbol (libc, finite, finitel, GLIBC_2_0);
 # endif

Modified: fsf/trunk/libc/sysdeps/unix/make-syscalls.sh
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/make-syscalls.sh (original)
+++ fsf/trunk/libc/sysdeps/unix/make-syscalls.sh Wed May 23 00:03:52 2012
@@ -54,11 +54,9 @@
   for dir in $sysdirs; do
      { test -f $dir/$file.c && srcfile=$dir/$file.c; } ||
      { test -f $dir/$file.S && srcfile=$dir/$file.S; } ||
-     { test -f $dir/$file.s && srcfile=$dir/$file.s; } ||
      { test x$caller != x- &&
 	{ { test -f $dir/$caller.c && srcfile=$dir/$caller.c; } ||
-	  { test -f $dir/$caller.S && srcfile=$dir/$caller.S; } ||
-	  { test -f $dir/$caller.s && srcfile=$dir/$caller.s; }; }; } && break;
+	  { test -f $dir/$caller.S && srcfile=$dir/$caller.S; }; }; } && break;
   done;
   echo $file $srcfile $caller $rest;
 done`

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/Makefile
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/Makefile (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/Makefile Wed May 23 00:03:52 2012
@@ -17,7 +17,9 @@
 endif
 
 ifeq ($(subdir),misc)
-sysdep_routines += sysctl clone llseek umount umount2 readahead \
+include $(firstword $(wildcard $(sysdirs:=/sysctl.mk)))
+
+sysdep_routines += clone llseek umount umount2 readahead \
 		   setfsuid setfsgid makedev epoll_pwait signalfd \
 		   eventfd eventfd_read eventfd_write prlimit
 

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/bits/resource.h
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/bits/resource.h (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/bits/resource.h Wed May 23 00:03:52 2012
@@ -1,6 +1,5 @@
 /* Bit values & structures for resource limits.  Linux version.
-   Copyright (C) 1994, 1996-2000, 2004, 2005, 2008, 2009, 2010, 2011, 2012
-   Free Software Foundation, Inc.
+   Copyright (C) 1994-2012 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
@@ -113,7 +112,7 @@
 
 /* Value to indicate that there is no limit.  */
 #ifndef __USE_FILE_OFFSET64
-# define RLIM_INFINITY ((unsigned long int)(~0UL))
+# define RLIM_INFINITY ((__rlim_t) -1)
 #else
 # define RLIM_INFINITY 0xffffffffffffffffuLL
 #endif
@@ -180,6 +179,11 @@
 #include <bits/time.h>		/* For `struct timeval'.  */
 
 /* Structure which says how much of each resource has been used.  */
+
+/* The purpose of all the unions is to have the kernel-compatible layout
+   while keeping the API type as 'long int', and among machines where
+   __syscall_slong_t is not 'long int', this only does the right thing
+   for little-endian ones, like x32.  */
 struct rusage
   {
     /* Total amount of user time used.  */
@@ -187,39 +191,96 @@
     /* Total amount of system time used.  */
     struct timeval ru_stime;
     /* Maximum resident set size (in kilobytes).  */
-    long int ru_maxrss;
+    __extension__ union
+      {
+	long int ru_maxrss;
+	__syscall_slong_t __ru_maxrss_word;
+      };
     /* Amount of sharing of text segment memory
        with other processes (kilobyte-seconds).  */
-    long int ru_ixrss;
+    /* Maximum resident set size (in kilobytes).  */
+    __extension__ union
+      {
+	long int ru_ixrss;
+	__syscall_slong_t __ru_ixrss_word;
+      };
     /* Amount of data segment memory used (kilobyte-seconds).  */
-    long int ru_idrss;
+    __extension__ union
+      {
+	long int ru_idrss;
+	__syscall_slong_t __ru_idrss_word;
+      };
     /* Amount of stack memory used (kilobyte-seconds).  */
-    long int ru_isrss;
+    __extension__ union
+      {
+	long int ru_isrss;
+	 __syscall_slong_t __ru_isrss_word;
+      };
     /* Number of soft page faults (i.e. those serviced by reclaiming
        a page from the list of pages awaiting reallocation.  */
-    long int ru_minflt;
+    __extension__ union
+      {
+	long int ru_minflt;
+	__syscall_slong_t __ru_minflt_word;
+      };
     /* Number of hard page faults (i.e. those that required I/O).  */
-    long int ru_majflt;
+    __extension__ union
+      {
+	long int ru_majflt;
+	__syscall_slong_t __ru_majflt_word;
+      };
     /* Number of times a process was swapped out of physical memory.  */
-    long int ru_nswap;
+    __extension__ union
+      {
+	long int ru_nswap;
+	__syscall_slong_t __ru_nswap_word;
+      };
     /* Number of input operations via the file system.  Note: This
        and `ru_oublock' do not include operations with the cache.  */
-    long int ru_inblock;
+    __extension__ union
+      {
+	long int ru_inblock;
+	__syscall_slong_t __ru_inblock_word;
+      };
     /* Number of output operations via the file system.  */
-    long int ru_oublock;
+    __extension__ union
+      {
+	long int ru_oublock;
+	__syscall_slong_t __ru_oublock_word;
+      };
     /* Number of IPC messages sent.  */
-    long int ru_msgsnd;
+    __extension__ union
+      {
+	long int ru_msgsnd;
+	__syscall_slong_t __ru_msgsnd_word;
+      };
     /* Number of IPC messages received.  */
-    long int ru_msgrcv;
+    __extension__ union
+      {
+	long int ru_msgrcv;
+	__syscall_slong_t __ru_msgrcv_word;
+      };
     /* Number of signals delivered.  */
-    long int ru_nsignals;
+    __extension__ union
+      {
+	long int ru_nsignals;
+	__syscall_slong_t __ru_nsignals_word;
+      };
     /* Number of voluntary context switches, i.e. because the process
        gave up the process before it had to (usually to wait for some
        resource to be available).  */
-    long int ru_nvcsw;
+    __extension__ union
+      {
+	long int ru_nvcsw;
+	__syscall_slong_t __ru_nvcsw_word;
+      };
     /* Number of involuntary context switches, i.e. a higher priority process
        became runnable or the current process used up its time slice.  */
-    long int ru_nivcsw;
+    __extension__ union
+      {
+	long int ru_nivcsw;
+	__syscall_slong_t __ru_nivcsw_word;
+      };
   };
 
 /* Priority limits.  */

Added: fsf/trunk/libc/sysdeps/unix/sysv/linux/bits/sysctl.h
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/bits/sysctl.h (added)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/bits/sysctl.h Wed May 23 00:03:52 2012
@@ -1,0 +1,1 @@
+/* Empty file.  */

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/dl-vdso.h
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/dl-vdso.h (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/dl-vdso.h Wed May 23 00:03:52 2012
@@ -1,5 +1,5 @@
 /* ELF symbol resolve functions for VDSO objects.
-   Copyright (C) 2005, 2007 Free Software Foundation, Inc.
+   Copyright (C) 2005-2012 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
@@ -21,13 +21,7 @@
 
 #include <assert.h>
 #include <ldsodefs.h>
-
-#ifdef NDEBUG
-# define CHECK_HASH(var) do {} while (0)
-#else
-# include <dl-hash.h>
-# define CHECK_HASH(var) assert (var.hash == _dl_elf_hash (var.name))
-#endif
+#include <dl-hash.h>
 
 /* Create version number record for lookup.  */
 #define PREPARE_VERSION(var, vname, vhash) \
@@ -35,7 +29,7 @@
   var.name = vname;							      \
   var.hidden = 1;							      \
   var.hash = vhash;							      \
-  CHECK_HASH (var);							      \
+  assert (var.hash == _dl_elf_hash (var.name));				      \
   /* We don't have a specific file where the symbol can be found.  */	      \
   var.filename = NULL
 

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/sysdep.h
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/sysdep.h (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/sysdep.h Wed May 23 00:03:52 2012
@@ -112,9 +112,8 @@
 #  define SYSCALL_ERROR_HANDLER						      \
 0:SETUP_PIC_REG(cx);							      \
   addl $_GLOBAL_OFFSET_TABLE_, %ecx;					      \
-  xorl %edx, %edx;							      \
-  subl %eax, %edx;							      \
-  movl %edx, rtld_errno@GOTOFF(%ecx);					      \
+  negl %eax;								      \
+  movl %eax, rtld_errno@GOTOFF(%ecx);					      \
   orl $-1, %eax;							      \
   jmp L(pseudo_end);
 
@@ -129,9 +128,8 @@
 0:SETUP_PIC_REG (cx);							      \
   addl $_GLOBAL_OFFSET_TABLE_, %ecx;					      \
   movl SYSCALL_ERROR_ERRNO@GOTNTPOFF(%ecx), %ecx;			      \
-  xorl %edx, %edx;							      \
-  subl %eax, %edx;							      \
-  SYSCALL_ERROR_HANDLER_TLS_STORE (%edx, %ecx);				      \
+  negl %eax;								      \
+  SYSCALL_ERROR_HANDLER_TLS_STORE (%eax, %ecx);				      \
   orl $-1, %eax;							      \
   jmp L(pseudo_end);
 #  ifndef NO_TLS_DIRECT_SEG_REFS
@@ -147,10 +145,9 @@
 #  define SYSCALL_ERROR_HANDLER						      \
 0:SETUP_PIC_REG(cx);							      \
   addl $_GLOBAL_OFFSET_TABLE_, %ecx;					      \
-  xorl %edx, %edx;							      \
-  subl %eax, %edx;							      \
+  negl %eax;								      \
   movl errno@GOT(%ecx), %ecx;						      \
-  movl %edx, (%ecx);							      \
+  movl %eax, (%ecx);							      \
   orl $-1, %eax;							      \
   jmp L(pseudo_end);
 # endif	/* _LIBC_REENTRANT */

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/sys/sysctl.h
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/sys/sysctl.h (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/sys/sysctl.h Wed May 23 00:03:52 2012
@@ -60,6 +60,8 @@
 # undef __undef__LINUX_COMPILER_H
 #endif
 
+#include <bits/sysctl.h>
+
 __BEGIN_DECLS
 
 /* Read or write system parameters.  */

Added: fsf/trunk/libc/sysdeps/unix/sysv/linux/sysctl.mk
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/sysctl.mk (added)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/sysctl.mk Wed May 23 00:03:52 2012
@@ -1,0 +1,3 @@
+# sysctl system call has been deprecated.  It is provided for backward
+# compatility.  New target shouldn't add it (see x86_64/x32/sysctl.mk).
+sysdep_routines += sysctl

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/wordsize-64/posix_fallocate.c
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/wordsize-64/posix_fallocate.c (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/wordsize-64/posix_fallocate.c Wed May 23 00:03:52 2012
@@ -38,7 +38,13 @@
 # endif
     {
       INTERNAL_SYSCALL_DECL (err);
+# ifdef INTERNAL_SYSCALL_TYPES
+      int res = INTERNAL_SYSCALL_TYPES (fallocate, err, 4, int, fd,
+					int, 0, off_t, offset,
+					off_t, len);
+# else
       int res = INTERNAL_SYSCALL (fallocate, err, 4, fd, 0, offset, len);
+# endif
 
       if (! INTERNAL_SYSCALL_ERROR_P (res, err))
 	return 0;

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h Wed May 23 00:03:52 2012
@@ -1,6 +1,5 @@
 /* O_*, F_*, FD_* bit values for Linux/x86-64.
-   Copyright (C) 2001,2002,2004,2006,2007,2009,2010,2011
-   Free Software Foundation, Inc.
+   Copyright (C) 2001-2012 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
@@ -22,7 +21,6 @@
 #endif
 
 #include <sys/types.h>
-#include <bits/wordsize.h>
 #ifdef __USE_GNU
 # include <bits/uio.h>
 #endif
@@ -65,7 +63,7 @@
 #endif
 
 #ifdef __USE_LARGEFILE64
-# if __WORDSIZE == 64
+# ifdef __x86_64__
 #  define O_LARGEFILE	0
 # else
 #  define O_LARGEFILE	0100000
@@ -78,7 +76,7 @@
 #define F_SETFD		2	/* Set file descriptor flags.  */
 #define F_GETFL		3	/* Get file status flags.  */
 #define F_SETFL		4	/* Set file status flags.  */
-#if __WORDSIZE == 64
+#ifdef __x86_64__
 # define F_GETLK	5	/* Get record locking info.  */
 # define F_SETLK	6	/* Set record locking info (non-blocking).  */
 # define F_SETLKW	7	/* Set record locking info (blocking).	*/

Added: fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/bits/sysctl.h
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/bits/sysctl.h (added)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/bits/sysctl.h Wed May 23 00:03:52 2012
@@ -1,0 +1,20 @@
+/* Copyright (C) 2012 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
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#if defined __x86_64__ && defined __ILP32__
+# error "sysctl system call is unsupported in x32 kernel"
+#endif

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/sched_getcpu.S
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/sched_getcpu.S (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/sched_getcpu.S Wed May 23 00:03:52 2012
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007, 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2007-2012 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
@@ -59,13 +59,17 @@
 # endif
 #endif
 
+	/* Local variable is result if the call is successful.  */
+	movl	(%rsp), %edx
+	/* Restore stack pointer before we might jump to
+	SYSCALL_ERROR_LABEL which returns to the caller.  */
+	add	$0x8, %rsp
+	cfi_adjust_cfa_offset(-8)
+
 	cmpq	$-4095, %rax
 	jae	SYSCALL_ERROR_LABEL
 
-	movl	(%rsp), %eax
-
+	movl	%edx, %eax
 L(pseudo_end):
-	add	$0x8, %rsp
-	cfi_adjust_cfa_offset(-8)
 	ret
 PSEUDO_END(sched_getcpu)

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/sysdep.h
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/sysdep.h (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/sysdep.h Wed May 23 00:03:52 2012
@@ -115,9 +115,8 @@
 # if defined PIC && defined RTLD_PRIVATE_ERRNO
 #  define SYSCALL_SET_ERRNO			\
   lea rtld_errno(%rip), %RCX_LP;		\
-  xorl %edx, %edx;				\
-  sub %RAX_LP, %RDX_LP;				\
-  movl %edx, (%rcx)
+  neg %eax;					\
+  movl %eax, (%rcx)
 # else
 #  ifndef NOT_IN_libc
 #   define SYSCALL_ERROR_ERRNO __libc_errno
@@ -126,9 +125,8 @@
 #  endif
 #  define SYSCALL_SET_ERRNO			\
   movq SYSCALL_ERROR_ERRNO@GOTTPOFF(%rip), %rcx;\
-  xorl %edx, %edx;				\
-  sub %RAX_LP, %RDX_LP;				\
-  movl %edx, %fs:(%rcx)
+  neg %eax;					\
+  movl %eax, %fs:(%rcx);
 # endif
 
 # ifndef PIC
@@ -198,6 +196,20 @@
 # define INLINE_SYSCALL(name, nr, args...) \
   ({									      \
     unsigned long int resultvar = INTERNAL_SYSCALL (name, , nr, args);	      \
+    if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (resultvar, ), 0))	      \
+      {									      \
+	__set_errno (INTERNAL_SYSCALL_ERRNO (resultvar, ));		      \
+	resultvar = (unsigned long int) -1;				      \
+      }									      \
+    (long int) resultvar; })
+
+/* Define a macro with explicit types for arguments, which expands inline
+   into the wrapper code for a system call.  It should be used when size
+   of any argument > size of long int.  */
+# undef INLINE_SYSCALL_TYPES
+# define INLINE_SYSCALL_TYPES(name, nr, args...) \
+  ({									      \
+    unsigned long int resultvar = INTERNAL_SYSCALL_TYPES (name, , nr, args);  \
     if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (resultvar, ), 0))	      \
       {									      \
 	__set_errno (INTERNAL_SYSCALL_ERRNO (resultvar, ));		      \
@@ -221,6 +233,20 @@
 # undef INTERNAL_SYSCALL
 # define INTERNAL_SYSCALL(name, err, nr, args...) \
   INTERNAL_SYSCALL_NCS (__NR_##name, err, nr, ##args)
+
+# define INTERNAL_SYSCALL_NCS_TYPES(name, err, nr, args...) \
+  ({									      \
+    unsigned long int resultvar;					      \
+    LOAD_ARGS_TYPES_##nr (args)						      \
+    LOAD_REGS_TYPES_##nr (args)						      \
+    asm volatile (							      \
+    "syscall\n\t"							      \
+    : "=a" (resultvar)							      \
+    : "0" (name) ASM_ARGS_##nr : "memory", "cc", "r11", "cx");		      \
+    (long int) resultvar; })
+# undef INTERNAL_SYSCALL_TYPES
+# define INTERNAL_SYSCALL_TYPES(name, err, nr, args...) \
+  INTERNAL_SYSCALL_NCS_TYPES (__NR_##name, err, nr, ##args)
 
 # undef INTERNAL_SYSCALL_ERROR_P
 # define INTERNAL_SYSCALL_ERROR_P(val, err) \
@@ -288,53 +314,83 @@
 # define LOAD_REGS_0
 # define ASM_ARGS_0
 
-# define LOAD_ARGS_1(a1)				\
-  long int __arg1 = (long int) (a1);			\
+# define LOAD_ARGS_TYPES_1(t1, a1)					   \
+  t1 __arg1 = (t1) (a1);						   \
   LOAD_ARGS_0 ()
-# define LOAD_REGS_1					\
-  register long int _a1 asm ("rdi") = __arg1;		\
+# define LOAD_REGS_TYPES_1(t1, a1)					   \
+  register t1 _a1 asm ("rdi") = __arg1;					   \
   LOAD_REGS_0
 # define ASM_ARGS_1	ASM_ARGS_0, "r" (_a1)
-
-# define LOAD_ARGS_2(a1, a2)				\
-  long int __arg2 = (long int) (a2);			\
-  LOAD_ARGS_1 (a1)
-# define LOAD_REGS_2					\
-  register long int _a2 asm ("rsi") = __arg2;		\
-  LOAD_REGS_1
+# define LOAD_ARGS_1(a1)						   \
+  LOAD_ARGS_TYPES_1 (long int, a1)
+# define LOAD_REGS_1							   \
+  LOAD_REGS_TYPES_1 (long int, a1)
+
+# define LOAD_ARGS_TYPES_2(t1, a1, t2, a2)				   \
+  t2 __arg2 = (t2) (a2);						   \
+  LOAD_ARGS_TYPES_1 (t1, a1)
+# define LOAD_REGS_TYPES_2(t1, a1, t2, a2)				   \
+  register t2 _a2 asm ("rsi") = __arg2;					   \
+  LOAD_REGS_TYPES_1(t1, a1)
 # define ASM_ARGS_2	ASM_ARGS_1, "r" (_a2)
-
-# define LOAD_ARGS_3(a1, a2, a3)			\
-  long int __arg3 = (long int) (a3);			\
-  LOAD_ARGS_2 (a1, a2)
-# define LOAD_REGS_3					\
-  register long int _a3 asm ("rdx") = __arg3;		\
-  LOAD_REGS_2
+# define LOAD_ARGS_2(a1, a2)						   \
+  LOAD_ARGS_TYPES_2 (long int, a1, long int, a2)
+# define LOAD_REGS_2							   \
+  LOAD_REGS_TYPES_2 (long int, a1, long int, a2)
+
+# define LOAD_ARGS_TYPES_3(t1, a1, t2, a2, t3, a3)			   \
+  t3 __arg3 = (t3) (a3);						   \
+  LOAD_ARGS_TYPES_2 (t1, a1, t2, a2)
+# define LOAD_REGS_TYPES_3(t1, a1, t2, a2, t3, a3)			   \
+  register t3 _a3 asm ("rdx") = __arg3;					   \
+  LOAD_REGS_TYPES_2(t1, a1, t2, a2)
 # define ASM_ARGS_3	ASM_ARGS_2, "r" (_a3)
-
-# define LOAD_ARGS_4(a1, a2, a3, a4)			\
-  long int __arg4 = (long int) (a4);			\
-  LOAD_ARGS_3 (a1, a2, a3)
-# define LOAD_REGS_4					\
-  register long int _a4 asm ("r10") = __arg4;		\
-  LOAD_REGS_3
+# define LOAD_ARGS_3(a1, a2, a3)					   \
+  LOAD_ARGS_TYPES_3 (long int, a1, long int, a2, long int, a3)
+# define LOAD_REGS_3							   \
+  LOAD_REGS_TYPES_3 (long int, a1, long int, a2, long int, a3)
+
+# define LOAD_ARGS_TYPES_4(t1, a1, t2, a2, t3, a3, t4, a4)		   \
+  t4 __arg4 = (t4) (a4);						   \
+  LOAD_ARGS_TYPES_3 (t1, a1, t2, a2, t3, a3)
+# define LOAD_REGS_TYPES_4(t1, a1, t2, a2, t3, a3, t4, a4)		   \
+  register t4 _a4 asm ("r10") = __arg4;					   \
+  LOAD_REGS_TYPES_3(t1, a2, t2, a2, t3, a3)
 # define ASM_ARGS_4	ASM_ARGS_3, "r" (_a4)
-
-# define LOAD_ARGS_5(a1, a2, a3, a4, a5)		\
-  long int __arg5 = (long int) (a5);			\
-  LOAD_ARGS_4 (a1, a2, a3, a4)
-# define LOAD_REGS_5					\
-  register long int _a5 asm ("r8") = __arg5;		\
-  LOAD_REGS_4
+# define LOAD_ARGS_4(a1, a2, a3, a4)					   \
+  LOAD_ARGS_TYPES_4 (long int, a1, long int, a2, long int, a3,		   \
+		     long int, a4)
+# define LOAD_REGS_4							   \
+  LOAD_REGS_TYPES_4 (long int, a1, long int, a2, long int, a3,		   \
+		     long int, a4)
+
+# define LOAD_ARGS_TYPES_5(t1, a1, t2, a2, t3, a3, t4, a4, t5, a5)	   \
+  t5 __arg5 = (t5) (a5);						   \
+  LOAD_ARGS_TYPES_4 (t1, a1, t2, a2, t3, a3, t4, a4)
+# define LOAD_REGS_TYPES_5(t1, a1, t2, a2, t3, a3, t4, a4, t5, a5)	   \
+  register t5 _a5 asm ("r8") = __arg5;					   \
+  LOAD_REGS_TYPES_4 (t1, a1, t2, a2, t3, a3, t4, a4)
 # define ASM_ARGS_5	ASM_ARGS_4, "r" (_a5)
-
-# define LOAD_ARGS_6(a1, a2, a3, a4, a5, a6)		\
-  long int __arg6 = (long int) (a6);			\
-  LOAD_ARGS_5 (a1, a2, a3, a4, a5)
-# define LOAD_REGS_6					\
-  register long int _a6 asm ("r9") = __arg6;		\
-  LOAD_REGS_5
+# define LOAD_ARGS_5(a1, a2, a3, a4, a5)				   \
+  LOAD_ARGS_TYPES_5 (long int, a1, long int, a2, long int, a3,		   \
+		     long int, a4, long int, a5)
+# define LOAD_REGS_5							   \
+  LOAD_REGS_TYPES_5 (long int, a1, long int, a2, long int, a3,		   \
+		     long int, a4, long int, a5)
+
+# define LOAD_ARGS_TYPES_6(t1, a1, t2, a2, t3, a3, t4, a4, t5, a5, t6, a6) \
+  t6 __arg6 = (t6) (a6);						   \
+  LOAD_ARGS_TYPES_5 (t1, a1, t2, a2, t3, a3, t4, a4, t5, a5)
+# define LOAD_REGS_TYPES_6(t1, a1, t2, a2, t3, a3, t4, a4, t5, a5, t6, a6) \
+  register t6 _a6 asm ("r9") = __arg6;					   \
+  LOAD_REGS_TYPES_5 (t1, a1, t2, a2, t3, a3, t4, a4, t5, a5)
 # define ASM_ARGS_6	ASM_ARGS_5, "r" (_a6)
+# define LOAD_ARGS_6(a1, a2, a3, a4, a5, a6)				   \
+  LOAD_ARGS_TYPES_6 (long int, a1, long int, a2, long int, a3,		   \
+		     long int, a4, long int, a5, long int, a6)
+# define LOAD_REGS_6							   \
+  LOAD_REGS_TYPES_6 (long int, a1, long int, a2, long int, a3,		   \
+		     long int, a4, long int, a5, long int, a6)
 
 #endif	/* __ASSEMBLER__ */
 

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/x32/Makefile
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/x32/Makefile (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/x32/Makefile Wed May 23 00:03:52 2012
@@ -1,3 +1,7 @@
+ifeq ($(subdir),misc)
+sysdep_routines += arch_prctl
+endif
+
 ifeq ($(subdir),posix)
 sysdep_routines += getcpu sched_getcpu-static
 endif

Added: fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/x32/arch_prctl.c
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/x32/arch_prctl.c (added)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/x32/arch_prctl.c Wed May 23 00:03:52 2012
@@ -1,0 +1,62 @@
+/* arch_prctl call for Linux/x32.
+   Copyright (C) 2012 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
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <errno.h>
+#include <sys/prctl.h>
+#include <sys/syscall.h>
+#include <sysdep.h>
+
+/* Since x32 arch_prctl stores 32-bit base address of segment registers
+   %fs and %gs as unsigned 64-bit value via ARCH_GET_FS and ARCH_GET_GS,
+   we use an unsigned 64-bit variable to hold the base address and copy
+   it to ADDR after the system call returns.  */
+
+int
+__arch_prctl (int code, uintptr_t *addr)
+{
+  int res;
+  uint64_t addr64;
+  void *prctl_arg = addr;
+
+  switch (code)
+    {
+    case ARCH_GET_FS:
+    case ARCH_GET_GS:
+      prctl_arg = &addr64;
+      break;
+    }
+
+  res = INLINE_SYSCALL (arch_prctl, 2, code, prctl_arg);
+  if (res == 0)
+    switch (code)
+      {
+      case ARCH_GET_FS:
+      case ARCH_GET_GS:
+	 /* Check for a large value that overflows.  */
+	if ((uintptr_t) addr64 != addr64)
+	  {
+	    __set_errno (EOVERFLOW);
+	    return -1;
+	  }
+	*addr = (uintptr_t) addr64;
+	break;
+      }
+
+  return res;
+}
+weak_alias (__arch_prctl, arch_prctl)

Added: fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/x32/sysctl.mk
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/x32/sysctl.mk (added)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/x32/sysctl.mk Wed May 23 00:03:52 2012
@@ -1,0 +1,1 @@
+# X32 doesn't support sysctl.

Modified: fsf/trunk/libc/time/mktime.c
==============================================================================
--- fsf/trunk/libc/time/mktime.c (original)
+++ fsf/trunk/libc/time/mktime.c Wed May 23 00:03:52 2012
@@ -1,5 +1,5 @@
-/* Convert a `struct tm' to a time_t value.
-   Copyright (C) 1993-1999, 2002-2007, 2008 Free Software Foundation, Inc.
+/* Convert a 'struct tm' to a time_t value.
+   Copyright (C) 1993-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Paul Eggert <eggert@xxxxxxxxxxx>.
 
@@ -21,18 +21,17 @@
    mktime.  */
 /* #define DEBUG 1 */
 
-#ifdef HAVE_CONFIG_H
+#ifndef _LIBC
 # include <config.h>
 #endif
 
 /* Assume that leap seconds are possible, unless told otherwise.
-   If the host has a `zic' command with a `-L leapsecondfilename' option,
+   If the host has a 'zic' command with a '-L leapsecondfilename' option,
    then it supports leap seconds; otherwise it probably doesn't.  */
 #ifndef LEAP_SECONDS_POSSIBLE
 # define LEAP_SECONDS_POSSIBLE 1
 #endif
 
-#include <sys/types.h>		/* Some systems define `time_t' here.  */
 #include <time.h>
 
 #include <limits.h>
@@ -43,6 +42,7 @@
 # include <stdio.h>
 # include <stdlib.h>
 /* Make it work even if the system's libc has its own mktime routine.  */
+# undef mktime
 # define mktime my_mktime
 #endif /* DEBUG */
 
@@ -141,14 +141,14 @@
 
 
 #ifndef _LIBC
-/* Portable standalone applications should supply a "time_r.h" that
+/* Portable standalone applications should supply a <time.h> that
    declares a POSIX-compliant localtime_r, for the benefit of older
    implementations that lack localtime_r or have a nonstandard one.
    See the gnulib time_r module for one way to implement this.  */
-# include "time_r.h"
 # undef __localtime_r
 # define __localtime_r localtime_r
 # define __mktime_internal mktime_internal
+# include "mktime-internal.h"
 #endif
 
 /* Return an integer value measuring (YEAR1-YDAY1 HOUR1:MIN1:SEC1) -
@@ -509,7 +509,7 @@
 {
 #ifdef _LIBC
   /* POSIX.1 8.1.1 requires that whenever mktime() is called, the
-     time zone names contained in the external variable `tzname' shall
+     time zone names contained in the external variable 'tzname' shall
      be set as if the tzset() function had been called.  */
   __tzset ();
 #endif
@@ -662,6 +662,6 @@
 
 /*
 Local Variables:
-compile-command: "gcc -DDEBUG -Wall -W -O -g mktime.c -o mktime"
+compile-command: "gcc -DDEBUG -I. -Wall -W -O2 -g mktime.c -o mktime"
 End:
 */

_______________________________________________
Commits mailing list
Commits@xxxxxxxxxx
http://eglibc.org/cgi-bin/mailman/listinfo/commits