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

[commits] r9478 - in /fsf/trunk/libc: ./ bits/ elf/ include/ sysdeps/unix/sysv/linux/bits/ sysdeps/unix/sysv/linux/sparc/bits/



Author: eglibc
Date: Wed Dec 16 00:04:16 2009
New Revision: 9478

Log:
Import glibc-mainline for 2009-12-16

Modified:
    fsf/trunk/libc/ChangeLog
    fsf/trunk/libc/bits/poll.h
    fsf/trunk/libc/elf/dl-lookup.c
    fsf/trunk/libc/elf/dl-object.c
    fsf/trunk/libc/include/link.h
    fsf/trunk/libc/sysdeps/unix/sysv/linux/bits/poll.h
    fsf/trunk/libc/sysdeps/unix/sysv/linux/sparc/bits/poll.h

Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Wed Dec 16 00:04:16 2009
@@ -1,3 +1,17 @@
+2009-12-15  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	[BZ #11093]
+	* bits/poll.h: Define POLLRDNORM, POLLRDBAND, POLLWRNORM, and
+	POLLWRBAND also for POSIX 2008.
+	* sysdeps/unix/sysv/linux/bits/poll.h: Likewise.
+	* sysdeps/unix/sysv/linux/sparc/bits/poll.h: Likewise.
+
+	* include/link.h (struct link_map): Move l_used into its own word.
+	* elf/dl-lookup.c (_dl_lookup_symbol_x): Only update l_used when it is
+	still zero.
+	* elf/dl-object.c (_dl_new_object): Set dl_used if we know it is
+	never really used.
+
 2009-12-13  H.J. Lu  <hongjiu.lu@xxxxxxxxx>
 
 	* sysdeps/i386/i686/multiarch/strcspn.S Include <init-arch.h>

Modified: fsf/trunk/libc/bits/poll.h
==============================================================================
--- fsf/trunk/libc/bits/poll.h (original)
+++ fsf/trunk/libc/bits/poll.h Wed Dec 16 00:04:16 2009
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 2000, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 2000, 2001, 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
@@ -27,8 +27,8 @@
 #define POLLPRI		02              /* There is urgent data to read.  */
 #define POLLOUT		04              /* Writing now will not block.  */
 
-#ifdef __USE_XOPEN
-/* These values are defined in XPG4.2.  */
+#if defined __USE_XOPEN || defined __USE_XOPEN2K8
+/* These values are defined in XPG4.2 and later.  */
 # define POLLRDNORM	POLLIN		/* Normal data may be read.  */
 # define POLLRDBAND	POLLPRI		/* Priority data may be read.  */
 # define POLLWRNORM	POLLOUT		/* Writing now will not block.  */

Modified: fsf/trunk/libc/elf/dl-lookup.c
==============================================================================
--- fsf/trunk/libc/elf/dl-lookup.c (original)
+++ fsf/trunk/libc/elf/dl-lookup.c Wed Dec 16 00:04:16 2009
@@ -777,7 +777,7 @@
   if (__builtin_expect (protected != 0, 0))
     {
       /* It is very tricky.  We need to figure out what value to
-         return for the protected symbol.  */
+	 return for the protected symbol.  */
       if (type_class == ELF_RTYPE_CLASS_PLT)
 	{
 	  if (current_value.s != NULL && current_value.m != undef_map)
@@ -822,7 +822,8 @@
 				  version, type_class, flags, skip_map);
 
   /* The object is used.  */
-  current_value.m->l_used = 1;
+  if (__builtin_expect (current_value.m->l_used == 0, 0))
+    current_value.m->l_used = 1;
 
   if (__builtin_expect (GLRO(dl_debug_mask)
 			& (DL_DEBUG_BINDINGS|DL_DEBUG_PRELINK), 0))
@@ -844,7 +845,7 @@
   Elf_Symndx nchain;
 
   if (__builtin_expect (map->l_info[DT_ADDRTAGIDX (DT_GNU_HASH) + DT_NUM
-  				    + DT_THISPROCNUM + DT_VERSIONTAGNUM
+				    + DT_THISPROCNUM + DT_VERSIONTAGNUM
 				    + DT_EXTRANUM + DT_VALNUM] != NULL, 1))
     {
       Elf32_Word *hash32

Modified: fsf/trunk/libc/elf/dl-object.c
==============================================================================
--- fsf/trunk/libc/elf/dl-object.c (original)
+++ fsf/trunk/libc/elf/dl-object.c Wed Dec 16 00:04:16 2009
@@ -1,5 +1,5 @@
 /* Storage management for the chain of loaded shared objects.
-   Copyright (C) 1995-2002,2004,2006,2007,2008 Free Software Foundation, Inc.
+   Copyright (C) 1995-2002,2004,2006-2008,2009 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -67,6 +67,10 @@
 
   new->l_name = realname;
   new->l_type = type;
+  /* If we set the bit now since we know it is never used we avoid
+     dirtying the cache line later.  */
+  if ((GLRO(dl_debug_mask) & DL_DEBUG_UNUSED) == 0)
+    new->l_used = 1;
   new->l_loader = loader;
 #if NO_TLS_OFFSET != 0
   new->l_tls_offset = NO_TLS_OFFSET;
@@ -174,7 +178,7 @@
 	  if (result == NULL)
 	    {
 	      /* We were not able to determine the current directory.
-	         Note that free(origin) is OK if origin == NULL.  */
+		 Note that free(origin) is OK if origin == NULL.  */
 	      free (origin);
 	      origin = (char *) -1;
 	      goto out;

Modified: fsf/trunk/libc/include/link.h
==============================================================================
--- fsf/trunk/libc/include/link.h (original)
+++ fsf/trunk/libc/include/link.h Wed Dec 16 00:04:16 2009
@@ -1,6 +1,6 @@
 /* Data structure for communication from the run-time dynamic linker for
    loaded ELF shared objects.
-   Copyright (C) 1995-2006, 2007 Free Software Foundation, Inc.
+   Copyright (C) 1995-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
@@ -180,7 +180,6 @@
     unsigned int l_need_tls_init:1; /* Nonzero if GL(dl_init_static_tls)
 				       should be called on this link map
 				       when relocation finishes.  */
-    unsigned int l_used:1;	/* Nonzero if the DSO is used.  */
     unsigned int l_auditing:1;	/* Nonzero if the DSO is used in auditing.  */
     unsigned int l_audit_any_plt:1; /* Nonzero if at least one audit module
 				       is interested in the PLT interception.*/
@@ -239,12 +238,15 @@
     struct link_map **l_initfini;
 
     /* List of the dependencies introduced through symbol binding.  */
-    unsigned int l_reldepsmax;
     struct link_map_reldeps
       {
 	unsigned int act;
 	struct link_map *list[];
       } *l_reldeps;
+    unsigned int l_reldepsmax;
+
+    /* Nonzero if the DSO is used.  */
+    unsigned int l_used;
 
     /* Various flag words.  */
     ElfW(Word) l_feature_1;

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/bits/poll.h
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/bits/poll.h (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/bits/poll.h Wed Dec 16 00:04:16 2009
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 2001, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 2001, 2006, 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
@@ -27,7 +27,7 @@
 #define POLLPRI		0x002		/* There is urgent data to read.  */
 #define POLLOUT		0x004		/* Writing now will not block.  */
 
-#ifdef __USE_XOPEN
+#if defined __USE_XOPEN || defined __USE_XOPEN2K8
 /* These values are defined in XPG4.2.  */
 # define POLLRDNORM	0x040		/* Normal data may be read.  */
 # define POLLRDBAND	0x080		/* Priority data may be read.  */

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/sparc/bits/poll.h
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/sparc/bits/poll.h (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/sparc/bits/poll.h Wed Dec 16 00:04:16 2009
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 2001, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 2001, 2006, 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
@@ -27,7 +27,7 @@
 #define POLLPRI		0x002		/* There is urgent data to read.  */
 #define POLLOUT		0x004		/* Writing now will not block.  */
 
-#ifdef __USE_XOPEN
+#if defined __USE_XOPEN || defined __USE_XOPEN2K8
 /* These values are defined in XPG4.2.  */
 # define POLLRDNORM	0x040		/* Normal data may be read.  */
 # define POLLRDBAND	0x080		/* Priority data may be read.  */