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

[commits] r9380 - in /branches/eglibc-2_11: libc/ libc/libio/ libc/sysdeps/ia64/ libc/sysdeps/unix/sysv/linux/ libc/sysdeps/unix/sysv/...



Author: joseph
Date: Mon Nov 30 17:42:59 2009
New Revision: 9380

Log:
Merge changes between r9302 and r9379 from /fsf/glibc-2_11-branch.

Added:
    branches/eglibc-2_11/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/sync_file_range.c
      - copied unchanged from r9379, fsf/glibc-2_11-branch/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/sync_file_range.c
    branches/eglibc-2_11/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/posix_fadvise.c
      - copied unchanged from r9379, fsf/glibc-2_11-branch/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/posix_fadvise.c
    branches/eglibc-2_11/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/posix_fadvise.c
      - copied unchanged from r9379, fsf/glibc-2_11-branch/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/posix_fadvise.c
    branches/eglibc-2_11/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/posix_fadvise64.c
      - copied unchanged from r9379, fsf/glibc-2_11-branch/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/posix_fadvise64.c
Modified:
    branches/eglibc-2_11/libc/ChangeLog
    branches/eglibc-2_11/libc/libio/libio.h
    branches/eglibc-2_11/libc/sysdeps/ia64/memchr.S
    branches/eglibc-2_11/libc/sysdeps/unix/sysv/linux/bits/sched.h
    branches/eglibc-2_11/libc/sysdeps/unix/sysv/linux/sync_file_range.c
    branches/eglibc-2_11/ports/ChangeLog.arm
    branches/eglibc-2_11/ports/ChangeLog.mips
    branches/eglibc-2_11/ports/sysdeps/mips/dl-lookup.c
    branches/eglibc-2_11/ports/sysdeps/unix/sysv/linux/arm/kernel-features.h
    branches/eglibc-2_11/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list

Modified: branches/eglibc-2_11/libc/ChangeLog
==============================================================================
--- branches/eglibc-2_11/libc/ChangeLog (original)
+++ branches/eglibc-2_11/libc/ChangeLog Mon Nov 30 17:42:59 2009
@@ -1,3 +1,30 @@
+2009-11-18  H.J. Lu  <hongjiu.lu@xxxxxxxxx>
+
+	[BZ #10162]
+	* sysdeps/ia64/memchr.S: Don't use a simple loop on data shorter
+	than software pipeline.  Properly recover from shorter read.
+
+2009-11-16  Jakub Jelinek  <jakub@xxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/sync_file_range.c (sync_file_range):
+	Implement using sync_file_range2 syscall if __NR_sync_file_range2
+	is defined.
+	* sysdeps/unix/sysv/linux/powerpc/powerpc64/sync_file_range.c: New
+	file.
+
+2009-11-19  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	[BZ #10958]
+	* libio/libio.h (_IO_getwc_unlocked): Check for _wide_data being
+	initialized before using it.
+	(_IO_putwc_unlocked): Likewise.
+
+	[BZ #10918]
+	* sysdeps/unix/sysv/linux/bits/sched.h (__CPU_ISSET_S): Use __const
+	in cast to not throw away const-ness of parameters.
+	(__CPU_EQUAL_S): Likewise.
+	(__CPU_OP_S): Likewise.
+
 2009-11-17  Paolo Bonzini  <bonzini@xxxxxxx>
 
 	* posix/bug-regex30.c: New file.

Modified: branches/eglibc-2_11/libc/libio/libio.h
==============================================================================
--- branches/eglibc-2_11/libc/libio/libio.h (original)
+++ branches/eglibc-2_11/libc/libio/libio.h Mon Nov 30 17:42:59 2009
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-1995,1997-2006,2007 Free Software Foundation, Inc.
+/* Copyright (C) 1991-1995,1997-2006,2007,2009 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Written by Per Bothner <bothner@xxxxxxxxxx>.
 
@@ -442,13 +442,15 @@
 
 #if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
 # define _IO_getwc_unlocked(_fp) \
-  (_IO_BE ((_fp)->_wide_data->_IO_read_ptr >= (_fp)->_wide_data->_IO_read_end,\
-	   0) \
+  (_IO_BE ((_fp)->_wide_data == NULL					\
+	   || ((_fp)->_wide_data->_IO_read_ptr				\
+	       >= (_fp)->_wide_data->_IO_read_end), 0)			\
    ? __wuflow (_fp) : (_IO_wint_t) *(_fp)->_wide_data->_IO_read_ptr++)
 # define _IO_putwc_unlocked(_wch, _fp) \
-  (_IO_BE ((_fp)->_wide_data->_IO_write_ptr \
-	   >= (_fp)->_wide_data->_IO_write_end, 0) \
-   ? __woverflow (_fp, _wch) \
+  (_IO_BE ((_fp)->_wide_data == NULL					\
+	   || ((_fp)->_wide_data->_IO_write_ptr				\
+	       >= (_fp)->_wide_data->_IO_write_end), 0)			\
+   ? __woverflow (_fp, _wch)						\
    : (_IO_wint_t) (*(_fp)->_wide_data->_IO_write_ptr++ = (_wch)))
 #endif
 

Modified: branches/eglibc-2_11/libc/sysdeps/ia64/memchr.S
==============================================================================
--- branches/eglibc-2_11/libc/sysdeps/ia64/memchr.S (original)
+++ branches/eglibc-2_11/libc/sysdeps/ia64/memchr.S Mon Nov 30 17:42:59 2009
@@ -126,7 +126,16 @@
 	br.ret.sptk.many b0
 
 .recovery:
-	adds	ret0 = -((MEMLAT + 1) * 8), ret0;;
+#if MEMLAT != 6
+# error "MEMLAT must be 6!"
+#endif
+(p[MEMLAT-6])	add	ret0 = -8, ret0;;
+(p[MEMLAT-5])	add	ret0 = -8, ret0;;
+(p[MEMLAT-4])	add	ret0 = -8, ret0;;
+(p[MEMLAT-3])	add	ret0 = -8, ret0;;
+(p[MEMLAT-2])	add	ret0 = -8, ret0;;
+(p[MEMLAT-1])	add	ret0 = -8, ret0;;
+(p[MEMLAT])	add	ret0 = -8, ret0;;
 (p[MEMLAT+1])	add	ret0 = -8, ret0;;
 (p[MEMLAT+2])	add	ret0 = -8, ret0;;
 .l4:

Modified: branches/eglibc-2_11/libc/sysdeps/unix/sysv/linux/bits/sched.h
==============================================================================
--- branches/eglibc-2_11/libc/sysdeps/unix/sysv/linux/bits/sched.h (original)
+++ branches/eglibc-2_11/libc/sysdeps/unix/sysv/linux/bits/sched.h Mon Nov 30 17:42:59 2009
@@ -1,6 +1,6 @@
 /* Definitions of constants and data structure for POSIX 1003.1b-1993
    scheduling interface.
-   Copyright (C) 1996-1999,2001-2003,2005,2006,2007,2008
+   Copyright (C) 1996-1999,2001-2003,2005,2006,2007,2008,2009
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -154,7 +154,7 @@
   (__extension__							      \
    ({ size_t __cpu = (cpu);						      \
       __cpu < 8 * (setsize)						      \
-      ? ((((__cpu_mask *) ((cpusetp)->__bits))[__CPUELT (__cpu)]	      \
+      ? ((((__const __cpu_mask *) ((cpusetp)->__bits))[__CPUELT (__cpu)]      \
 	  & __CPUMASK (__cpu))) != 0					      \
       : 0; }))
 
@@ -167,8 +167,8 @@
 # else
 #  define __CPU_EQUAL_S(setsize, cpusetp1, cpusetp2) \
   (__extension__							      \
-   ({ __cpu_mask *__arr1 = (cpusetp1)->__bits;				      \
-      __cpu_mask *__arr2 = (cpusetp2)->__bits;				      \
+   ({ __const __cpu_mask *__arr1 = (cpusetp1)->__bits;			      \
+      __const __cpu_mask *__arr2 = (cpusetp2)->__bits;			      \
       size_t __imax = (setsize) / sizeof (__cpu_mask);			      \
       size_t __i;							      \
       for (__i = 0; __i < __imax; ++__i)				      \
@@ -180,8 +180,8 @@
 # define __CPU_OP_S(setsize, destset, srcset1, srcset2, op) \
   (__extension__							      \
    ({ cpu_set_t *__dest = (destset);					      \
-      __cpu_mask *__arr1 = (srcset1)->__bits;				      \
-      __cpu_mask *__arr2 = (srcset2)->__bits;				      \
+      __const __cpu_mask *__arr1 = (srcset1)->__bits;			      \
+      __const __cpu_mask *__arr2 = (srcset2)->__bits;			      \
       size_t __imax = (setsize) / sizeof (__cpu_mask);			      \
       size_t __i;							      \
       for (__i = 0; __i < __imax; ++__i)				      \

Modified: branches/eglibc-2_11/libc/sysdeps/unix/sysv/linux/sync_file_range.c
==============================================================================
--- branches/eglibc-2_11/libc/sysdeps/unix/sysv/linux/sync_file_range.c (original)
+++ branches/eglibc-2_11/libc/sysdeps/unix/sysv/linux/sync_file_range.c Mon Nov 30 17:42:59 2009
@@ -1,5 +1,5 @@
 /* Selective file content synch'ing.
-   Copyright (C) 2006, 2007 Free Software Foundation, Inc.
+   Copyright (C) 2006, 2007, 2009 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -34,6 +34,14 @@
 			 __LONG_LONG_PAIR ((long) (to >> 32), (long) to),
 			 flags);
 }
+#elif defined __NR_sync_file_range2
+int
+sync_file_range (int fd, __off64_t from, __off64_t to, unsigned int flags)
+{
+  return INLINE_SYSCALL (sync_file_range2, 6, fd, flags,
+			 __LONG_LONG_PAIR ((long) (from >> 32), (long) from),
+			 __LONG_LONG_PAIR ((long) (to >> 32), (long) to));
+}
 #else
 int
 sync_file_range (int fd, __off64_t from, __off64_t to, unsigned int flags)

Modified: branches/eglibc-2_11/ports/ChangeLog.arm
==============================================================================
--- branches/eglibc-2_11/ports/ChangeLog.arm (original)
+++ branches/eglibc-2_11/ports/ChangeLog.arm Mon Nov 30 17:42:59 2009
@@ -1,3 +1,8 @@
+2009-11-19  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/arm/kernel-features.h (__ASSUME_PSELECT,
+	__ASSUME_PPOLL): Don't undefine for kernel 2.6.32 and later.
+
 2009-11-17  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
 
 	[BZ #10972]

Modified: branches/eglibc-2_11/ports/ChangeLog.mips
==============================================================================
--- branches/eglibc-2_11/ports/ChangeLog.mips (original)
+++ branches/eglibc-2_11/ports/ChangeLog.mips Mon Nov 30 17:42:59 2009
@@ -1,3 +1,15 @@
+2009-12-01  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list
+	(posix_fadvise): Remove.
+	* sysdeps/unix/sysv/linux/mips/mips64/n32/posix_fadvise.c,
+	sysdeps/unix/sysv/linux/mips/mips64/n64/posix_fadvise.c,
+	sysdeps/unix/sysv/linux/mips/mips64/n64/posix_fadvise64.c: New.
+
+2009-12-01  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
+
+	* sysdeps/mips/dl-lookup.c: Update from generic version.
+
 2009-11-17  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
 
 	[BZ #10972]

Modified: branches/eglibc-2_11/ports/sysdeps/mips/dl-lookup.c
==============================================================================
--- branches/eglibc-2_11/ports/sysdeps/mips/dl-lookup.c (original)
+++ branches/eglibc-2_11/ports/sysdeps/mips/dl-lookup.c Mon Nov 30 17:42:59 2009
@@ -329,16 +329,16 @@
 		 definition we have to use it.  */
 	      void enter (struct unique_sym *table, size_t size,
 			  unsigned int hash, const char *name,
-			  const ElfW(Sym) *sym, const struct link_map *map)
+			  const ElfW(Sym) *sym, struct link_map *map)
 	      {
 		size_t idx = hash % size;
 		size_t hash2 = 1 + hash % (size - 2);
 		while (1)
 		  {
-		    if (table[idx].hashval == 0)
+		    if (table[idx].name == NULL)
 		      {
 			table[idx].hashval = hash;
-			table[idx].name = strtab + sym->st_name;
+			table[idx].name = name;
 			if ((type_class & ELF_RTYPE_CLASS_COPY) != 0)
 			  {
 			    table[idx].sym = ref;
@@ -348,7 +348,13 @@
 			  {
 			    table[idx].sym = sym;
 			    table[idx].map = map;
+
+			    if (map->l_type == lt_loaded)
+			      /* Make sure we don't unload this object by
+				 setting the appropriate flag.  */
+			      map->l_flags_1 |= DF_1_NODELETE;
 			  }
+
 			return;
 		      }
 
@@ -380,8 +386,7 @@
 			  return 1;
 			}
 
-		      if (entries[idx].hashval == 0
-			  && entries[idx].name == NULL)
+		      if (entries[idx].name == NULL)
 			break;
 
 		      idx += hash2;
@@ -389,10 +394,14 @@
 			idx -= size;
 		    }
 
-		  if (size * 3 <= tab->n_elements)
+		  if (size * 3 <= tab->n_elements * 4)
 		    {
 		      /* Expand the table.  */
-		      size_t newsize = _dl_higher_prime_number (size);
+#ifdef RTLD_CHECK_FOREIGN_CALL
+		      /* This must not happen during runtime relocations.  */
+		      assert (!RTLD_CHECK_FOREIGN_CALL);
+#endif
+		      size_t newsize = _dl_higher_prime_number (size + 1);
 		      struct unique_sym *newentries
 			= calloc (sizeof (struct unique_sym), newsize);
 		      if (newentries == NULL)
@@ -403,19 +412,25 @@
 			}
 
 		      for (idx = 0; idx < size; ++idx)
-			if (entries[idx].hashval != 0)
+			if (entries[idx].name != NULL)
 			  enter (newentries, newsize, entries[idx].hashval,
 				 entries[idx].name, entries[idx].sym,
 				 entries[idx].map);
 
 		      tab->free (entries);
 		      tab->size = newsize;
+		      size = newsize;
 		      entries = tab->entries = newentries;
 		      tab->free = free;
 		    }
 		}
 	      else
 		{
+#ifdef RTLD_CHECK_FOREIGN_CALL
+		  /* This must not happen during runtime relocations.  */
+		  assert (!RTLD_CHECK_FOREIGN_CALL);
+#endif
+
 #define INITIAL_NUNIQUE_SYM_TABLE 31
 		  size = INITIAL_NUNIQUE_SYM_TABLE;
 		  entries = calloc (sizeof (struct unique_sym), size);
@@ -427,7 +442,8 @@
 		  tab->free = free;
 		}
 
-	      enter (entries, size, new_hash, strtab + sym->st_name, sym, map);
+	      enter (entries, size, new_hash, strtab + sym->st_name, sym,
+		     (struct link_map *) map);
 	      ++tab->n_elements;
 
 	      __rtld_lock_unlock_recursive (tab->lock);
@@ -609,6 +625,10 @@
 	  struct link_map_reldeps *newp;
 	  unsigned int max
 	    = undef_map->l_reldepsmax ? undef_map->l_reldepsmax * 2 : 10;
+
+#ifdef RTLD_PREPARE_FOREIGN_CALL
+	  RTLD_PREPARE_FOREIGN_CALL;
+#endif
 
 	  newp = malloc (sizeof (*newp) + max * sizeof (struct link_map *));
 	  if (newp == NULL)

Modified: branches/eglibc-2_11/ports/sysdeps/unix/sysv/linux/arm/kernel-features.h
==============================================================================
--- branches/eglibc-2_11/ports/sysdeps/unix/sysv/linux/arm/kernel-features.h (original)
+++ branches/eglibc-2_11/ports/sysdeps/unix/sysv/linux/arm/kernel-features.h Mon Nov 30 17:42:59 2009
@@ -59,6 +59,8 @@
 
 #include_next <kernel-features.h>
 
-/* These syscalls are not implemented yet for ARM.  */
-#undef __ASSUME_PSELECT
-#undef __ASSUME_PPOLL
+/* Support for pselect6, ppoll and epoll_pwait was added in 2.6.32.  */
+#if __LINUX_KERNEL_VERSION < 0x020620
+# undef __ASSUME_PSELECT
+# undef __ASSUME_PPOLL
+#endif

Modified: branches/eglibc-2_11/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list
==============================================================================
--- branches/eglibc-2_11/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list (original)
+++ branches/eglibc-2_11/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list Mon Nov 30 17:42:59 2009
@@ -2,6 +2,5 @@
 
 readahead	-	readahead	i:iii	__readahead	readahead
 sync_file_range	-	sync_file_range	i:iiii	sync_file_range
-posix_fadvise	-	fadvise64	i:iiii	posix_fadvise
 ftruncate	-	ftruncate	i:ii	__ftruncate	ftruncate ftruncate64 __ftruncate64
 truncate	-	truncate	i:si	truncate	truncate64