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

[commits] r1148 - in /trunk: libc/ libc/catgets/ libc/csu/ libc/debug/ libc/elf/ libc/iconv/ libc/include/ libc/io/ libc/libio/ libc/l...



Author: joseph
Date: Tue Jan  9 05:36:33 2007
New Revision: 1148

Log:
Merge changes between r858 and r1147 /fsf/trunk.

Added:
    trunk/libc/io/tst-ttyname_r.c
      - copied unchanged from r1147, fsf/trunk/libc/io/tst-ttyname_r.c
    trunk/libc/libio/tst-setvbuf1.c
      - copied unchanged from r1147, fsf/trunk/libc/libio/tst-setvbuf1.c
    trunk/libc/misc/tst-mntent2.c
      - copied unchanged from r1147, fsf/trunk/libc/misc/tst-mntent2.c
    trunk/libc/posix/tst-vfork3.c
      - copied unchanged from r1147, fsf/trunk/libc/posix/tst-vfork3.c
    trunk/libc/stdlib/tst-atof1.c
      - copied unchanged from r1147, fsf/trunk/libc/stdlib/tst-atof1.c
    trunk/libc/stdlib/tst-atof2.c
      - copied unchanged from r1147, fsf/trunk/libc/stdlib/tst-atof2.c
    trunk/libc/stdlib/tst-makecontext.c
      - copied unchanged from r1147, fsf/trunk/libc/stdlib/tst-makecontext.c
    trunk/libc/stdlib/tst-rand48-2.c
      - copied unchanged from r1147, fsf/trunk/libc/stdlib/tst-rand48-2.c
    trunk/libc/stdlib/tst-strtod2.c
      - copied unchanged from r1147, fsf/trunk/libc/stdlib/tst-strtod2.c
    trunk/libc/stdlib/tst-strtod3.c
      - copied unchanged from r1147, fsf/trunk/libc/stdlib/tst-strtod3.c
    trunk/libc/sysdeps/unix/sysv/linux/sh/bits/shm.h
      - copied unchanged from r1147, fsf/trunk/libc/sysdeps/unix/sysv/linux/sh/bits/shm.h
    trunk/ports/sysdeps/unix/sysv/linux/arm/check_pf.c
      - copied unchanged from r1147, fsf/trunk/ports/sysdeps/unix/sysv/linux/arm/check_pf.c
    trunk/ports/sysdeps/unix/sysv/linux/arm/eabi/check_pf.c
      - copied unchanged from r1147, fsf/trunk/ports/sysdeps/unix/sysv/linux/arm/eabi/check_pf.c
Removed:
    trunk/ports/sysdeps/mips/elf/ldsodefs.h
Modified:
    trunk/libc/ChangeLog
    trunk/libc/catgets/gencat.c
    trunk/libc/csu/version.c
    trunk/libc/debug/catchsegv.sh
    trunk/libc/debug/xtrace.sh
    trunk/libc/elf/dl-support.c
    trunk/libc/elf/elf.h
    trunk/libc/elf/ldconfig.c
    trunk/libc/elf/ldd.bash.in
    trunk/libc/elf/sprof.c
    trunk/libc/iconv/iconv_prog.c
    trunk/libc/iconv/iconvconfig.c
    trunk/libc/include/atomic.h
    trunk/libc/include/features.h
    trunk/libc/io/Makefile
    trunk/libc/libio/Makefile
    trunk/libc/libio/fileops.c
    trunk/libc/libio/genops.c
    trunk/libc/libio/libio.h
    trunk/libc/libio/wfiledoalloc.c
    trunk/libc/libio/wgenops.c
    trunk/libc/libio/wmemstream.c
    trunk/libc/libio/wstrops.c
    trunk/libc/locale/programs/locale.c
    trunk/libc/locale/programs/localedef.c
    trunk/libc/localedata/ChangeLog
    trunk/libc/localedata/locales/cs_CZ
    trunk/libc/malloc/malloc.c
    trunk/libc/malloc/memusage.c
    trunk/libc/malloc/memusage.sh
    trunk/libc/malloc/memusagestat.c
    trunk/libc/malloc/mtrace.pl
    trunk/libc/misc/Makefile
    trunk/libc/misc/getusershell.c
    trunk/libc/misc/mntent_r.c
    trunk/libc/misc/tst-pselect.c
    trunk/libc/nis/nis_subr.c
    trunk/libc/nis/nss_compat/compat-grp.c
    trunk/libc/nptl/ChangeLog
    trunk/libc/nptl/sysdeps/unix/sysv/linux/pthread_kill.c
    trunk/libc/nptl/sysdeps/unix/sysv/linux/rtld-lowlevel.h
    trunk/libc/nptl/sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
    trunk/libc/nptl/sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
    trunk/libc/nscd/nscd.c
    trunk/libc/nss/getXXbyYY_r.c
    trunk/libc/nss/getent.c
    trunk/libc/posix/Makefile
    trunk/libc/posix/execvp.c
    trunk/libc/posix/getconf.c
    trunk/libc/posix/wordexp.c
    trunk/libc/stdlib/Makefile
    trunk/libc/stdlib/jrand48_r.c
    trunk/libc/stdlib/strtod_l.c
    trunk/libc/stdlib/tst-rand48.c
    trunk/libc/string/Makefile
    trunk/libc/sysdeps/powerpc/dl-procinfo.c
    trunk/libc/sysdeps/powerpc/dl-procinfo.h
    trunk/libc/sysdeps/powerpc/sysdep.h
    trunk/libc/sysdeps/unix/sysv/linux/bits/statvfs.h
    trunk/libc/sysdeps/unix/sysv/linux/internal_statvfs.c
    trunk/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/makecontext.S
    trunk/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext.S
    trunk/libc/sysdeps/unix/sysv/linux/ttyname.c
    trunk/libc/sysdeps/unix/sysv/linux/ttyname_r.c
    trunk/ports/ChangeLog.arm
    trunk/ports/ChangeLog.mips
    trunk/ports/ChangeLog.powerpc
    trunk/ports/sysdeps/arm/bits/mathdef.h
    trunk/ports/sysdeps/arm/eabi/jmpbuf-offsets.h
    trunk/ports/sysdeps/mips/dl-machine.h
    trunk/ports/sysdeps/mips/ldsodefs.h
    trunk/ports/sysdeps/unix/sysv/linux/mips/bits/msq.h

Modified: trunk/libc/ChangeLog
==============================================================================
--- trunk/libc/ChangeLog (original)
+++ trunk/libc/ChangeLog Tue Jan  9 05:36:33 2007
@@ -1,3 +1,221 @@
+2006-10-27  Richard Sandiford  <richard@xxxxxxxxxxxxxxxx>
+
+	* elf/elf.h (R_MIPS_GLOB_DAT): Define.
+	(R_MIPS_NUM): Bump by 1.
+
+2007-01-03  Jakub Jelinek  <jakub@xxxxxxxxxx>
+
+	* posix/execvp.c: Include alloca.h.
+	(allocate_scripts_argv): Renamed to...
+	(scripts_argv): ... this.  Don't allocate buffer here nor count
+	arguments.
+	(execvp): Use alloca if possible.
+	* posix/Makefile: Add rules to build and run tst-vfork3 test.
+	* posix/tst-vfork3.c: New test.
+
+2007-01-03  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* string/Makefile (tst-strxfrm2-ENV): Define.
+	* stdlib/Makefile (tst-strtod3-ENV): Define.
+
+2007-01-02  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* posix/getconf.c: Update copyright year.
+	* nss/getent.c: Likewise.
+	* iconv/iconvconfig.c: Likewise.
+	* iconv/iconv_prog.c: Likewise.
+	* elf/ldconfig.c: Likewise.
+	* catgets/gencat.c: Likewise.
+	* csu/version.c: Likewise.
+	* elf/ldd.bash.in: Likewise.
+	* elf/sprof.c (print_version): Likewise.
+	* locale/programs/locale.c: Likewise.
+	* locale/programs/localedef.c: Likewise.
+	* nscd/nscd.c (print_version): Likewise.
+	* debug/xtrace.sh: Likewise.
+	* malloc/memusage.sh: Likewise.
+	* malloc/mtrace.pl: Likewise.
+	* debug/catchsegv.sh: Likewise.
+
+2006-12-24  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* malloc/malloc.c (sYSMALLOc): Remove some unnecessary alignment
+	attempts.
+
+2006-12-23  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* posix/wordexp.c: Remove some unnecessary tests.
+
+2006-12-22  Gavin Romig-Koch  <gavin@xxxxxxxxxx>
+
+	* nis/nss_compat/compat-grp.c (internal_getgrgid_r): Don't
+	blacklist the group till after we look it up.
+
+2006-12-21  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* include/atomic.h (atomic_forced_read): New macro.
+
+2006-12-20  SUGIOKA Toshinobu  <sugioka@xxxxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/sh/bits/shm.h: New file.
+
+2006-12-19  Jakub Jelinek  <jakub@xxxxxxxxxx>
+
+	* nss/getXXbyYY_r.c: Include atomic.h.
+	(INTERNAL (REENTRANT_NAME)): Write startp after start_fct,
+	add atomic_write_barrier () in between.
+
+	* stdlib/Makefile (tests): Add tst-makecontext.
+	* stdlib/tst-makecontext.c: New test.
+
+	* sysdeps/unix/sysv/linux/powerpc/powerpc32/makecontext.S
+	(__makecontext): Don't realign uc_mcontext.uc_regs.
+
+2006-11-28  Jakub Jelinek  <jakub@xxxxxxxxxx>
+
+	* elf/dl-support.c: Include dl-procinfo.h.
+	* sysdeps/powerpc/dl-procinfo.h (PPC_PLATFORM_POWER4,
+	PPC_PLATFORM_PPC970, PPC_PLATFORM_POWER5, PPC_PLATFORM_POWER5_PLUS,
+	PPC_PLATFORM_POWER6, PPC_PLATFORM_CELL_BE, PPC_PLATFORM_POWER6X):
+	Define.
+	(_dl_string_platform): Use PPC_PLATFORM_* macros instead of
+	hardcoded constants.
+	* sysdeps/powerpc/dl-procinfo.c (_dl_powerpc_platform): Use
+	PPC_PLATFORM_* macros for array designators.
+
+2006-11-11  Steven Munroe  <sjmunroe@xxxxxxxxxx>
+
+	* sysdeps/powerpc/dl-procinfo.c (_dl_powerpc_cap_flags): Add 3 new cap
+	names to the beginning.
+	(_dl_powerpc_platforms): Add "power6x".
+	* sysdeps/powerpc/dl-procinfo.h (_DL_HWCAP_FIRST): Decrease.
+	(HWCAP_IMPORTANT): Add PPC_FEATURE_HAS_DFP.
+	(_DL_PLATFORMS_COUNT): Increase.
+	(_dl_string_platform): Handle power6x case.
+	* sysdeps/powerpc/sysdep.h (PPC_FEATURE_PA6T, PPC_FEATURE_HAS_DFP,
+	PPC_FEATURE_POWER6_EXT): Define.
+	(PPC_FEATURE_POWER5, PPC_FEATURE_POWER5_PLUS): Correct Comment.
+
+2006-12-18  Jakub Jelinek  <jakub@xxxxxxxxxx>
+
+	[BZ #3747]
+	* stdlib/jrand48_r.c (__jrand48_r): Make sure result is in the
+	[-2^31 .. 2^31) range.
+	* stdlib/tst-rand48.c (main): Fix expected values for 64-bit
+	targets.
+	* stdlib/tst-rand48-2.c: New test.
+	* stdlib/Makefile (tests): Add tst-rand48-2.
+
+2006-12-14  Jakub Jelinek  <jakub@xxxxxxxxxx>
+
+	* misc/tst-pselect.c (do_test): Fix sigblock argument.
+
+2006-12-14  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* misc/tst-pselect.c (do_test): Make sure the helper process is
+	terminating when the test is aborted.
+
+2006-12-13  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/bits/statvfs.h: Define ST_RELATIME.
+	* sysdeps/unix/sysv/linux/internal_statvfs.c (__statvfs_getflags):
+	Handle relatime mount option.
+
+	[BZ #2337]
+	* libio/Makefile (tests): Add tst-setvbuf1.
+	* libio/tst-setvbuf1.c: New file.
+
+2006-12-08  Jakub Jelinek  <jakub@xxxxxxxxxx>
+
+	[BZ #2337]
+	* libio/genops.c (__uflow): Fix a typo.
+	* libio/wfiledoalloc.c (_IO_wfile_doallocate): Don't stat
+	nor set _IO_LINE_BUF bit here.  Size the wide buffer based on
+	the narrow buffer size.
+
+2006-11-24  Jakub Jelinek  <jakub@xxxxxxxxxx>
+
+	[BZ #2337]
+	* libio/libio.h (_IO_FLAGS2_USER_WBUF): Define.
+	* libio/wgenops.c (_IO_wsetb, _IO_wdefault_finish): Test and set
+	_IO_FLAGS2_USER_WBUF bit in _flags2 instead of _IO_USER_BUF bit
+	in _flags.
+	* libio/wstrops.c (_IO_wstr_overflow, enlarge_userbuf,
+	_IO_wstr_finish): Likewise.
+	* libio/wmemstream.c (open_wmemstream): Likewise.
+	* libio/fileops.c (_IO_new_file_close_it): Call _IO_set[bgp]
+	even for wide streams.
+
+2006-12-13  Jakub Jelinek  <jakub@xxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext.S: Include
+	kernel-features.h.
+
+2006-12-11  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* stdlib/strtod_l.c (____STRTOF_INTERNAL): Parse thousand
+	separators also if no non-zero digits found.
+	* stdlib/Makefile (tests): Add tst-strtod3.
+
+2006-12-09  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	[BZ #3632]
+	* include/features.h: Fix comment about default value for
+	_POSIX_C_SOURCE.
+
+	[BZ #3664]
+	* stdlib/strtod_l.c (____STRTOF_INTERNAL): Fix test to recognize
+	empty parsed strings.
+	* stdlib/Makefile (tests): Add tst-strtod2.
+	* stdlib/tst-strtod2.c: New file.
+
+	[BZ #3673]
+	* stdlib/strtod_l.c (____STRTOF_INTERNAL): Fix exp_limit
+	computation.
+	* stdlib/Makefile (tests): Add tst-atof2.
+	* stdlib/tst-atof2.c: New file.
+
+	[BZ #3674]
+	* stdlib/strtod_l.c (____STRTOF_INTERNAL): Adjust exponent value
+	correctly if removing trailing zero of hex-float.
+	* stdlib/Makefile (tests): Add tst-atof1.
+	* stdlib/tst-atof1.c: New file.
+
+2006-12-09  Jakub Jelinek  <jakub@xxxxxxxxxx>
+
+	* misc/mntent_r.c (__hasmntopt): Check p[optlen] even when p == rest.
+	Start searching for next comma at p rather than rest.
+	* misc/Makefile (tests): Add tst-mntent2.
+	* misc/tst-mntent2.c: New test.
+
+	* misc/getusershell.c (initshells): Check for integer overflows.
+	Make strings buffer one bigger as fgets always succeeds when second
+	argument is 1.  Don't use calloc for shells array.  Disallow
+	/ as shell.
+
+2006-12-08  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* malloc/memusage.c: Handle realloc with new size of zero and
+	non-NULL pointer correctly.
+	(me): Really write first record twice.
+	(struct entry): Make format bi-arch safe.
+	(dest): Write out more realloc statistics.
+	* malloc/memusagestat.c (struct entry): Make format bi-arch safe.
+
+2006-12-05  Jakub Jelinek  <jakub@xxxxxxxxxx>
+
+	* nis/nis_subr.c (nis_getnames): Revert last change.
+
+2006-12-04  Jakub Jelinek  <jakub@xxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/ttyname.c: Include termios.h.
+	(ttyname): Use tcgetattr instead of isatty, don't set errno to ENOTTY.
+	* sysdeps/unix/sysv/linux/ttyname_r.c: Include termios.h.
+	(__ttyname_r): Use tcgetattr instead of isatty, don't set errno to
+	ENOTTY.
+	* io/Makefile: Add rules to build and run tst-ttyname_r test.
+	* io/tst-ttyname_r.c: New test.
+
 2006-12-03  Kaz Kojima  <kkojima@xxxxxxxxxxxxxx>
 
 	* sysdeps/unix/sysv/linux/sh/sys/io.h: Removed.

Modified: trunk/libc/catgets/gencat.c
==============================================================================
--- trunk/libc/catgets/gencat.c (original)
+++ trunk/libc/catgets/gencat.c Tue Jan  9 05:36:33 2007
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2005, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2005, 2006, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1996.
 
@@ -246,7 +246,7 @@
 Copyright (C) %s Free Software Foundation, Inc.\n\
 This is free software; see the source for copying conditions.  There is NO\n\
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
-"), "2006");
+"), "2007");
   fprintf (stream, gettext ("Written by %s.\n"), "Ulrich Drepper");
 }
 

Modified: trunk/libc/csu/version.c
==============================================================================
--- trunk/libc/csu/version.c (original)
+++ trunk/libc/csu/version.c Tue Jan  9 05:36:33 2007
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2002, 2003, 2004, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2006, 2007 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
@@ -25,7 +25,7 @@
 
 static const char banner[] =
 "GNU C Library "RELEASE" release version "VERSION", by Roland McGrath et al.\n\
-Copyright (C) 2006 Free Software Foundation, Inc.\n\
+Copyright (C) 2007 Free Software Foundation, Inc.\n\
 This is free software; see the source for copying conditions.\n\
 There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A\n\
 PARTICULAR PURPOSE.\n\

Modified: trunk/libc/debug/catchsegv.sh
==============================================================================
--- trunk/libc/debug/catchsegv.sh (original)
+++ trunk/libc/debug/catchsegv.sh Tue Jan  9 05:36:33 2007
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1998,1999,2001,2003,2004,2006 Free Software Foundation, Inc.
+# Copyright (C) 1998,1999,2001,2003,2004,2006,2007
+# Free Software Foundation, Inc.
 # This file is part of the GNU C Library.
 # Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1998.
 
@@ -39,7 +40,7 @@
       ;;
     --v | --ve | --ver | --vers | --versi | --versio | --version)
       echo 'catchsegv (GNU libc) @VERSION@'
-      echo 'Copyright (C) 2006 Free Software Foundation, Inc.
+      echo 'Copyright (C) 2007 Free Software Foundation, Inc.
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 Written by Ulrich Drepper.'

Modified: trunk/libc/debug/xtrace.sh
==============================================================================
--- trunk/libc/debug/xtrace.sh (original)
+++ trunk/libc/debug/xtrace.sh Tue Jan  9 05:36:33 2007
@@ -1,5 +1,5 @@
 #! @BASH@
-# Copyright (C) 1999, 2001-2004, 2005, 2006 Free Software Foundation, Inc.
+# Copyright (C) 1999, 2001-2006, 2007 Free Software Foundation, Inc.
 # This file is part of the GNU C Library.
 # Contributed by Ulrich Drepper <drepper@xxxxxxx>, 1999.
 
@@ -64,7 +64,7 @@
   printf $"Copyright (C) %s Free Software Foundation, Inc.
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-" "2006"
+" "2007"
   printf $"Written by %s.
 " "Ulrich Drepper"
   exit 0

Modified: trunk/libc/elf/dl-support.c
==============================================================================
--- trunk/libc/elf/dl-support.c (original)
+++ trunk/libc/elf/dl-support.c Tue Jan  9 05:36:33 2007
@@ -29,6 +29,7 @@
 #include <bits/libc-lock.h>
 #include <dl-cache.h>
 #include <dl-librecon.h>
+#include <dl-procinfo.h>
 #include <unsecvars.h>
 #include <hp-timing.h>
 

Modified: trunk/libc/elf/elf.h
==============================================================================
--- trunk/libc/elf/elf.h (original)
+++ trunk/libc/elf/elf.h Tue Jan  9 05:36:33 2007
@@ -1,5 +1,5 @@
 /* This file defines standard ELF types, structures, and macros.
-   Copyright (C) 1995-2003,2004,2005,2006 Free Software Foundation, Inc.
+   Copyright (C) 1995-2003,2004,2005,2006,2007 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
@@ -1511,8 +1511,9 @@
 #define R_MIPS_TLS_TPREL64	48	/* TP-relative offset, 64 bit */
 #define R_MIPS_TLS_TPREL_HI16	49	/* TP-relative offset, high 16 bits */
 #define R_MIPS_TLS_TPREL_LO16	50	/* TP-relative offset, low 16 bits */
+#define R_MIPS_GLOB_DAT		51
 /* Keep this the last entry.  */
-#define R_MIPS_NUM		51
+#define R_MIPS_NUM		52
 
 /* Legal values for p_type field of Elf32_Phdr.  */
 

Modified: trunk/libc/elf/ldconfig.c
==============================================================================
--- trunk/libc/elf/ldconfig.c (original)
+++ trunk/libc/elf/ldconfig.c Tue Jan  9 05:36:33 2007
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2004, 2005, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2004, 2005, 2006, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Andreas Jaeger <aj@xxxxxxx>, 1999.
 
@@ -287,7 +287,7 @@
 Copyright (C) %s Free Software Foundation, Inc.\n\
 This is free software; see the source for copying conditions.  There is NO\n\
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
-"), "2006");
+"), "2007");
   fprintf (stream, gettext ("Written by %s.\n"),
 	   "Andreas Jaeger");
 }

Modified: trunk/libc/elf/ldd.bash.in
==============================================================================
--- trunk/libc/elf/ldd.bash.in (original)
+++ trunk/libc/elf/ldd.bash.in Tue Jan  9 05:36:33 2007
@@ -1,5 +1,5 @@
 #! @BASH@
-# Copyright (C) 1996-2004, 2005, 2006 Free Software Foundation, Inc.
+# Copyright (C) 1996-2004, 2005, 2006, 2007 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
@@ -39,7 +39,7 @@
     printf $"Copyright (C) %s Free Software Foundation, Inc.
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-" "2006"
+" "2007"
     printf $"Written by %s and %s.
 " "Roland McGrath" "Ulrich Drepper"
     exit 0

Modified: trunk/libc/elf/sprof.c
==============================================================================
--- trunk/libc/elf/sprof.c (original)
+++ trunk/libc/elf/sprof.c Tue Jan  9 05:36:33 2007
@@ -1,5 +1,5 @@
 /* Read and display shared object profiling data.
-   Copyright (C) 1997-2004, 2005, 2006 Free Software Foundation, Inc.
+   Copyright (C) 1997-2004, 2005, 2006, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1997.
 
@@ -357,7 +357,7 @@
 This is free software; see the source for copying conditions.  There is NO\n\
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
 "),
-	   "2006");
+	   "2007");
   fprintf (stream, gettext ("Written by %s.\n"), "Ulrich Drepper");
 }
 

Modified: trunk/libc/iconv/iconv_prog.c
==============================================================================
--- trunk/libc/iconv/iconv_prog.c (original)
+++ trunk/libc/iconv/iconv_prog.c Tue Jan  9 05:36:33 2007
@@ -1,5 +1,5 @@
 /* Convert text in given files from the specified from-set to the to-set.
-   Copyright (C) 1998-2004, 2005, 2006 Free Software Foundation, Inc.
+   Copyright (C) 1998-2004, 2005, 2006, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1998.
 
@@ -426,7 +426,7 @@
 Copyright (C) %s Free Software Foundation, Inc.\n\
 This is free software; see the source for copying conditions.  There is NO\n\
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
-"), "2006");
+"), "2007");
   fprintf (stream, gettext ("Written by %s.\n"), "Ulrich Drepper");
 }
 

Modified: trunk/libc/iconv/iconvconfig.c
==============================================================================
--- trunk/libc/iconv/iconvconfig.c (original)
+++ trunk/libc/iconv/iconvconfig.c Tue Jan  9 05:36:33 2007
@@ -1,5 +1,5 @@
 /* Generate fastloading iconv module configuration files.
-   Copyright (C) 2000-2004, 2005, 2006 Free Software Foundation, Inc.
+   Copyright (C) 2000-2004, 2005, 2006, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 2000.
 
@@ -395,7 +395,7 @@
 Copyright (C) %s Free Software Foundation, Inc.\n\
 This is free software; see the source for copying conditions.  There is NO\n\
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
-"), "2006");
+"), "2007");
   fprintf (stream, gettext ("Written by %s.\n"), "Ulrich Drepper");
 }
 

Modified: trunk/libc/include/atomic.h
==============================================================================
--- trunk/libc/include/atomic.h (original)
+++ trunk/libc/include/atomic.h Tue Jan  9 05:36:33 2007
@@ -497,6 +497,12 @@
 #endif
 
 
+#ifndef atomic_forced_read
+# define atomic_forced_read(x) \
+  ({ __typeof (x) __x; __asm ("" : "=r" (__x) : "0" (x)); __x; })
+#endif
+
+
 #ifndef atomic_delay
 # define atomic_delay() do { /* nothing */ } while (0)
 #endif

Modified: trunk/libc/include/features.h
==============================================================================
--- trunk/libc/include/features.h (original)
+++ trunk/libc/include/features.h Tue Jan  9 05:36:33 2007
@@ -49,7 +49,7 @@
    The `-ansi' switch to the GNU C compiler defines __STRICT_ANSI__.
    If none of these are defined, the default is to have _SVID_SOURCE,
    _BSD_SOURCE, and _POSIX_SOURCE set to one and _POSIX_C_SOURCE set to
-   199506L.  If more than one of these are defined, they accumulate.
+   200112L.  If more than one of these are defined, they accumulate.
    For example __STRICT_ANSI__, _POSIX_SOURCE and _POSIX_C_SOURCE
    together give you ISO C, 1003.1, and 1003.2, but nothing else.
 

Modified: trunk/libc/io/Makefile
==============================================================================
--- trunk/libc/io/Makefile (original)
+++ trunk/libc/io/Makefile Tue Jan  9 05:36:33 2007
@@ -66,7 +66,7 @@
 		   tst-openat tst-unlinkat tst-fstatat tst-futimesat \
 		   tst-renameat tst-fchownat tst-fchmodat tst-faccessat \
 		   tst-symlinkat tst-linkat tst-readlinkat tst-mkdirat \
-		   tst-mknodat tst-mkfifoat
+		   tst-mknodat tst-mkfifoat tst-ttyname_r
 
 distribute	:= ftwtest-sh
 

Modified: trunk/libc/libio/Makefile
==============================================================================
--- trunk/libc/libio/Makefile (original)
+++ trunk/libc/libio/Makefile Tue Jan  9 05:36:33 2007
@@ -57,7 +57,8 @@
 	bug-ungetc2 bug-ftell bug-ungetc3 bug-ungetc4 tst-fopenloc2 \
 	tst-memstream1 tst-memstream2 \
 	tst-wmemstream1 tst-wmemstream2 \
-	bug-memstream1 bug-wmemstream1
+	bug-memstream1 bug-wmemstream1 \
+	tst-setvbuf1
 test-srcs = test-freopen
 
 all: # Make this the default target; it will be defined in Rules.

Modified: trunk/libc/libio/fileops.c
==============================================================================
--- trunk/libc/libio/fileops.c (original)
+++ trunk/libc/libio/fileops.c Tue Jan  9 05:36:33 2007
@@ -174,14 +174,8 @@
   close_status = _IO_SYSCLOSE (fp);
 
   /* Free buffer. */
-  if (fp->_mode <= 0)
-    {
-      INTUSE(_IO_setb) (fp, NULL, NULL, 0);
-      _IO_setg (fp, NULL, NULL, NULL);
-      _IO_setp (fp, NULL, NULL);
-    }
 #if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
-  else
+  if (fp->_mode > 0)
     {
       if (_IO_have_wbackup (fp))
 	INTUSE(_IO_free_wbackup_area) (fp);
@@ -190,6 +184,9 @@
       _IO_wsetp (fp, NULL, NULL);
     }
 #endif
+  INTUSE(_IO_setb) (fp, NULL, NULL, 0);
+  _IO_setg (fp, NULL, NULL, NULL);
+  _IO_setp (fp, NULL, NULL);
 
   INTUSE(_IO_un_link) ((struct _IO_FILE_plus *) fp);
   fp->_flags = _IO_MAGIC|CLOSED_FILEBUF_FLAGS;

Modified: trunk/libc/libio/genops.c
==============================================================================
--- trunk/libc/libio/genops.c (original)
+++ trunk/libc/libio/genops.c Tue Jan  9 05:36:33 2007
@@ -367,7 +367,7 @@
 #endif
 
   if (fp->_mode == 0)
-    _IO_fwide (fp, -11);
+    _IO_fwide (fp, -1);
   if (_IO_in_put_mode (fp))
     if (INTUSE(_IO_switch_to_get_mode) (fp) == EOF)
       return EOF;

Modified: trunk/libc/libio/libio.h
==============================================================================
--- trunk/libc/libio/libio.h (original)
+++ trunk/libc/libio/libio.h Tue Jan  9 05:36:33 2007
@@ -142,6 +142,7 @@
 #ifdef _LIBC
 # define _IO_FLAGS2_FORTIFY 4
 #endif
+#define _IO_FLAGS2_USER_WBUF 8
 
 /* These are "formatting flags" matching the iostream fmtflags enum values. */
 #define _IO_SKIPWS 01

Modified: trunk/libc/libio/wfiledoalloc.c
==============================================================================
--- trunk/libc/libio/wfiledoalloc.c (original)
+++ trunk/libc/libio/wfiledoalloc.c Tue Jan  9 05:36:33 2007
@@ -1,4 +1,5 @@
-/* Copyright (C) 1993, 1997, 1999, 2000, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1997, 1999, 2000, 2002, 2006
+   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
@@ -85,35 +86,20 @@
      _IO_FILE *fp;
 {
   _IO_size_t size;
-  int couldbetty;
   wchar_t *p;
-  struct _G_stat64 st;
 
   /* Allocate room for the external buffer.  */
   if (fp->_IO_buf_base == NULL)
     INTUSE(_IO_file_doallocate) (fp);
 
-  if (fp->_fileno < 0 || _IO_SYSSTAT (fp, &st) < 0)
-    {
-      couldbetty = 0;
-      size = _IO_BUFSIZ;
-#if 0
-      /* do not try to optimise fseek() */
-      fp->_flags |= __SNPT;
-#endif
-    }
-  else
-    {
-      couldbetty = S_ISCHR (st.st_mode);
-#if _IO_HAVE_ST_BLKSIZE
-      size = st.st_blksize <= 0 ? _IO_BUFSIZ : st.st_blksize;
-#else
-      size = _IO_BUFSIZ;
-#endif
-    }
+  /* If narrow buffer is user allocated (set by setvbuf etc.),
+     use that size as the size of the wide buffer, when it is
+     allocated by _IO_file_doallocate, multiply that by size
+     of the wide character.  */
+  size = fp->_IO_buf_end - fp->_IO_buf_base;
+  if ((fp->_flags & _IO_USER_BUF))
+    size = (size + sizeof (wchar_t) - 1) / sizeof (wchar_t);
   ALLOC_WBUF (p, size * sizeof (wchar_t), EOF);
   INTUSE(_IO_wsetb) (fp, p, p + size, 1);
-  if (couldbetty && isatty (fp->_fileno))
-    fp->_flags |= _IO_LINE_BUF;
   return 1;
 }

Modified: trunk/libc/libio/wgenops.c
==============================================================================
--- trunk/libc/libio/wgenops.c (original)
+++ trunk/libc/libio/wgenops.c Tue Jan  9 05:36:33 2007
@@ -115,14 +115,14 @@
      wchar_t *eb;
      int a;
 {
-  if (f->_wide_data->_IO_buf_base && !(f->_flags & _IO_USER_BUF))
+  if (f->_wide_data->_IO_buf_base && !(f->_flags2 & _IO_FLAGS2_USER_WBUF))
     FREE_BUF (f->_wide_data->_IO_buf_base, _IO_wblen (f) * sizeof (wchar_t));
   f->_wide_data->_IO_buf_base = b;
   f->_wide_data->_IO_buf_end = eb;
   if (a)
-    f->_flags &= ~_IO_USER_BUF;
-  else
-    f->_flags |= _IO_USER_BUF;
+    f->_flags2 &= ~_IO_FLAGS2_USER_WBUF;
+  else
+    f->_flags2 |= _IO_FLAGS2_USER_WBUF;
 }
 INTDEF(_IO_wsetb)
 
@@ -198,7 +198,7 @@
      int dummy;
 {
   struct _IO_marker *mark;
-  if (fp->_wide_data->_IO_buf_base && !(fp->_flags & _IO_USER_BUF))
+  if (fp->_wide_data->_IO_buf_base && !(fp->_flags2 & _IO_FLAGS2_USER_WBUF))
     {
       FREE_BUF (fp->_wide_data->_IO_buf_base,
 		_IO_wblen (fp) * sizeof (wchar_t));

Modified: trunk/libc/libio/wmemstream.c
==============================================================================
--- trunk/libc/libio/wmemstream.c (original)
+++ trunk/libc/libio/wmemstream.c Tue Jan  9 05:36:33 2007
@@ -92,7 +92,7 @@
   _IO_fwide (&new_f->fp._sf._sbf._f, 1);
   _IO_wstr_init_static (&new_f->fp._sf._sbf._f, buf,
 			_IO_BUFSIZ / sizeof (wchar_t), buf);
-  new_f->fp._sf._sbf._f._flags &= ~_IO_USER_BUF;
+  new_f->fp._sf._sbf._f._flags2 &= ~_IO_FLAGS2_USER_WBUF;
   new_f->fp._sf._s._allocate_buffer = (_IO_alloc_type) malloc;
   new_f->fp._sf._s._free_buffer = (_IO_free_type) free;
 

Modified: trunk/libc/libio/wstrops.c
==============================================================================
--- trunk/libc/libio/wstrops.c (original)
+++ trunk/libc/libio/wstrops.c Tue Jan  9 05:36:33 2007
@@ -88,7 +88,7 @@
   pos = fp->_wide_data->_IO_write_ptr - fp->_wide_data->_IO_write_base;
   if (pos >= (_IO_size_t) (_IO_wblen (fp) + flush_only))
     {
-      if (fp->_flags & _IO_USER_BUF) /* not allowed to enlarge */
+      if (fp->_flags2 & _IO_FLAGS2_USER_WBUF) /* not allowed to enlarge */
 	return WEOF;
       else
 	{
@@ -182,7 +182,7 @@
   _IO_ssize_t oldend = wd->_IO_write_end - wd->_IO_write_base;
 
   /* Try to enlarge the buffer.  */
-  if (fp->_flags & _IO_USER_BUF)
+  if (fp->_flags2 & _IO_FLAGS2_USER_WBUF)
     /* User-provided buffer.  */
     return 1;
 
@@ -335,7 +335,7 @@
      _IO_FILE *fp;
      int dummy;
 {
-  if (fp->_wide_data->_IO_buf_base && !(fp->_flags & _IO_USER_BUF))
+  if (fp->_wide_data->_IO_buf_base && !(fp->_flags2 & _IO_FLAGS2_USER_WBUF))
     (((_IO_strfile *) fp)->_s._free_buffer) (fp->_wide_data->_IO_buf_base);
   fp->_wide_data->_IO_buf_base = NULL;
 

Modified: trunk/libc/locale/programs/locale.c
==============================================================================
--- trunk/libc/locale/programs/locale.c (original)
+++ trunk/libc/locale/programs/locale.c Tue Jan  9 05:36:33 2007
@@ -1,5 +1,5 @@
 /* Implementation of the locale program according to POSIX 9945-2.
-   Copyright (C) 1995-1997, 1999-2005, 2006 Free Software Foundation, Inc.
+   Copyright (C) 1995-1997, 1999-2006, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1995.
 
@@ -275,7 +275,7 @@
 Copyright (C) %s Free Software Foundation, Inc.\n\
 This is free software; see the source for copying conditions.  There is NO\n\
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
-"), "2006");
+"), "2007");
   fprintf (stream, gettext ("Written by %s.\n"), "Ulrich Drepper");
 }
 

Modified: trunk/libc/locale/programs/localedef.c
==============================================================================
--- trunk/libc/locale/programs/localedef.c (original)
+++ trunk/libc/locale/programs/localedef.c Tue Jan  9 05:36:33 2007
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2004, 2005, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2004, 2005, 2006, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1995.
 
@@ -406,7 +406,7 @@
 Copyright (C) %s Free Software Foundation, Inc.\n\
 This is free software; see the source for copying conditions.  There is NO\n\
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
-"), "2006");
+"), "2007");
   fprintf (stream, gettext ("Written by %s.\n"), "Ulrich Drepper");
 }
 

Modified: trunk/libc/localedata/ChangeLog
==============================================================================
--- trunk/libc/localedata/ChangeLog (original)
+++ trunk/libc/localedata/ChangeLog Tue Jan  9 05:36:33 2007
@@ -1,3 +1,9 @@
+2006-12-05  Jakub Jelinek  <jakub@xxxxxxxxxx>
+
+	* locales/cs_CZ (LC_TIME): Change d_fmt to %e.%m.%Y from %-d.%-m.%Y.
+	Change d_t_fmt to %a %-d. %B %Y, %H:%M:%S %Z from
+	%a %e. %B %Y, %H:%M:%S %Z.
+
 2006-11-02  Ulrich Drepper  <drepper@xxxxxxxxxx>
 
 	* locales/mai_IN: New file.

Modified: trunk/libc/localedata/locales/cs_CZ
==============================================================================
--- trunk/libc/localedata/locales/cs_CZ (original)
+++ trunk/libc/localedata/locales/cs_CZ Tue Jan  9 05:36:33 2007
@@ -2440,9 +2440,9 @@
 
 week		7;19971201;4
 
-d_t_fmt		"<U0025><U0061><U00A0><U0025><U0065><U002E><U00A0><U0025><U0042><U00A0><U0025><U0059><U002C><U00A0><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U00A0><U0025><U005A>"
-
-d_fmt 		"<U0025><U0064><U002E><U0025><U006D><U002E><U0025><U0059>"
+d_t_fmt		"<U0025><U0061><U00A0><U0025><U002D><U0064><U002E><U00A0><U0025><U0042><U00A0><U0025><U0059><U002C><U00A0><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U00A0><U0025><U005A>"
+
+d_fmt 		"<U0025><U002D><U0064><U002E><U0025><U002D><U006D><U002E><U0025><U0059>"
 
 t_fmt		"<U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>"
 

Modified: trunk/libc/malloc/malloc.c
==============================================================================
--- trunk/libc/malloc/malloc.c (original)
+++ trunk/libc/malloc/malloc.c Tue Jan  9 05:36:33 2007
@@ -2896,7 +2896,13 @@
       is one SIZE_SZ unit larger than for normal chunks, because there
       is no following chunk whose prev_size field could be used.
     */
+#if 1
+    /* See the front_misalign handling below, for glibc there is no
+       need for further alignments.  */
+    size = (nb + SIZE_SZ + pagemask) & ~pagemask;
+#else
     size = (nb + SIZE_SZ + MALLOC_ALIGN_MASK + pagemask) & ~pagemask;
+#endif
     tried_mmap = true;
 
     /* Don't try if size wraps around 0 */
@@ -2914,6 +2920,12 @@
           address argument for later munmap in free() and realloc().
         */
 
+#if 1
+	/* For glibc, chunk2mem increases the address by 2*SIZE_SZ and
+	   MALLOC_ALIGN_MASK is 2*SIZE_SZ-1.  Each mmap'ed area is page
+	   aligned and therefore definitely MALLOC_ALIGN_MASK-aligned.  */
+        assert (((INTERNAL_SIZE_T)chunk2mem(mm) & MALLOC_ALIGN_MASK) == 0);
+#else
         front_misalign = (INTERNAL_SIZE_T)chunk2mem(mm) & MALLOC_ALIGN_MASK;
         if (front_misalign > 0) {
           correction = MALLOC_ALIGNMENT - front_misalign;
@@ -2921,10 +2933,12 @@
           p->prev_size = correction;
           set_head(p, (size - correction) |IS_MMAPPED);
         }
-        else {
-          p = (mchunkptr)mm;
-          set_head(p, size|IS_MMAPPED);
-        }
+        else
+#endif
+	  {
+	    p = (mchunkptr)mm;
+	    set_head(p, size|IS_MMAPPED);
+	  }
 
         /* update statistics */
 

Modified: trunk/libc/malloc/memusage.c
==============================================================================
--- trunk/libc/malloc/memusage.c (original)
+++ trunk/libc/malloc/memusage.c Tue Jan  9 05:36:33 2007
@@ -80,6 +80,7 @@
 static memusage_cntr_t calls_total;
 static memusage_cntr_t inplace;
 static memusage_cntr_t decreasing;
+static memusage_cntr_t realloc_free;
 static memusage_cntr_t inplace_mremap;
 static memusage_cntr_t decreasing_mremap;
 static memusage_size_t current_heap;
@@ -103,8 +104,8 @@
 
 struct entry
 {
-  size_t heap;
-  size_t stack;
+  uint64_t heap;
+  uint64_t stack;
   uint32_t time_low;
   uint32_t time_high;
 };
@@ -267,6 +268,7 @@
 	      GETTIME (first.time_low, first.time_high);
 	      /* Write it two times since we need the starting and end time. */
 	      write (fd, &first, sizeof (first));
+	      write (fd, &first, sizeof (first));
 
 	      /* Determine the buffer size.  We use the default if the
 		 environment variable is not present.  */
@@ -411,6 +413,23 @@
       /* Keep track of total memory requirement.  */
       catomic_add (&grand_total, len - old_len);
     }
+
+  if (len == 0 && old != NULL)
+    {
+      /* Special case.  */
+      catomic_increment (&realloc_free);
+      /* Keep track of total memory freed using `free'.  */
+      catomic_add (&total[idx_free], real->length);
+
+      /* Update the allocation data and write out the records if necessary.  */
+      update_data (NULL, 0, old_len);
+
+      /* Do the real work.  */
+      (*freep) (real);
+
+      return NULL;
+    }
+
   /* Remember the size of the request.  */
   if (len < 65536)
     catomic_increment (&histogram[len / 16]);
@@ -770,7 +789,12 @@
   if (fd != -1)
     {
       /* Write the partially filled buffer.  */
-      write (fd, buffer, buffer_cnt * sizeof (struct entry));
+      if (buffer_cnt > buffer_size)
+	write (fd, buffer + buffer_size,
+	       (buffer_cnt - buffer_size) * sizeof (struct entry));
+      else
+	write (fd, buffer, buffer_cnt * sizeof (struct entry));
+
       /* Go back to the beginning of the file.  We allocated two records
 	 here when we opened the file.  */
       lseek (fd, 0, SEEK_SET);
@@ -794,7 +818,7 @@
 \e[01;32mMemory usage summary:\e[0;0m heap total: %llu, heap peak: %lu, stack peak: %lu\n\
 \e[04;34m         total calls   total memory   failed calls\e[0m\n\
 \e[00;34m malloc|\e[0m %10lu   %12llu   %s%12lu\e[00;00m\n\
-\e[00;34mrealloc|\e[0m %10lu   %12llu   %s%12lu\e[00;00m   (in place: %ld, dec: %ld)\n\
+\e[00;34mrealloc|\e[0m %10lu   %12llu   %s%12lu\e[00;00m  (nomove:%ld, dec:%ld, free:%ld)\n\
 \e[00;34m calloc|\e[0m %10lu   %12llu   %s%12lu\e[00;00m\n\
 \e[00;34m   free|\e[0m %10lu   %12llu\n",
 	   (unsigned long long int) grand_total, (unsigned long int) peak_heap,
@@ -807,7 +831,9 @@
 	   (unsigned long long int) total[idx_realloc],
 	   failed[idx_realloc] ? "\e[01;41m" : "",
 	   (unsigned long int) failed[idx_realloc],
-	   (unsigned long int) inplace, (unsigned long int) decreasing,
+	   (unsigned long int) inplace,
+	   (unsigned long int) decreasing,
+	   (unsigned long int) realloc_free,
 	   (unsigned long int) calls[idx_calloc],
 	   (unsigned long long int) total[idx_calloc],
 	   failed[idx_calloc] ? "\e[01;41m" : "",
@@ -820,7 +846,7 @@
 \e[00;34mmmap(r)|\e[0m %10lu   %12llu   %s%12lu\e[00;00m\n\
 \e[00;34mmmap(w)|\e[0m %10lu   %12llu   %s%12lu\e[00;00m\n\
 \e[00;34mmmap(a)|\e[0m %10lu   %12llu   %s%12lu\e[00;00m\n\
-\e[00;34m mremap|\e[0m %10lu   %12llu   %s%12lu\e[00;00m   (in place: %ld, dec: %ld)\n\
+\e[00;34m mremap|\e[0m %10lu   %12llu   %s%12lu\e[00;00m  (nomove: %ld, dec:%ld)\n\
 \e[00;34m munmap|\e[0m %10lu   %12llu   %s%12lu\e[00;00m\n",
 	     (unsigned long int) calls[idx_mmap_r],
 	     (unsigned long long int) total[idx_mmap_r],

Modified: trunk/libc/malloc/memusage.sh
==============================================================================
--- trunk/libc/malloc/memusage.sh (original)
+++ trunk/libc/malloc/memusage.sh Tue Jan  9 05:36:33 2007
@@ -1,5 +1,5 @@
 #! @BASH@
-# Copyright (C) 1999-2004, 2005, 2006 Free Software Foundation, Inc.
+# Copyright (C) 1999-2004, 2005, 2006, 2007 Free Software Foundation, Inc.
 # This file is part of the GNU C Library.
 # Contributed by Ulrich Drepper <drepper@xxxxxxx>, 1999.
 
@@ -71,7 +71,7 @@
   printf $"Copyright (C) %s Free Software Foundation, Inc.
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-" "2006"
+" "2007"
   printf $"Written by %s.
 " "Ulrich Drepper"
   exit 0

Modified: trunk/libc/malloc/memusagestat.c
==============================================================================
--- trunk/libc/malloc/memusagestat.c (original)
+++ trunk/libc/malloc/memusagestat.c Tue Jan  9 05:36:33 2007
@@ -81,8 +81,8 @@
 
 struct entry
 {
-  size_t heap;
-  size_t stack;
+  uint64_t heap;
+  uint64_t stack;
   uint32_t time_low;
   uint32_t time_high;
 };

Modified: trunk/libc/malloc/mtrace.pl
==============================================================================
--- trunk/libc/malloc/mtrace.pl (original)
+++ trunk/libc/malloc/mtrace.pl Tue Jan  9 05:36:33 2007
@@ -1,7 +1,7 @@
 #! @PERL@
 eval "exec @PERL@ -S $0 $*"
     if 0;
-# Copyright (C) 1997-2004, 2005, 2006 Free Software Foundation, Inc.
+# Copyright (C) 1997-2004, 2005, 2006, 2007 Free Software Foundation, Inc.
 # This file is part of the GNU C Library.
 # Contributed by Ulrich Drepper <drepper@xxxxxxx>, 1997.
 # Based on the mtrace.awk script.
@@ -45,7 +45,7 @@
 	$ARGV[0] eq "--vers" || $ARGV[0] eq "--versi" ||
 	$ARGV[0] eq "--versio" || $ARGV[0] eq "--version") {
 	print "mtrace (GNU $PACKAGE) $VERSION\n";
-	print "Copyright (C) 2006 Free Software Foundation, Inc.\n";
+	print "Copyright (C) 2007 Free Software Foundation, Inc.\n";
 	print "This is free software; see the source for copying conditions.  There is NO\n";
 	print "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n";
 	print "Written by Ulrich Drepper <drepper\@gnu.org>\n";

Modified: trunk/libc/misc/Makefile
==============================================================================
--- trunk/libc/misc/Makefile (original)
+++ trunk/libc/misc/Makefile Tue Jan  9 05:36:33 2007
@@ -78,7 +78,7 @@
 gpl2lgpl := error.c error.h
 
 tests := tst-dirname tst-tsearch tst-fdset tst-efgcvt tst-mntent tst-hsearch \
-	 tst-error1 tst-pselect tst-insremque
+	 tst-error1 tst-pselect tst-insremque tst-mntent2
 ifeq (no,$(cross-compiling))
 tests: $(objpfx)tst-error1-mem
 endif

Modified: trunk/libc/misc/getusershell.c
==============================================================================
--- trunk/libc/misc/getusershell.c (original)
+++ trunk/libc/misc/getusershell.c Tue Jan  9 05:36:33 2007
@@ -98,7 +98,7 @@
 	register char **sp, *cp;
 	register FILE *fp;
 	struct stat64 statb;
-	int flen;
+	size_t flen;
 
 	free(shells);
 	shells = NULL;
@@ -114,9 +114,11 @@
 		okshells[1] = _PATH_CSHELL;
 		return (char **) okshells;
 	}
-	if ((strings = malloc((u_int)statb.st_size + 1)) == NULL)
+	if (statb.st_size > ~(size_t)0 / sizeof (char *) * 3)
 		goto init_okshells;
-	shells = calloc((unsigned)statb.st_size / 3, sizeof (char *));
+	if ((strings = malloc(statb.st_size + 2)) == NULL)
+		goto init_okshells;
+	shells = malloc(statb.st_size / 3 * sizeof (char *));
 	if (shells == NULL) {
 		free(strings);
 		strings = NULL;
@@ -124,11 +126,11 @@
 	}
 	sp = shells;
 	cp = strings;
-	flen = statb.st_size;
+	flen = statb.st_size + 2;
 	while (fgets_unlocked(cp, flen - (cp - strings), fp) != NULL) {
 		while (*cp != '#' && *cp != '/' && *cp != '\0')
 			cp++;
-		if (*cp == '#' || *cp == '\0')
+		if (*cp == '#' || *cp == '\0' || cp[1] == '\0')
 			continue;
 		*sp++ = cp;
 		while (!isspace(*cp) && *cp != '#' && *cp != '\0')

Modified: trunk/libc/misc/mntent_r.c
==============================================================================
--- trunk/libc/misc/mntent_r.c (original)
+++ trunk/libc/misc/mntent_r.c Tue Jan  9 05:36:33 2007
@@ -1,5 +1,6 @@
 /* Utilities for reading/writing fstab, mtab, etc.
-   Copyright (C) 1995-2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+   Copyright (C) 1995-2000, 2001, 2002, 2003, 2006
+   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
@@ -278,14 +279,11 @@
 
   while ((p = strstr (rest, opt)) != NULL)
     {
-      if (p == rest
-	  || (p[-1] == ','
-	      && (p[optlen] == '\0' ||
-		  p[optlen] == '='  ||
-		  p[optlen] == ',')))
+      if ((p == rest || p[-1] == ',')
+	  && (p[optlen] == '\0' || p[optlen] == '=' || p[optlen] == ','))
 	return p;
 
-      rest = strchr (rest, ',');
+      rest = strchr (p, ',');
       if (rest == NULL)
 	break;
       ++rest;

Modified: trunk/libc/misc/tst-pselect.c
==============================================================================
--- trunk/libc/misc/tst-pselect.c (original)
+++ trunk/libc/misc/tst-pselect.c Tue Jan  9 05:36:33 2007
@@ -29,7 +29,16 @@
       return 1;
     }
 
-  if (sigblock (SIGUSR1) != 0)
+  sa.sa_handler = SIG_IGN;
+  sa.sa_flags = SA_NOCLDWAIT;
+
+  if (sigaction (SIGCHLD, &sa, NULL) != 0)
+    {
+      puts ("2nd sigaction failed");
+      return 1;
+    }
+
+  if (sigblock (sigmask (SIGUSR1)) != 0)
     {
       puts ("sigblock failed");
       return 1;
@@ -52,6 +61,7 @@
 
   struct timespec to = { .tv_sec = 0, .tv_nsec = 500000000 };
 
+  pid_t parent = getpid ();
   pid_t p = fork ();
   if (p == 0)
     {
@@ -63,6 +73,9 @@
       int e;
       do
 	{
+	  if (getppid () != parent)
+	    exit (2);
+
 	  errno = 0;
 	  e = pselect (fds[0][0] + 1, &rfds, NULL, NULL, &to, &ss);
 	}
@@ -108,12 +121,6 @@
       return 1;
     }
 
-  if (TEMP_FAILURE_RETRY (waitpid (p, NULL, 0)) != p)
-    {
-      puts ("waitpid failed");
-      return 1;
-    }
-
   return 0;
 }
 

Modified: trunk/libc/nis/nis_subr.c
==============================================================================
--- trunk/libc/nis/nis_subr.c (original)
+++ trunk/libc/nis/nis_subr.c Tue Jan  9 05:36:33 2007
@@ -178,7 +178,7 @@
     }
 
   /* Get the search path, where we have to search "name" */
-  path = __secure_getenv ("NIS_PATH");
+  path = getenv ("NIS_PATH");
   if (path == NULL)
     path = strdupa ("$");
   else

Modified: trunk/libc/nis/nss_compat/compat-grp.c
==============================================================================
--- trunk/libc/nis/nss_compat/compat-grp.c (original)
+++ trunk/libc/nis/nss_compat/compat-grp.c Tue Jan  9 05:36:33 2007
@@ -580,13 +580,17 @@
       /* +group */
       if (result->gr_name[0] == '+' && result->gr_name[1] != '\0')
 	{
+	  /* Yes, no +1, see the memcpy call below.  */
+	  size_t len = strlen (result->gr_name);
+	  char buf[len];
 	  enum nss_status status;
 
 	  /* Store the group in the blacklist for the "+" at the end of
 	     /etc/group */
-	  blacklist_store_name (&result->gr_name[1], ent);
+	  memcpy (buf, &result->gr_name[1], len);
 	  status = getgrnam_plusgroup (&result->gr_name[1], result, ent,
 				       buffer, buflen, errnop);
+	  blacklist_store_name (buf, ent);
 	  if (status == NSS_STATUS_SUCCESS && result->gr_gid == gid)
 	    break;
 	  else

Modified: trunk/libc/nptl/ChangeLog
==============================================================================
--- trunk/libc/nptl/ChangeLog (original)
+++ trunk/libc/nptl/ChangeLog Tue Jan  9 05:36:33 2007
@@ -1,3 +1,22 @@
+2006-12-21  Jakub Jelinek  <jakub@xxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/pthread_kill.c (pthread_kill): Make sure
+	tid isn't reread from pd->tid in between ESRCH test and the syscall.
+
+2006-12-06  Jakub Jelinek  <jakub@xxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (PSEUDO): Handle
+	6 argument cancellable syscalls.
+	(STM_6, LM_6, LR7_0, LR7_1, LR7_2, LR7_3, LR7_4, LR7_5, LR7_6): Define.
+	* sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (PSEUDO): Handle
+	6 argument cancellable syscalls.
+	(STM_6, LM_6, LR7_0, LR7_1, LR7_2, LR7_3, LR7_4, LR7_5, LR7_6): Define.
+
+2006-12-09  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/rtld-lowlevel.h
+	(__rtld_mrlock_initialize): Add missing closing parenthesis.
+
 2006-10-30  Jakub Jelinek  <jakub@xxxxxxxxxx>
 
 	* sysdeps/ia64/pthread_spin_unlock.c (pthread_spin_unlock): Use

Modified: trunk/libc/nptl/sysdeps/unix/sysv/linux/pthread_kill.c
==============================================================================
--- trunk/libc/nptl/sysdeps/unix/sysv/linux/pthread_kill.c (original)
+++ trunk/libc/nptl/sysdeps/unix/sysv/linux/pthread_kill.c Tue Jan  9 05:36:33 2007
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 2002.
 
@@ -33,7 +33,15 @@
   struct pthread *pd = (struct pthread *) threadid;
 
   /* Make sure the descriptor is valid.  */
-  if (INVALID_TD_P (pd))
+  if (DEBUGGING_P && INVALID_TD_P (pd))
+    /* Not a valid thread handle.  */
+    return ESRCH;
+
+  /* Force load of pd->tid into local variable or register.  Otherwise
+     if a thread exits between ESRCH test and tgkill, we might return
+     EINVAL, because pd->tid would be cleared by the kernel.  */
+  pid_t tid = atomic_forced_read (pd->tid);
+  if (__builtin_expect (tid <= 0, 0))
     /* Not a valid thread handle.  */
     return ESRCH;
 
@@ -53,15 +61,15 @@
   int val;
 #if __ASSUME_TGKILL
   val = INTERNAL_SYSCALL (tgkill, err, 3, THREAD_GETMEM (THREAD_SELF, pid),
-			  pd->tid, signo);
+			  tid, signo);
 #else
 # ifdef __NR_tgkill
   val = INTERNAL_SYSCALL (tgkill, err, 3, THREAD_GETMEM (THREAD_SELF, pid),
-			  pd->tid, signo);
+			  tid, signo);
   if (INTERNAL_SYSCALL_ERROR_P (val, err)
       && INTERNAL_SYSCALL_ERRNO (val, err) == ENOSYS)
 # endif
-    val = INTERNAL_SYSCALL (tkill, err, 2, pd->tid, signo);
+    val = INTERNAL_SYSCALL (tkill, err, 2, tid, signo);
 #endif
 
   return (INTERNAL_SYSCALL_ERROR_P (val, err)

Modified: trunk/libc/nptl/sysdeps/unix/sysv/linux/rtld-lowlevel.h
==============================================================================
--- trunk/libc/nptl/sysdeps/unix/sysv/linux/rtld-lowlevel.h (original)
+++ trunk/libc/nptl/sysdeps/unix/sysv/linux/rtld-lowlevel.h Tue Jan  9 05:36:33 2007
@@ -43,7 +43,7 @@
 
 #define _RTLD_MRLOCK_INITIALIZER 0
 #define __rtld_mrlock_initialize(NAME) \
-  (void) ((NAME) = 0
+  (void) ((NAME) = 0)
 
 
 #define __rtld_mrlock_lock(lock) \

Modified: trunk/libc/nptl/sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
==============================================================================
--- trunk/libc/nptl/sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h (original)
+++ trunk/libc/nptl/sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h Tue Jan  9 05:36:33 2007
@@ -45,7 +45,13 @@
 	bas	%r14,0(%r1,%r13);					      \
 	lr	%r0,%r2;						      \
 	LM_##args							      \
-	DO_CALL(syscall_name, args);					      \
+	.if SYS_ify (syscall_name) < 256;				      \
+	svc SYS_ify (syscall_name);					      \
+	.else;								      \
+	lhi %r1,SYS_ify (syscall_name);					      \
+	svc 0;								      \
+	.endif;								      \
+	LR7_##args							      \
 	l	%r1,2f-0b(%r13);					      \
 	lr	%r12,%r2;						      \
 	lr	%r2,%r0;						      \
@@ -89,6 +95,7 @@
 #define STM_3		stm %r2,%r4,8(%r15);
 #define STM_4		stm %r2,%r5,8(%r15);
 #define STM_5		stm %r2,%r5,8(%r15);
+#define STM_6		stm %r2,%r7,8(%r15);
 
 #define LM_0		/* Nothing */
 #define LM_1		l %r2,8+96(%r15);
@@ -96,6 +103,18 @@
 #define LM_3		lm %r2,%r4,8+96(%r15);
 #define LM_4		lm %r2,%r5,8+96(%r15);
 #define LM_5		lm %r2,%r5,8+96(%r15);
+#define LM_6		lm %r2,%r5,8+96(%r15); \
+			cfi_offset (%r7, -68); \
+			l %r7,96+96(%r15);
+
+#define LR7_0		/* Nothing */
+#define LR7_1		/* Nothing */
+#define LR7_2		/* Nothing */
+#define LR7_3		/* Nothing */
+#define LR7_4		/* Nothing */
+#define LR7_5		/* Nothing */
+#define LR7_6		l %r7,28+96(%r15); \
+			cfi_restore (%r7);
 
 # ifndef __ASSEMBLER__
 #  define SINGLE_THREAD_P \

Modified: trunk/libc/nptl/sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
==============================================================================
--- trunk/libc/nptl/sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (original)
+++ trunk/libc/nptl/sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h Tue Jan  9 05:36:33 2007
@@ -42,7 +42,13 @@
 	brasl	%r14,CENABLE;						      \
 	lgr	%r0,%r2;						      \
 	LM_##args							      \
-	DO_CALL(syscall_name, args);					      \
+	.if SYS_ify (syscall_name) < 256;				      \
+	svc SYS_ify (syscall_name);					      \
+	.else;								      \
+	lghi %r1,SYS_ify (syscall_name);				      \
+	svc 0;								      \
+	.endif;								      \
+	LR7_##args							      \
 	lgr	%r13,%r2;						      \
 	lgr	%r2,%r0;						      \
 	brasl	%r14,CDISABLE;						      \
@@ -85,6 +91,7 @@
 #define STM_3		stmg %r2,%r4,16(%r15);
 #define STM_4		stmg %r2,%r5,16(%r15);
 #define STM_5		stmg %r2,%r5,16(%r15);
+#define STM_6		stmg %r2,%r7,16(%r15);
 
 #define LM_0		/* Nothing */
 #define LM_1		lg %r2,16+160(%r15);
@@ -92,6 +99,18 @@
 #define LM_3		lmg %r2,%r4,16+160(%r15);
 #define LM_4		lmg %r2,%r5,16+160(%r15);
 #define LM_5		lmg %r2,%r5,16+160(%r15);
+#define LM_6		lmg %r2,%r5,16+160(%r15); \
+			cfi_offset (%r7, -104); \
+			lg %r7,160+160(%r15);
+
+#define LR7_0		/* Nothing */
+#define LR7_1		/* Nothing */
+#define LR7_2		/* Nothing */
+#define LR7_3		/* Nothing */
+#define LR7_4		/* Nothing */
+#define LR7_5		/* Nothing */
+#define LR7_6		lg %r7,56+160(%r15); \
+			cfi_restore (%r7);
 
 # if defined IS_IN_libpthread || !defined NOT_IN_libc
 #  ifndef __ASSEMBLER__

Modified: trunk/libc/nscd/nscd.c
==============================================================================
--- trunk/libc/nscd/nscd.c (original)
+++ trunk/libc/nscd/nscd.c Tue Jan  9 05:36:33 2007
@@ -1,4 +1,4 @@
-/* Copyright (c) 1998-2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+/* Copyright (c) 1998-2006, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Thorsten Kukuk <kukuk@xxxxxxx>, 1998.
 
@@ -402,7 +402,7 @@
 Copyright (C) %s Free Software Foundation, Inc.\n\
 This is free software; see the source for copying conditions.  There is NO\n\
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
-"), "2006");
+"), "2007");
   fprintf (stream, gettext ("Written by %s.\n"),
 	   "Thorsten Kukuk and Ulrich Drepper");
 }

Modified: trunk/libc/nss/getXXbyYY_r.c
==============================================================================
--- trunk/libc/nss/getXXbyYY_r.c (original)
+++ trunk/libc/nss/getXXbyYY_r.c Tue Jan  9 05:36:33 2007
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2002, 2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2002, 2003, 2004, 2006 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1996.
 
@@ -18,6 +18,7 @@
    02111-1307 USA.  */
 
 #include <assert.h>
+#include <atomic.h>
 #include <errno.h>
 #include <stdbool.h>
 #include "nsswitch.h"
@@ -173,9 +174,6 @@
 	startp = (service_user *) -1l;
       else
 	{
-	  startp = nip;
-	  start_fct = fct.l;
-
 #ifdef NEED__RES
 	  /* The resolver code will really be used so we have to
 	     initialize it.  */
@@ -190,6 +188,11 @@
 	  if (!_res_hconf.initialized)
 	    _res_hconf_init ();
 #endif /* need _res_hconf */
+
+	  start_fct = fct.l;
+	  /* Make sure start_fct is written before startp.  */
+	  atomic_write_barrier ();
+	  startp = nip;
 	}
     }
   else

Modified: trunk/libc/nss/getent.c
==============================================================================
--- trunk/libc/nss/getent.c (original)
+++ trunk/libc/nss/getent.c Tue Jan  9 05:36:33 2007
@@ -1,4 +1,4 @@
-/* Copyright (c) 1998-2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+/* Copyright (c) 1998-2006, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Thorsten Kukuk <kukuk@xxxxxxx>, 1998.
 
@@ -84,7 +84,7 @@
 Copyright (C) %s Free Software Foundation, Inc.\n\
 This is free software; see the source for copying conditions.  There is NO\n\
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
-"), "2006");
+"), "2007");
   fprintf (stream, gettext ("Written by %s.\n"), "Thorsten Kukuk");
 }
 

Modified: trunk/libc/posix/Makefile
==============================================================================
--- trunk/libc/posix/Makefile (original)
+++ trunk/libc/posix/Makefile Tue Jan  9 05:36:33 2007
@@ -1,4 +1,4 @@
-# Copyright (C) 1991-1999, 2000-2005, 2006 Free Software Foundation, Inc.
+# Copyright (C) 1991-1999, 2000-2006, 2007 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
@@ -83,7 +83,7 @@
 		   bug-regex21 bug-regex22 bug-regex23 bug-regex24 \
 		   bug-regex25 bug-regex26 tst-nice tst-nanosleep tst-regex2 \
 		   transbug tst-rxspencer tst-pcre tst-boost \
-		   bug-ga1 tst-vfork1 tst-vfork2 tst-waitid \
+		   bug-ga1 tst-vfork1 tst-vfork2 tst-vfork3 tst-waitid \
 		   tst-getaddrinfo2 bug-glob1 bug-glob2 tst-sysconf \
 		   tst-execvp1 tst-execvp2 tst-execlp1 tst-execlp2 \
 		   tst-execv1 tst-execv2 tst-execl1 tst-execl2 \
@@ -108,7 +108,8 @@
 	     bug-regex21-mem bug-regex21.mtrace \
 	     tst-rxspencer-mem tst-rxspencer.mtrace tst-getconf.out \
 	     tst-pcre-mem tst-pcre.mtrace tst-boost-mem tst-boost.mtrace \
-	     bug-ga2.mtrace bug-ga2-mem bug-glob2.mtrace bug-glob2-mem
+	     bug-ga2.mtrace bug-ga2-mem bug-glob2.mtrace bug-glob2-mem \
+	     tst-vfork3-mem tst-vfork3.mtrace
 
 include ../Rules
 
@@ -174,6 +175,7 @@
 tst-spawn-ARGS = -- $(built-program-cmd)
 tst-dir-ARGS = `pwd` `cd $(common-objdir)/$(subdir); pwd` `cd $(common-objdir); pwd` $(objpfx)tst-dir
 tst-chmod-ARGS = `pwd`
+tst-vfork3-ARGS = --test-dir=$(objpfx)
 
 tst-fnmatch-ENV = LOCPATH=$(common-objpfx)localedata
 tst-regexloc-ENV = LOCPATH=$(common-objpfx)localedata
@@ -218,7 +220,7 @@
 tests: $(objpfx)bug-regex2-mem $(objpfx)bug-regex14-mem \
   $(objpfx)bug-regex21-mem $(objpfx)tst-rxspencer-mem \
   $(objpfx)tst-pcre-mem $(objpfx)tst-boost-mem $(objpfx)tst-getconf.out \
-  $(objpfx)bug-glob2-mem
+  $(objpfx)bug-glob2-mem $(objpfx)tst-vfork3-mem
 xtests: $(objpfx)bug-ga2-mem
 endif
 
@@ -244,6 +246,11 @@
 
 $(objpfx)bug-regex21-mem: $(objpfx)bug-regex21.out
 	$(common-objpfx)malloc/mtrace $(objpfx)bug-regex21.mtrace > $@
+
+tst-vfork3-ENV = MALLOC_TRACE=$(objpfx)tst-vfork3.mtrace
+
+$(objpfx)tst-vfork3-mem: $(objpfx)tst-vfork3.out
+	$(common-objpfx)malloc/mtrace $(objpfx)tst-vfork3.mtrace > $@
 
 # tst-rxspencer.mtrace is generated only when run without --utf8
 # option, since otherwise the file has almost 100M and takes very long

Modified: trunk/libc/posix/execvp.c
==============================================================================
--- trunk/libc/posix/execvp.c (original)
+++ trunk/libc/posix/execvp.c Tue Jan  9 05:36:33 2007
@@ -1,4 +1,5 @@
-/* Copyright (C) 1991,92,1995-99,2002,2004,2005 Free Software Foundation, Inc.
+/* Copyright (C) 1991,92, 1995-99, 2002, 2004, 2005, 2007
+   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
@@ -16,6 +17,7 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#include <alloca.h>
 #include <unistd.h>
 #include <stdarg.h>
 #include <stdbool.h>
@@ -27,29 +29,18 @@
 
 /* The file is accessible but it is not an executable file.  Invoke
    the shell to interpret it as a script.  */
-static char **
+static void
 internal_function
-allocate_scripts_argv (const char *file, char *const argv[])
+scripts_argv (const char *file, char *const argv[], int argc, char **new_argv)
 {
-  /* Count the arguments.  */
-  int argc = 0;
-  while (argv[argc++])
-    ;
-
   /* Construct an argument list for the shell.  */
-  char **new_argv = (char **) malloc ((argc + 1) * sizeof (char *));
-  if (new_argv != NULL)
-    {
-      new_argv[0] = (char *) _PATH_BSHELL;
-      new_argv[1] = (char *) file;
-      while (argc > 1)
-	{
-	  new_argv[argc] = argv[argc - 1];
-	  --argc;
-	}
-    }
-
-  return new_argv;
+  new_argv[0] = (char *) _PATH_BSHELL;
+  new_argv[1] = (char *) file;
+  while (argc > 1)
+    {
+      new_argv[argc] = argv[argc - 1];
+      --argc;
+    }
 }
 
 
@@ -67,8 +58,6 @@
       return -1;
     }
 
-  char **script_argv = NULL;
-
   if (strchr (file, '/') != NULL)
     {
       /* Don't search when it contains a slash.  */
@@ -76,46 +65,71 @@
 
       if (errno == ENOEXEC)
 	{
-	  script_argv = allocate_scripts_argv (file, argv);
+	  /* Count the arguments.  */
+	  int argc = 0;
+	  while (argv[argc++])
+	    ;
+	  size_t len = (argc + 1) * sizeof (char *);
+	  char **script_argv;
+	  void *ptr = NULL;
+	  if (__libc_use_alloca (len))
+	    script_argv = alloca (len);
+	  else
+	    script_argv = ptr = malloc (len);
+
 	  if (script_argv != NULL)
 	    {
+	      scripts_argv (file, argv, argc, script_argv);
 	      __execve (script_argv[0], script_argv, __environ);
 
-	      free (script_argv);
+	      free (ptr);
 	    }
 	}
     }
   else
     {
+      size_t pathlen;
+      size_t alloclen = 0;
       char *path = getenv ("PATH");
+      if (path == NULL)
+	{
+	  pathlen = confstr (_CS_PATH, (char *) NULL, 0);
+	  alloclen = pathlen + 1;
+	}
+      else
+	pathlen = strlen (path);
+
+      size_t len = strlen (file) + 1;
+      alloclen += pathlen + len + 1;
+
+      char *name;
       char *path_malloc = NULL;
+      if (__libc_use_alloca (alloclen))
+	name = alloca (alloclen);
+      else
+	{
+	  path_malloc = name = malloc (alloclen);
+	  if (name == NULL)
+	    return -1;
+	}
+
       if (path == NULL)
 	{
 	  /* There is no `PATH' in the environment.
 	     The default search path is the current directory
 	     followed by the path `confstr' returns for `_CS_PATH'.  */
-	  size_t len = confstr (_CS_PATH, (char *) NULL, 0);
-	  path = (char *) malloc (1 + len);
-	  if (path == NULL)
-	    return -1;
+	  path = name + pathlen + len + 1;
 	  path[0] = ':';
-	  (void) confstr (_CS_PATH, path + 1, len);
-	  path_malloc = path;
-	}
-
-      size_t len = strlen (file) + 1;
-      size_t pathlen = strlen (path);
-      char *name = malloc (pathlen + len + 1);
-      if (name == NULL)
-	{
-	  free (path_malloc);
-	  return -1;
-	}
+	  (void) confstr (_CS_PATH, path + 1, pathlen);
+	}
+
       /* Copy the file name at the top.  */
       name = (char *) memcpy (name + pathlen + 1, file, len);
       /* And add the slash.  */
       *--name = '/';
 
+      char **script_argv = NULL;
+      void *script_argv_malloc = NULL;
       bool got_eacces = false;
       char *p = path;
       do
@@ -139,7 +153,15 @@
 	    {
 	      if (script_argv == NULL)
 		{
-		  script_argv = allocate_scripts_argv (startp, argv);
+		  /* Count the arguments.  */
+		  int argc = 0;
+		  while (argv[argc++])
+		    ;
+		  size_t arglen = (argc + 1) * sizeof (char *);
+		  if (__libc_use_alloca (alloclen + arglen))
+		    script_argv = alloca (arglen);
+		  else
+		    script_argv = script_argv_malloc = malloc (arglen);
 		  if (script_argv == NULL)
 		    {
 		      /* A possible EACCES error is not as important as
@@ -147,6 +169,7 @@
 		      got_eacces = false;
 		      break;
 		    }
+		  scripts_argv (startp, argv, argc, script_argv);
 		}
 
 	      __execve (script_argv[0], script_argv, __environ);
@@ -184,11 +207,10 @@
       /* We tried every element and none of them worked.  */
       if (got_eacces)
 	/* At least one failure was due to permissions, so report that
-           error.  */
+	   error.  */
 	__set_errno (EACCES);
 
-      free (script_argv);
-      free (name - pathlen);
+      free (script_argv_malloc);
       free (path_malloc);
     }
 

Modified: trunk/libc/posix/getconf.c
==============================================================================
--- trunk/libc/posix/getconf.c (original)
+++ trunk/libc/posix/getconf.c Tue Jan  9 05:36:33 2007
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 92, 1995-2005, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 92, 1995-2006, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    This program is free software; you can redistribute it and/or modify
@@ -1008,7 +1008,7 @@
 Copyright (C) %s Free Software Foundation, Inc.\n\
 This is free software; see the source for copying conditions.  There is NO\n\
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
-"), "2006");
+"), "2007");
       fprintf (stderr, gettext ("Written by %s.\n"), "Roland McGrath");
       return 0;
     }

Modified: trunk/libc/posix/wordexp.c
==============================================================================
--- trunk/libc/posix/wordexp.c (original)
+++ trunk/libc/posix/wordexp.c Tue Jan  9 05:36:33 2007
@@ -1809,7 +1809,7 @@
 	    /* Substitute parameter */
 	    break;
 
-	  if (free_value && value)
+	  if (free_value)
 	    free (value);
 
 	  if (!colon_seen && value)
@@ -1827,7 +1827,7 @@
 	case ACT_NONNULL_SUBST:
 	  if (value && (*value || !colon_seen))
 	    {
-	      if (free_value && value)
+	      if (free_value)
 		free (value);
 
 	      value = pattern ? __strdup (pattern) : pattern;

Modified: trunk/libc/stdlib/Makefile
==============================================================================
--- trunk/libc/stdlib/Makefile (original)
+++ trunk/libc/stdlib/Makefile Tue Jan  9 05:36:33 2007
@@ -1,4 +1,4 @@
-# Copyright (C) 1991-2002,2003,2004,2005,2006 Free Software Foundation, Inc.
+# Copyright (C) 1991-2006, 2007 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
@@ -66,7 +66,9 @@
 		   test-canon test-canon2 tst-strtoll tst-environ	    \
 		   tst-xpg-basename tst-random tst-random2 tst-bsearch	    \
 		   tst-limits tst-rand48 bug-strtod tst-setcontext	    \
-		   test-a64l tst-qsort tst-system testmb2 bug-strtod2
+		   test-a64l tst-qsort tst-system testmb2 bug-strtod2	    \
+		   tst-atof1 tst-atof2 tst-strtod2 tst-strtod3 tst-rand48-2 \
+		   tst-makecontext
 
 include ../Makeconfig
 
@@ -111,6 +113,7 @@
 test-canon-ARGS = --test-dir=${common-objpfx}stdlib
 
 tst-strtod-ENV = LOCPATH=$(common-objpfx)localedata
+tst-strtod3-ENV = LOCPATH=$(common-objpfx)localedata
 testmb2-ENV = LOCPATH=$(common-objpfx)localedata
 
 # Run a test on the header files we use.

Modified: trunk/libc/stdlib/jrand48_r.c
==============================================================================
--- trunk/libc/stdlib/jrand48_r.c (original)
+++ trunk/libc/stdlib/jrand48_r.c Tue Jan  9 05:36:33 2007
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995, 1997, 1998, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 1997, 1998, 2001, 2006 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxxxxxx>, August 1995.
 
@@ -30,7 +30,7 @@
     return -1;
 
   /* Store the result.  */
-  *result = ((xsubi[2] << 16) | xsubi[1]) & 0xffffffffl;
+  *result = (int32_t) ((xsubi[2] << 16) | xsubi[1]);
 
   return 0;
 }

Modified: trunk/libc/stdlib/strtod_l.c
==============================================================================
--- trunk/libc/stdlib/strtod_l.c (original)
+++ trunk/libc/stdlib/strtod_l.c Tue Jan  9 05:36:33 2007
@@ -662,20 +662,20 @@
 
   /* If no other digit but a '0' is found the result is 0.0.
      Return current read pointer.  */
-  if ((c < L_('0') || c > L_('9'))
-      && (base == 16 && (c < (CHAR_TYPE) TOLOWER (L_('a'))
-			 || c > (CHAR_TYPE) TOLOWER (L_('f'))))
+  if (!((c >= L_('0') && c <= L_('9'))
+	|| (base == 16 && ((CHAR_TYPE) TOLOWER (c) >= L_('a')
+			   && (CHAR_TYPE) TOLOWER (c) <= L_('f')))
 #ifdef USE_WIDE_CHAR
-      && c != (wint_t) decimal
+	|| c == (wint_t) decimal
 #else
-      && ({ for (cnt = 0; decimal[cnt] != '\0'; ++cnt)
+	|| ({ for (cnt = 0; decimal[cnt] != '\0'; ++cnt)
 	      if (decimal[cnt] != cp[cnt])
 		break;
-	    decimal[cnt] != '\0'; })
-#endif
-      && (base == 16 && (cp == start_of_digits
-			 || (CHAR_TYPE) TOLOWER (c) != L_('p')))
-      && (base != 16 && (CHAR_TYPE) TOLOWER (c) != L_('e')))
+	      decimal[cnt] == '\0'; })
+#endif
+	|| (base == 16 && (cp != start_of_digits
+			   && (CHAR_TYPE) TOLOWER (c) == L_('p')))
+	|| (base != 16 && (CHAR_TYPE) TOLOWER (c) == L_('e'))))
     {
 #ifdef USE_WIDE_CHAR
       tp = __correctly_grouped_prefixwc (start_of_digits, cp, thousands,
@@ -721,7 +721,7 @@
       c = *++cp;
     }
 
-  if (grouping && dig_no > 0)
+  if (grouping && cp > start_of_digits)
     {
       /* Check the grouping of the digits.  */
 #ifdef USE_WIDE_CHAR
@@ -759,13 +759,15 @@
 	}
     }
 
-  /* We have the number digits in the integer part.  Whether these are all or
-     any is really a fractional digit will be decided later.  */
+  /* We have the number of digits in the integer part.  Whether these
+     are all or any is really a fractional digit will be decided
+     later.  */
   int_no = dig_no;
   lead_zero = int_no == 0 ? -1 : 0;
 
-  /* Read the fractional digits.  A special case are the 'american style'
-     numbers like `16.' i.e. with decimal but without trailing digits.  */
+  /* Read the fractional digits.  A special case are the 'american
+     style' numbers like `16.' i.e. with decimal point but without
+     trailing digits.  */
   if (
 #ifdef USE_WIDE_CHAR
       c == (wint_t) decimal
@@ -815,15 +817,16 @@
 	  if (base == 16)
 	    exp_limit = (exp_negative ?
 			 -MIN_EXP + MANT_DIG + 4 * int_no :
-			 MAX_EXP - 4 * int_no + lead_zero);
+			 MAX_EXP - 4 * int_no + 4 * lead_zero + 3);
 	  else
 	    exp_limit = (exp_negative ?
 			 -MIN_10_EXP + MANT_DIG + int_no :
-			 MAX_10_EXP - int_no + lead_zero);
+			 MAX_10_EXP - int_no + lead_zero + 1);
 
 	  do
 	    {
 	      exponent *= 10;
+	      exponent += c - L_('0');
 
 	      if (exponent > exp_limit)
 		/* The exponent is too large/small to represent a valid
@@ -853,7 +856,6 @@
 		  /* NOTREACHED */
 		}
 
-	      exponent += c - L_('0');
 	      c = *++cp;
 	    }
 	  while (c >= L_('0') && c <= L_('9'));
@@ -888,7 +890,7 @@
 	--expp;
 	--dig_no;
 	--int_no;
-	++exponent;
+	exponent += base == 16 ? 4 : 1;
       }
     while (dig_no > 0 && exponent < 0);
 

Modified: trunk/libc/stdlib/tst-rand48.c
==============================================================================
--- trunk/libc/stdlib/tst-rand48.c (original)
+++ trunk/libc/stdlib/tst-rand48.c Tue Jan  9 05:36:33 2007
@@ -44,10 +44,10 @@
     }
 
   l = mrand48 ();
-  if (l != 0xa28c1003l)
-    {
-      printf ("mrand48() in line %d failed: expected %lx, seen %lx\n",
-	      __LINE__ - 4, 0xa28c1003l, l);
+  if (l != -0x5d73effdl)
+    {
+      printf ("mrand48() in line %d failed: expected %lx, seen %lx\n",
+	      __LINE__ - 4, -0x5d73effdl, l);
       result = 1;
     }
 
@@ -60,10 +60,10 @@
     }
 
   l = mrand48 ();
-  if (l != 0x9e88f474l)
-    {
-      printf ("mrand48() in line %d failed: expected %lx, seen %lx\n",
-	      __LINE__ - 4, 0x9e88f474l, l);
+  if (l != -0x61770b8cl)
+    {
+      printf ("mrand48() in line %d failed: expected %lx, seen %lx\n",
+	      __LINE__ - 4, -0x61770b8cl, l);
       result = 1;
     }
 
@@ -92,10 +92,10 @@
     }
 
   l = mrand48 ();
-  if (l != 0xeb7a1fa3l)
-    {
-      printf ("mrand48() in line %d failed: expected %lx, seen %lx\n",
-	      __LINE__ - 4, 0xeb7a1fa3l, l);
+  if (l != -0x1485e05dl)
+    {
+      printf ("mrand48() in line %d failed: expected %lx, seen %lx\n",
+	      __LINE__ - 4, -0x1485e05dl, l);
       result = 1;
     }
 
@@ -171,10 +171,10 @@
     }
 
   l = mrand48 ();
-  if (l != 0xa28c1003l)
-    {
-      printf ("mrand48() in line %d failed: expected %lx, seen %lx\n",
-	      __LINE__ - 4, 0xa28c1003l, l);
+  if (l != -0x5d73effdl)
+    {
+      printf ("mrand48() in line %d failed: expected %lx, seen %lx\n",
+	      __LINE__ - 4, -0x5d73effdl, l);
       result = 1;
     }
 
@@ -187,10 +187,10 @@
     }
 
   l = mrand48 ();
-  if (l != 0x9e88f474l)
-    {
-      printf ("mrand48() in line %d failed: expected %lx, seen %lx\n",
-	      __LINE__ - 4, 0x9e88f474l, l);
+  if (l != -0x61770b8cl)
+    {
+      printf ("mrand48() in line %d failed: expected %lx, seen %lx\n",
+	      __LINE__ - 4, -0x61770b8cl, l);
       result = 1;
     }
 
@@ -231,10 +231,10 @@
     }
 
   l = mrand48 ();
-  if (l != 0xeb7a1fa3l)
-    {
-      printf ("mrand48() in line %d failed: expected %lx, seen %lx\n",
-	      __LINE__ - 4, 0xeb7a1fa3l, l);
+  if (l != -0x1485e05dl)
+    {
+      printf ("mrand48() in line %d failed: expected %lx, seen %lx\n",
+	      __LINE__ - 4, -0x1485e05dl, l);
       result = 1;
     }
 
@@ -287,10 +287,10 @@
     }
 
   l = jrand48 (xs);
-  if (l != 0xf568c7a0l)
+  if (l != -0xa973860l)
     {
       printf ("jrand48() in line %d failed: expected %lx, seen %lx\n",
-	      __LINE__ - 4, 0xf568c7a0l, l);
+	      __LINE__ - 4, -0xa973860l, l);
       result = 1;
     }
 

Modified: trunk/libc/string/Makefile
==============================================================================
--- trunk/libc/string/Makefile (original)
+++ trunk/libc/string/Makefile Tue Jan  9 05:36:33 2007
@@ -1,4 +1,4 @@
-# Copyright (C) 1991-2002, 2005, 2006 Free Software Foundation, Inc.
+# Copyright (C) 1991-2002, 2005, 2006, 2007 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
@@ -64,6 +64,7 @@
 inl-tester-ENV = LANGUAGE=C
 noinl-tester-ENV = LANGUAGE=C
 tst-strxfrm-ENV = LOCPATH=$(common-objpfx)localedata
+tst-strxfrm2-ENV = LOCPATH=$(common-objpfx)localedata
 bug-strcoll1-ENV = LOCPATH=$(common-objpfx)localedata
 CFLAGS-inl-tester.c = -fno-builtin
 CFLAGS-noinl-tester.c = -fno-builtin

Modified: trunk/libc/sysdeps/powerpc/dl-procinfo.c
==============================================================================
--- trunk/libc/sysdeps/powerpc/dl-procinfo.c (original)
+++ trunk/libc/sysdeps/powerpc/dl-procinfo.c Tue Jan  9 05:36:33 2007
@@ -46,10 +46,11 @@
 #if !defined PROCINFO_DECL && defined SHARED
   ._dl_powerpc_cap_flags
 #else
-PROCINFO_CLASS const char _dl_powerpc_cap_flags[20][10]
+PROCINFO_CLASS const char _dl_powerpc_cap_flags[23][10]
 #endif
 #ifndef PROCINFO_DECL
 = {
+    "power6x", "dfp", "pa6t",
     "arch_2_05", "ic_snoop", "smt", "booke",
     "cellbe", "power5+", "power5", "power4",
     "notb", "efpdouble", "efpsingle", "spe",
@@ -66,11 +67,17 @@
 #if !defined PROCINFO_DECL && defined SHARED
   ._dl_powerpc_platforms
 #else
-PROCINFO_CLASS const char _dl_powerpc_platforms[6][12]
+PROCINFO_CLASS const char _dl_powerpc_platforms[7][12]
 #endif
 #ifndef PROCINFO_DECL
 = {
-    "power4", "ppc970", "power5", "power5+", "power6", "ppc-cell-be"
+    [PPC_PLATFORM_POWER4] = "power4",
+    [PPC_PLATFORM_PPC970] = "ppc970",
+    [PPC_PLATFORM_POWER5] = "power5",
+    [PPC_PLATFORM_POWER5_PLUS] = "power5+",
+    [PPC_PLATFORM_POWER6] = "power6",
+    [PPC_PLATFORM_CELL_BE] = "ppc-cell-be",
+    [PPC_PLATFORM_POWER6X] = "power6x"
   }
 #endif
 #if !defined SHARED || defined PROCINFO_DECL

Modified: trunk/libc/sysdeps/powerpc/dl-procinfo.h
==============================================================================
--- trunk/libc/sysdeps/powerpc/dl-procinfo.h (original)
+++ trunk/libc/sysdeps/powerpc/dl-procinfo.h Tue Jan  9 05:36:33 2007
@@ -24,18 +24,28 @@
 #include <sysdep.h>		/* This defines the PPC_FEATURE_* macros.  */
 
 /* There are 20 bits used, but they are bits 12..31.  */
-#define _DL_HWCAP_FIRST		12
+#define _DL_HWCAP_FIRST		9
 #define _DL_HWCAP_COUNT		32
 
 /* These bits influence library search.  */
-#define HWCAP_IMPORTANT		(PPC_FEATURE_HAS_ALTIVEC)
+#define HWCAP_IMPORTANT		(PPC_FEATURE_HAS_ALTIVEC \
+				+ PPC_FEATURE_HAS_DFP)
 
-#define _DL_PLATFORMS_COUNT	6
+#define _DL_PLATFORMS_COUNT	7
 
 #define _DL_FIRST_PLATFORM      32
 /* Mask to filter out platforms.  */
 #define _DL_HWCAP_PLATFORM      (((1ULL << _DL_PLATFORMS_COUNT) - 1) \
                                  << _DL_FIRST_PLATFORM)
+
+/* Platform bits (relative to _DL_FIRST_PLATFORM).  */
+#define PPC_PLATFORM_POWER4		0
+#define PPC_PLATFORM_PPC970		1
+#define PPC_PLATFORM_POWER5		2
+#define PPC_PLATFORM_POWER5_PLUS	3
+#define PPC_PLATFORM_POWER6		4
+#define PPC_PLATFORM_CELL_BE		5
+#define PPC_PLATFORM_POWER6X		6
 
 static inline const char *
 __attribute__ ((unused))
@@ -68,22 +78,30 @@
   if (str == NULL)
     return -1;
 
-  if (strncmp (str, GLRO(dl_powerpc_platforms)[0], 5) == 0)
+  if (strncmp (str, GLRO(dl_powerpc_platforms)[PPC_PLATFORM_POWER4], 5) == 0)
     {
       int ret;
       str += 5;
       switch (*str)
 	{
 	case '4':
-	  ret = _DL_FIRST_PLATFORM + 0;
+	  ret = _DL_FIRST_PLATFORM + PPC_PLATFORM_POWER4;
 	  break;
 	case '5':
-	  ret = _DL_FIRST_PLATFORM + 2;
+	  ret = _DL_FIRST_PLATFORM + PPC_PLATFORM_POWER5;
 	  if (str[1] == '+')
-	    ++ret, ++str;
+	    {
+	      ret = _DL_FIRST_PLATFORM + PPC_PLATFORM_POWER5_PLUS;
+	      ++str;
+	    }
 	  break;
 	case '6':
-	  ret = _DL_FIRST_PLATFORM + 4;
+	  ret = _DL_FIRST_PLATFORM + PPC_PLATFORM_POWER6;
+	  if (str[1] == 'x')
+	    {
+	      ret = _DL_FIRST_PLATFORM + PPC_PLATFORM_POWER6X;
+	      ++str;
+	    }
 	  break;
 	default:
 	  return -1;
@@ -91,12 +109,16 @@
       if (str[1] == '\0')
 	return ret;
     }
-  else if (strncmp (str, GLRO(dl_powerpc_platforms)[1], 3) == 0)
+  else if (strncmp (str, GLRO(dl_powerpc_platforms)[PPC_PLATFORM_PPC970],
+		    3) == 0)
     {
-      if (strcmp (str + 3, GLRO(dl_powerpc_platforms)[1] + 3) == 0)
-	return _DL_FIRST_PLATFORM + 1;
-      else if (strcmp (str + 3, GLRO(dl_powerpc_platforms)[5] + 3) == 0)
-	return _DL_FIRST_PLATFORM + 5;
+      if (strcmp (str + 3, GLRO(dl_powerpc_platforms)[PPC_PLATFORM_PPC970]
+			   + 3) == 0)
+	return _DL_FIRST_PLATFORM + PPC_PLATFORM_PPC970;
+      else if (strcmp (str + 3,
+		       GLRO(dl_powerpc_platforms)[PPC_PLATFORM_CELL_BE] + 3)
+	       == 0)
+	return _DL_FIRST_PLATFORM + PPC_PLATFORM_CELL_BE;
     }
 
   return -1;

Modified: trunk/libc/sysdeps/powerpc/sysdep.h
==============================================================================
--- trunk/libc/sysdeps/powerpc/sysdep.h (original)
+++ trunk/libc/sysdeps/powerpc/sysdep.h Tue Jan  9 05:36:33 2007
@@ -34,13 +34,16 @@
 #define PPC_FEATURE_HAS_EFP_DOUBLE	0x00200000 /* SPE Double.  */
 #define PPC_FEATURE_NO_TB		0x00100000 /* 601/403gx have no timebase */
 #define PPC_FEATURE_POWER4		0x00080000 /* POWER4 ISA 2.00 */
-#define PPC_FEATURE_POWER5		0x00040000 /* POWER5 ISA 2.01 */
-#define PPC_FEATURE_POWER5_PLUS		0x00020000 /* POWER5+ ISA 2.02 */
+#define PPC_FEATURE_POWER5		0x00040000 /* POWER5 ISA 2.02 */
+#define PPC_FEATURE_POWER5_PLUS		0x00020000 /* POWER5+ ISA 2.03 */
 #define PPC_FEATURE_CELL_BE		0x00010000 /* CELL Broadband Engine */
 #define PPC_FEATURE_BOOKE		0x00008000
-#define PPC_FEATURE_SMT			0x00004000
+#define PPC_FEATURE_SMT			0x00004000 /* Simultaneous Multi-Threading */
 #define PPC_FEATURE_ICACHE_SNOOP	0x00002000
 #define PPC_FEATURE_ARCH_2_05		0x00001000 /* ISA 2.05 */
+#define PPC_FEATURE_PA6T		0x00000800 /* PA Semi 6T Core */
+#define PPC_FEATURE_HAS_DFP		0x00000400 /* Decimal FP Unit */
+#define PPC_FEATURE_POWER6_EXT		0x00000200 /* P6 + mffgpr/mftgpr */
 #define PPC_FEATURE_970 (PPC_FEATURE_POWER4 + PPC_FEATURE_HAS_ALTIVEC)
 
 #ifdef __ASSEMBLER__

Modified: trunk/libc/sysdeps/unix/sysv/linux/bits/statvfs.h
==============================================================================
--- trunk/libc/sysdeps/unix/sysv/linux/bits/statvfs.h (original)
+++ trunk/libc/sysdeps/unix/sysv/linux/bits/statvfs.h Tue Jan  9 05:36:33 2007
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998, 2000, 2001, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1997,1998,2000,2001,2002,2006 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
@@ -101,7 +101,9 @@
 # define ST_IMMUTABLE	ST_IMMUTABLE
   ST_NOATIME = 1024,		/* Do not update access times.  */
 # define ST_NOATIME	ST_NOATIME
-  ST_NODIRATIME = 2048		/* Do not update directory access times.  */
+  ST_NODIRATIME = 2048,		/* Do not update directory access times.  */
 # define ST_NODIRATIME	ST_NODIRATIME
+  ST_RELATIME = 4096		/* Update atime relative to mtime/ctime.  */
+# define ST_RELATIME	ST_RELATIME
 #endif	/* Use GNU.  */
 };

Modified: trunk/libc/sysdeps/unix/sysv/linux/internal_statvfs.c
==============================================================================
--- trunk/libc/sysdeps/unix/sysv/linux/internal_statvfs.c (original)
+++ trunk/libc/sysdeps/unix/sysv/linux/internal_statvfs.c Tue Jan  9 05:36:33 2007
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2003, 2004, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2003, 2004, 2005, 2006 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1998.
 
@@ -156,6 +156,8 @@
 		  result |= ST_NOATIME;
 		else if (strcmp (opt, "nodiratime") == 0)
 		  result |= ST_NODIRATIME;
+		else if (strcmp (opt, "relatime") == 0)
+		  result |= ST_RELATIME;
 
 	      /* We can stop looking for more entries.  */
 	      success = true;

Modified: trunk/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/makecontext.S
==============================================================================
--- trunk/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/makecontext.S (original)
+++ trunk/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/makecontext.S Tue Jan  9 05:36:33 2007
@@ -26,9 +26,7 @@
 
 ENTRY(__makecontext)
 	/* Set up the first 7 args to the function in its registers */
-	addi	r11,r3,_UC_REG_SPACE+12
-	clrrwi  r11,r11,4
-	stw	r11,_UC_REGS_PTR(r3)
+	lwz	r11,_UC_REGS_PTR(r3)
 	stw	r6,_UC_GREGS+(PT_R3*4)(r11)
 	stw	r7,_UC_GREGS+(PT_R4*4)(r11)
 	stw	r8,_UC_GREGS+(PT_R5*4)(r11)

Modified: trunk/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext.S
==============================================================================
--- trunk/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext.S (original)
+++ trunk/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext.S Tue Jan  9 05:36:33 2007
@@ -1,5 +1,5 @@
 /* Jump to a new context.
-   Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2004, 2005, 2006 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
@@ -20,6 +20,7 @@
 #include <sysdep.h>
 #include <rtld-global-offsets.h>
 #include <shlib-compat.h>
+#include <kernel-features.h>
 
 #define __ASSEMBLY__
 #include <asm/ptrace.h>

Modified: trunk/libc/sysdeps/unix/sysv/linux/ttyname.c
==============================================================================
--- trunk/libc/sysdeps/unix/sysv/linux/ttyname.c (original)
+++ trunk/libc/sysdeps/unix/sysv/linux/ttyname.c Tue Jan  9 05:36:33 2007
@@ -22,6 +22,7 @@
 #include <dirent.h>
 #include <sys/types.h>
 #include <sys/stat.h>
+#include <termios.h>
 #include <unistd.h>
 #include <string.h>
 #include <stdlib.h>
@@ -118,12 +119,12 @@
   int dostat = 0;
   char *name;
   int save = errno;
-
-  if (__builtin_expect (!__isatty (fd), 0))
-    {
-      __set_errno (ENOTTY);
-      return NULL;
-    }
+  struct termios term;
+
+  /* isatty check, tcgetattr is used because it sets the correct
+     errno (EBADF resp. ENOTTY) on error.  */
+  if (__builtin_expect (__tcgetattr (fd, &term) < 0, 0))
+    return NULL;
 
   /* We try using the /proc filesystem.  */
   *_fitoa_word (fd, __stpcpy (procname, "/proc/self/fd/"), 10, 0) = '\0';

Modified: trunk/libc/sysdeps/unix/sysv/linux/ttyname_r.c
==============================================================================
--- trunk/libc/sysdeps/unix/sysv/linux/ttyname_r.c (original)
+++ trunk/libc/sysdeps/unix/sysv/linux/ttyname_r.c Tue Jan  9 05:36:33 2007
@@ -22,6 +22,7 @@
 #include <dirent.h>
 #include <sys/types.h>
 #include <sys/stat.h>
+#include <termios.h>
 #include <unistd.h>
 #include <string.h>
 #include <stdlib.h>
@@ -115,11 +116,11 @@
       return ERANGE;
     }
 
-  if (__builtin_expect (!__isatty (fd), 0))
-    {
-      __set_errno (ENOTTY);
-      return ENOTTY;
-    }
+  /* isatty check, tcgetattr is used because it sets the correct
+     errno (EBADF resp. ENOTTY) on error.  */
+  struct termios term;
+  if (__builtin_expect (__tcgetattr (fd, &term) < 0, 0))
+    return errno;
 
   /* We try using the /proc filesystem.  */
   *_fitoa_word (fd, __stpcpy (procname, "/proc/self/fd/"), 10, 0) = '\0';

Modified: trunk/ports/ChangeLog.arm
==============================================================================
--- trunk/ports/ChangeLog.arm (original)
+++ trunk/ports/ChangeLog.arm Tue Jan  9 05:36:33 2007
@@ -1,3 +1,17 @@
+2007-01-08  Daniel Jacobowitz  <dan@xxxxxxxxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/arm/check_pf.c: New file.
+	* sysdeps/unix/sysv/linux/arm/eabi/check_pf.c: New file.
+
+2007-01-08  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
+
+	* sysdeps/arm/fpu/bits/mathdef.h: Move to
+	sysdeps/arm/bits/mathdef.h.  Remove comment about FPA.
+
+2007-01-08  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
+
+	* sysdeps/arm/eabi/jmpbuf-offsets.h: New.
+
 2006-10-31  Daniel Jacobowitz  <dan@xxxxxxxxxxxxxxxx>
 
 	* sysdeps/unix/sysv/linux/arm/eabi/nptl/sysdep-cancel.h

Modified: trunk/ports/ChangeLog.mips
==============================================================================
--- trunk/ports/ChangeLog.mips (original)
+++ trunk/ports/ChangeLog.mips Tue Jan  9 05:36:33 2007
@@ -1,3 +1,28 @@
+2007-01-08  Richard Sandiford  <richard@xxxxxxxxxxxxxxxx>
+
+	* sysdeps/mips/dl-machine.h (ELF_MACHINE_NO_RELA): Delete.
+	(elf_machine_reloc): New function, retaining the body of
+	elf_machine_rel.  Take the reloc's r_info field as an argument,
+	not the reloc itself.  Add extra r_addend and inplace_p arguments.
+	When inplace_p is false, use r_addend as the addend, not the contents
+	of the relocation field.  Hoist the conversion of reloc_addr to
+	"ELFW(Addr) *".  Don't try to apply TLS relocations against
+	undefined symbols.  Add R_MIPS_GLOB_DAT support.
+	(elf_machine_rel, elf_machine_rela): Use elf_machine_reloc.
+	(elf_machine_lazy_rel): Change the reloc type from ElfW(Rel)
+	to ElfW(Rela).
+
+2007-01-08  Daniel Jacobowitz  <dan@xxxxxxxxxxxxxxxx>
+
+	* sysdeps/mips/ldsodefs.h: Merge sysdeps/mips/elf/ldsodefs.h.  Correct
+	multiple inclusion guard.
+	* sysdeps/mips/elf/ldsodefs.h: Delete file.
+
+2007-01-04  Thiemo Seufer  <ths@xxxxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/mips/bits/msq.h (struct msqid_ds): Update
+	to match the kernel.
+
 2006-10-31  Daniel Jacobowitz  <dan@xxxxxxxxxxxxxxxx>
 
 	* sysdeps/unix/sysv/linux/mips/nptl/sysdep-cancel.h

Modified: trunk/ports/ChangeLog.powerpc
==============================================================================
--- trunk/ports/ChangeLog.powerpc (original)
+++ trunk/ports/ChangeLog.powerpc Tue Jan  9 05:36:33 2007
@@ -1,3 +1,8 @@
+2007-01-08  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
+
+	* sysdeps/powerpc/nofpu/fesetenv.c (__sim_exceptions,
+	__sim_disabled_exceptions, __sim_round_mode): Remove declarations.
+
 2006-10-05  Steven Munroe  <sjmunroe@xxxxxxxxxx>
 
 	[BZ #2749]

Modified: trunk/ports/sysdeps/arm/bits/mathdef.h
==============================================================================
--- trunk/ports/sysdeps/arm/bits/mathdef.h (original)
+++ trunk/ports/sysdeps/arm/bits/mathdef.h Tue Jan  9 05:36:33 2007
@@ -1,4 +1,5 @@
-/* Copyright (C) 1999, 2000, 2004, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1999, 2000, 2004, 2006, 2007
+   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

Modified: trunk/ports/sysdeps/arm/eabi/jmpbuf-offsets.h
==============================================================================
--- trunk/ports/sysdeps/arm/eabi/jmpbuf-offsets.h (original)
+++ trunk/ports/sysdeps/arm/eabi/jmpbuf-offsets.h Tue Jan  9 05:36:33 2007
@@ -1,5 +1,5 @@
 /* Private macros for accessing __jmp_buf contents.  ARM EABI version.
-   Copyright (C) 2006 Free Software Foundation, Inc.
+   Copyright (C) 2007 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

Modified: trunk/ports/sysdeps/mips/dl-machine.h
==============================================================================
--- trunk/ports/sysdeps/mips/dl-machine.h (original)
+++ trunk/ports/sysdeps/mips/dl-machine.h Tue Jan  9 05:36:33 2007
@@ -1,5 +1,5 @@
 /* Machine-dependent ELF dynamic relocation inline functions.  MIPS version.
-   Copyright (C) 1996-2001, 2002, 2003, 2004, 2005, 2006
+   Copyright (C) 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Kazumoto Kojima <kkojima@xxxxxxxxxxxxxxxxxxxxx>.
@@ -282,9 +282,6 @@
 	".previous"\
 );
 
-/* The MIPS never uses Elfxx_Rela relocations.  */
-#define ELF_MACHINE_NO_RELA 1
-
 /* Names of the architecture-specific auditing callback functions.  */
 # if _MIPS_SIM == _ABIO32
 #  define ARCH_LA_PLTENTER mips_o32_gnu_pltenter
@@ -301,16 +298,18 @@
 
 #ifdef RESOLVE_MAP
 
-/* Perform the relocation specified by RELOC and SYM (which is fully resolved).
+/* Perform a relocation described by R_INFO at the location pointed to
+   by RELOC_ADDR.  SYM is the relocation symbol specified by R_INFO and
    MAP is the object containing the reloc.  */
 
 auto inline void
 __attribute__ ((always_inline))
-elf_machine_rel (struct link_map *map, const ElfW(Rel) *reloc,
-		 const ElfW(Sym) *sym, const struct r_found_version *version,
-		 void *const reloc_addr)
-{
-  const unsigned long int r_type = ELFW(R_TYPE) (reloc->r_info);
+elf_machine_reloc (struct link_map *map, ElfW(Word) r_info,
+		   const ElfW(Sym) *sym, const struct r_found_version *version,
+		   void *reloc_addr, ElfW(Addr) r_addend, int inplace_p)
+{
+  const unsigned long int r_type = ELFW(R_TYPE) (r_info);
+  ElfW(Addr) *addr_field = (ElfW(Addr) *) reloc_addr;
 
 #if !defined RTLD_BOOTSTRAP && !defined SHARED
   /* This is defined in rtld.c, but nowhere in the static libc.a;
@@ -342,18 +341,28 @@
 	  case R_MIPS_TLS_DTPMOD64:
 	  case R_MIPS_TLS_DTPMOD32:
 	    if (sym_map)
-	      *(ElfW(Addr) *)reloc_addr = sym_map->l_tls_modid;
+	      *addr_field = sym_map->l_tls_modid;
 	    break;
 
 	  case R_MIPS_TLS_DTPREL64:
 	  case R_MIPS_TLS_DTPREL32:
-	    *(ElfW(Addr) *)reloc_addr += TLS_DTPREL_VALUE (sym);
+	    if (sym)
+	      {
+		if (inplace_p)
+		  r_addend = *addr_field;
+		*addr_field = r_addend + TLS_DTPREL_VALUE (sym);
+	      }
 	    break;
 
 	  case R_MIPS_TLS_TPREL32:
 	  case R_MIPS_TLS_TPREL64:
-	    CHECK_STATIC_TLS (map, sym_map);
-	    *(ElfW(Addr) *)reloc_addr += TLS_TPREL_VALUE (sym_map, sym);
+	    if (sym)
+	      {
+		CHECK_STATIC_TLS (map, sym_map);
+		if (inplace_p)
+		  r_addend = *addr_field;
+		*addr_field = r_addend + TLS_TPREL_VALUE (sym_map, sym);
+	      }
 	    break;
 	  }
 
@@ -367,13 +376,14 @@
     case R_MIPS_REL32:
 #endif
       {
-	int symidx = ELFW(R_SYM) (reloc->r_info);
+	int symidx = ELFW(R_SYM) (r_info);
 	ElfW(Addr) reloc_value;
 
-	/* Support relocations on mis-aligned offsets.  Should we ever
-	   implement RELA, this should be replaced with an assignment
-	   from reloc->r_addend.  */
-	__builtin_memcpy (&reloc_value, reloc_addr, sizeof (reloc_value));
+	if (inplace_p)
+	  /* Support relocations on mis-aligned offsets.  */
+	  __builtin_memcpy (&reloc_value, reloc_addr, sizeof (reloc_value));
+	else
+	  reloc_value = r_addend;
 
 	if (symidx)
 	  {
@@ -424,6 +434,31 @@
 	__builtin_memcpy (reloc_addr, &reloc_value, sizeof (reloc_value));
       }
       break;
+#ifndef RTLD_BOOTSTRAP
+#if _MIPS_SIM == _ABI64
+    case (R_MIPS_64 << 8) | R_MIPS_GLOB_DAT:
+#else
+    case R_MIPS_GLOB_DAT:
+#endif
+      {
+	int symidx = ELFW(R_SYM) (r_info);
+	const ElfW(Word) gotsym
+	  = (const ElfW(Word)) map->l_info[DT_MIPS (GOTSYM)]->d_un.d_val;
+
+	if (__builtin_expect ((ElfW(Word)) symidx >= gotsym, 1))
+	  {
+	    const ElfW(Addr) *got
+	      = (const ElfW(Addr) *) D_PTR (map, l_info[DT_PLTGOT]);
+	    const ElfW(Word) local_gotno
+	      = ((const ElfW(Word))
+		 map->l_info[DT_MIPS (LOCAL_GOTNO)]->d_un.d_val);
+
+	    ElfW(Addr) reloc_value = got[symidx + local_gotno - gotsym];
+	    __builtin_memcpy (reloc_addr, &reloc_value, sizeof (reloc_value));
+	  }
+      }
+      break;
+#endif
     case R_MIPS_NONE:		/* Alright, Wilbur.  */
       break;
 #if _MIPS_SIM == _ABI64
@@ -436,7 +471,7 @@
 	 itself.  For ABI compliance, we ignore such _64 dummy
 	 relocations.  For RELA, this may be simply removed, since
 	 it's totally unnecessary.  */
-      if (ELFW(R_SYM) (reloc->r_info) == 0)
+      if (ELFW(R_SYM) (r_info) == 0)
 	break;
       /* Fall through.  */
 #endif
@@ -446,6 +481,18 @@
     }
 }
 
+/* Perform the relocation specified by RELOC and SYM (which is fully resolved).
+   MAP is the object containing the reloc.  */
+
+auto inline void
+__attribute__ ((always_inline))
+elf_machine_rel (struct link_map *map, const ElfW(Rel) *reloc,
+		 const ElfW(Sym) *sym, const struct r_found_version *version,
+		 void *const reloc_addr)
+{
+  elf_machine_reloc (map, reloc->r_info, sym, version, reloc_addr, 0, 1);
+}
+
 auto inline void
 __attribute__((always_inline))
 elf_machine_rel_relative (ElfW(Addr) l_addr, const ElfW(Rel) *reloc,
@@ -457,7 +504,7 @@
 auto inline void
 __attribute__((always_inline))
 elf_machine_lazy_rel (struct link_map *map,
-		      ElfW(Addr) l_addr, const ElfW(Rel) *reloc)
+		      ElfW(Addr) l_addr, const ElfW(Rela) *reloc)
 {
   /* Do nothing.  */
 }
@@ -468,6 +515,8 @@
 		  const ElfW(Sym) *sym, const struct r_found_version *version,
 		 void *const reloc_addr)
 {
+  elf_machine_reloc (map, reloc->r_info, sym, version, reloc_addr,
+		     reloc->r_addend, 0);
 }
 
 auto inline void

Modified: trunk/ports/sysdeps/mips/ldsodefs.h
==============================================================================
--- trunk/ports/sysdeps/mips/ldsodefs.h (original)
+++ trunk/ports/sysdeps/mips/ldsodefs.h Tue Jan  9 05:36:33 2007
@@ -1,5 +1,5 @@
 /* Run-time dynamic linker data structures for loaded ELF shared objects.
-   Copyright (C) 2006 Free Software Foundation, Inc.
+   Copyright (C) 2000, 2002, 2003, 2006, 2007 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
@@ -17,7 +17,7 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
-#ifndef __LDSODEFS_H \
+#ifndef _MIPS_LDSODEFS_H
 #define _MIPS_LDSODEFS_H 1
 
 #include <elf.h>
@@ -61,6 +61,90 @@
 					  struct La_mips_64_retval *,	    \
 					  const char *);
 
+/* The MIPS ABI specifies that the dynamic section has to be read-only.  */
+
+#define DL_RO_DYN_SECTION 1
+
 #include_next <ldsodefs.h>
 
+/* The 64-bit MIPS ELF ABI uses an unusual reloc format.  Each
+   relocation entry specifies up to three actual relocations, all at
+   the same address.  The first relocation which required a symbol
+   uses the symbol in the r_sym field.  The second relocation which
+   requires a symbol uses the symbol in the r_ssym field.  If all
+   three relocations require a symbol, the third one uses a zero
+   value.
+
+   We define these structures in internal headers because we're not
+   sure we want to make them part of the ABI yet.  Eventually, some of
+   this may move into elf/elf.h.  */
+
+/* An entry in a 64 bit SHT_REL section.  */
+
+typedef struct
+{
+  Elf32_Word    r_sym;		/* Symbol index */
+  unsigned char r_ssym;		/* Special symbol for 2nd relocation */
+  unsigned char r_type3;	/* 3rd relocation type */
+  unsigned char r_type2;	/* 2nd relocation type */
+  unsigned char r_type1;	/* 1st relocation type */
+} _Elf64_Mips_R_Info;
+
+typedef union
+{
+  Elf64_Xword	r_info_number;
+  _Elf64_Mips_R_Info r_info_fields;
+} _Elf64_Mips_R_Info_union;
+
+typedef struct
+{
+  Elf64_Addr	r_offset;		/* Address */
+  _Elf64_Mips_R_Info_union r_info;	/* Relocation type and symbol index */
+} Elf64_Mips_Rel;
+
+typedef struct
+{
+  Elf64_Addr	r_offset;		/* Address */
+  _Elf64_Mips_R_Info_union r_info;	/* Relocation type and symbol index */
+  Elf64_Sxword	r_addend;		/* Addend */
+} Elf64_Mips_Rela;
+
+#define ELF64_MIPS_R_SYM(i) \
+  ((__extension__ (_Elf64_Mips_R_Info_union)(i)).r_info_fields.r_sym)
+#define ELF64_MIPS_R_TYPE(i) \
+  (((_Elf64_Mips_R_Info_union)(i)).r_info_fields.r_type1 \
+   | ((Elf32_Word)(__extension__ (_Elf64_Mips_R_Info_union)(i) \
+		   ).r_info_fields.r_type2 << 8) \
+   | ((Elf32_Word)(__extension__ (_Elf64_Mips_R_Info_union)(i) \
+		   ).r_info_fields.r_type3 << 16) \
+   | ((Elf32_Word)(__extension__ (_Elf64_Mips_R_Info_union)(i) \
+		   ).r_info_fields.r_ssym << 24))
+#define ELF64_MIPS_R_INFO(sym, type) \
+  (__extension__ (_Elf64_Mips_R_Info_union) \
+   (__extension__ (_Elf64_Mips_R_Info) \
+   { (sym), ELF64_MIPS_R_SSYM (type), \
+       ELF64_MIPS_R_TYPE3 (type), \
+       ELF64_MIPS_R_TYPE2 (type), \
+       ELF64_MIPS_R_TYPE1 (type) \
+   }).r_info_number)
+/* These macros decompose the value returned by ELF64_MIPS_R_TYPE, and
+   compose it back into a value that it can be used as an argument to
+   ELF64_MIPS_R_INFO.  */
+#define ELF64_MIPS_R_SSYM(i) (((i) >> 24) & 0xff)
+#define ELF64_MIPS_R_TYPE3(i) (((i) >> 16) & 0xff)
+#define ELF64_MIPS_R_TYPE2(i) (((i) >> 8) & 0xff)
+#define ELF64_MIPS_R_TYPE1(i) ((i) & 0xff)
+#define ELF64_MIPS_R_TYPEENC(type1, type2, type3, ssym) \
+  ((type1) \
+   | ((Elf32_Word)(type2) << 8) \
+   | ((Elf32_Word)(type3) << 16) \
+   | ((Elf32_Word)(ssym) << 24))
+
+#undef ELF64_R_SYM
+#define ELF64_R_SYM(i) ELF64_MIPS_R_SYM (i)
+#undef ELF64_R_TYPE
+#define ELF64_R_TYPE(i) ELF64_MIPS_R_TYPE (i)
+#undef ELF64_R_INFO
+#define ELF64_R_INFO(sym, type) ELF64_MIPS_R_INFO ((sym), (type))
+
 #endif

Modified: trunk/ports/sysdeps/unix/sysv/linux/mips/bits/msq.h
==============================================================================
--- trunk/ports/sysdeps/unix/sysv/linux/mips/bits/msq.h (original)
+++ trunk/ports/sysdeps/unix/sysv/linux/mips/bits/msq.h Tue Jan  9 05:36:33 2007
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2007 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
@@ -38,16 +38,34 @@
 struct msqid_ds
 {
   struct ipc_perm msg_perm;	/* structure describing operation permission */
+#if __WORDSIZE == 32 && defined (__MIPSEB__)
+  unsigned long int __unused1;
+#endif
   __time_t msg_stime;		/* time of last msgsnd command */
+#if __WORDSIZE == 32 && defined (__MIPSEL__)
+  unsigned long int __unused1;
+#endif
+#if __WORDSIZE == 32 && defined (__MIPSEB__)
+  unsigned long int __unused2;
+#endif
   __time_t msg_rtime;		/* time of last msgrcv command */
+#if __WORDSIZE == 32 && defined (__MIPSEL__)
+  unsigned long int __unused2;
+#endif
+#if __WORDSIZE == 32 && defined (__MIPSEB__)
+  unsigned long int __unused3;
+#endif
   __time_t msg_ctime;		/* time of last change */
+#if __WORDSIZE == 32 && defined (__MIPSEL__)
+  unsigned long int __unused3;
+#endif
   unsigned long int __msg_cbytes; /* current number of bytes on queue */
   msgqnum_t msg_qnum;		/* number of messages currently on queue */
   msglen_t msg_qbytes;		/* max number of bytes allowed on queue */
   __pid_t msg_lspid;		/* pid of last msgsnd() */
   __pid_t msg_lrpid;		/* pid of last msgrcv() */
-  unsigned long int __unused1;
-  unsigned long int __unused2;
+  unsigned long int __unused4;
+  unsigned long int __unused5;
 };
 
 #ifdef __USE_MISC