GNU C Library master sources branch, fedora/master, updated. glibc-2.13-842-g265ac25

schwab@sourceware.org schwab@sourceware.org
Thu Mar 3 08:54:00 GMT 2011


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, fedora/master has been updated
       via  265ac25612bee2df2459ccc403e82400377c28c6 (commit)
       via  29686f94f65772e72c28a41d1438bc9b37909d19 (commit)
       via  8d24af9c83ec810872bf46a4ff8c3d415c84d8d2 (commit)
       via  84e0394875ff6bd69f05fe065680370f17803c87 (commit)
       via  4bff6e0175ed195871f4e01cc4c4c33274b8f6e3 (commit)
       via  661b9e2014b3964469198ce7697a1d0d06aa4882 (commit)
       via  f2092faf2b6bd491a1891d5d5e393a8bf85d01d7 (commit)
       via  6c8a2e88d12b7341440ac9669db0448223deb381 (commit)
       via  071f805ea30da4f4c43f45ceb8f4ad6aacffa51e (commit)
       via  84a4211850e3d23a9d3a4f3b294752a3b30bc0ff (commit)
       via  e23fe25b33324a9ea992276c1a4f04127bf9ba4b (commit)
       via  d3f02e1012be2d47c3592212c3117a84bfb1fd86 (commit)
       via  b31bc758710e24a6c24b6914de9ec931ad436893 (commit)
       via  baa6c69a57e632e953b45c11df7a5e5cb954e9cb (commit)
       via  be6bd0b7ab68d0ed968138a41b5d18eb930d7443 (commit)
       via  d55fd7a5573ea7c7c14af95bc37618469cde8a5f (commit)
       via  d4720230b54723c2b179030083318cffd6dbbc63 (commit)
       via  2206397e1c46f69fb20eeb3de1920d3a7014c325 (commit)
       via  8e31c82dbd7dad4d33b35d242b5a990f1168a859 (commit)
       via  f75286c6968af12697f63ca60b2599478fd2c8f1 (commit)
       via  e9433893258aef145c4101a458ac908383757430 (commit)
       via  c1d0e639a95d6d3d3f1c1f70cf97d596bd5a24ec (commit)
       via  2534cf1a1eacf8d3c151839b3a45eb7a17b1669d (commit)
       via  69b2742192aea5b031506cb9fc62329ab379b4ba (commit)
       via  ce360d3d34e41e1b03d942c51e5694d6a34b093f (commit)
       via  09967d6b9196a22b5c00ce1ec2272599b0aa1d97 (commit)
       via  19e6b7786f4f63d9978bd3965014bfaea292d626 (commit)
       via  9750f3f8c462c748242e784c1787a0e19f4c01d5 (commit)
       via  edf9294e7a2cd46b050faf2d270d28ff477f6c5e (commit)
       via  2b7e92df930b8ed1ace659bf6e0b8dff41d65bf0 (commit)
       via  a4c7ea7bb8eed9a53c4c50a3b9b9ab324beb1419 (commit)
       via  a0bf67cca2b7de3a745ab5cf0f9d6e74078d57af (commit)
       via  ee3d4021aaaeacff7cf2addcdaa48859fffba2aa (commit)
       via  091023f58fd6a18caeaa275b7c52048cc70dd3d2 (commit)
       via  dded88cd5455d49aa1dcd2298dde63182e4751a6 (commit)
       via  0c156ec9d02610864ff423d1bec621bc256d5e83 (commit)
       via  435b95ebd07f18ad052a379e0381b12e9ebf5b2c (commit)
       via  8517b15ee8e39fed11afb784fd0e249d977849f4 (commit)
       via  10a656fe33d8257531ff3e9a882d3fd7db6ce5b3 (commit)
      from  2dcf3d16f79b3da77775f39eba602861d5299fc5 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=265ac25612bee2df2459ccc403e82400377c28c6

commit 265ac25612bee2df2459ccc403e82400377c28c6
Author: Andreas Schwab <schwab@redhat.com>
Date:   Wed Mar 2 16:39:58 2011 +0100

    2.13.90-5

diff --git a/fedora/glibc.spec.in b/fedora/glibc.spec.in
index eccb4e5..0ba78d4 100644
--- a/fedora/glibc.spec.in
+++ b/fedora/glibc.spec.in
@@ -21,7 +21,7 @@
 Summary: The GNU libc libraries
 Name: glibc
 Version: %{glibcversion}
-Release: 4
+Release: 5
 # GPLv2+ is used in a bunch of programs, LGPLv2+ is used for libraries.
 # Things that are linked directly into dynamically linked programs
 # and shared libraries (e.g. crt files, lib*_nonshared.a) have an additional
@@ -1039,6 +1039,15 @@ rm -f *.filelist*
 %endif
 
 %changelog
+* Wed Mar  2 2011 Andreas Schwab <schwab@redhat.com> - 2.13.90-5
+- Update from master
+  - Fix memory leak in dlopen with RTLD_NOLOAD (BZ#12509)
+  - Don't crash when dependencies are missing (BZ#12454)
+  - Fix allocation when handling positional parameters in printf
+    (BZ#12445)
+  - Fix two printf handler issues
+- Fix false assertion (BZ#12454, #673014)
+
 * Mon Feb 14 2011 Andreas Schwab <schwab@redhat.com> - 2.13.90-4
 - Update from master
   - Update sysdeps/unix/sysv/linux/sparc/bits/socket.h

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=29686f94f65772e72c28a41d1438bc9b37909d19

commit 29686f94f65772e72c28a41d1438bc9b37909d19
Author: Andreas Schwab <schwab@redhat.com>
Date:   Thu Feb 17 13:41:34 2011 +0100

    Fix false assertion

diff --git a/ChangeLog b/ChangeLog
index 72c932f..727c7e5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2011-03-02  Andreas Schwab  <schwab@redhat.com>
+
+	[BZ #12454]
+	* elf/dl-deps.c (_dl_map_object_deps): Don't try to sort
+	dependencies when there are none.
+
 2011-02-23  Andreas Schwab  <schwab@redhat.com>
 	    Ulrich Drepper  <drepper@gmail.com>
 
diff --git a/elf/dl-deps.c b/elf/dl-deps.c
index d3c27f1..9e30594 100644
--- a/elf/dl-deps.c
+++ b/elf/dl-deps.c
@@ -623,55 +623,58 @@ Filters not supported with LD_TRACE_PRELINKING"));
 
   /* We can skip looking for the binary itself which is at the front
      of the search list.  */
-  assert (nlist > 1);
-  i = 1;
-  bool seen[nlist];
-  memset (seen, false, nlist * sizeof (seen[0]));
-  while (1)
+  if (nlist > 1)
     {
-      /* Keep track of which object we looked at this round.  */
-      seen[i] = true;
-      struct link_map *thisp = l_initfini[i];
-
-      /* Find the last object in the list for which the current one is
-	 a dependency and move the current object behind the object
-	 with the dependency.  */
-      unsigned int k = nlist - 1;
-      while (k > i)
+      i = 1;
+      bool seen[nlist];
+      memset (seen, false, nlist * sizeof (seen[0]));
+      while (1)
 	{
-	  struct link_map **runp = l_initfini[k]->l_initfini;
-	  if (runp != NULL)
-	    /* Look through the dependencies of the object.  */
-	    while (*runp != NULL)
-	      if (__builtin_expect (*runp++ == thisp, 0))
-		{
-		  /* Move the current object to the back past the last
-		     object with it as the dependency.  */
-		  memmove (&l_initfini[i], &l_initfini[i + 1],
-			   (k - i) * sizeof (l_initfini[0]));
-		  l_initfini[k] = thisp;
-
-		  if (seen[i + 1])
+	  /* Keep track of which object we looked at this round.  */
+	  seen[i] = true;
+	  struct link_map *thisp = l_initfini[i];
+
+	  /* Find the last object in the list for which the current one is
+	     a dependency and move the current object behind the object
+	     with the dependency.  */
+	  unsigned int k = nlist - 1;
+	  while (k > i)
+	    {
+	      struct link_map **runp = l_initfini[k]->l_initfini;
+	      if (runp != NULL)
+		/* Look through the dependencies of the object.  */
+		while (*runp != NULL)
+		  if (__builtin_expect (*runp++ == thisp, 0))
 		    {
-		      ++i;
-		      goto next_clear;
+		      /* Move the current object to the back past the last
+			 object with it as the dependency.  */
+		      memmove (&l_initfini[i], &l_initfini[i + 1],
+			       (k - i) * sizeof (l_initfini[0]));
+		      l_initfini[k] = thisp;
+
+		      if (seen[i + 1])
+			{
+			  ++i;
+			  goto next_clear;
+			}
+
+		      memmove (&seen[i], &seen[i + 1],
+			       (k - i) * sizeof (seen[0]));
+		      seen[k] = true;
+
+		      goto next;
 		    }
 
-		  memmove (&seen[i], &seen[i + 1], (k - i) * sizeof (seen[0]));
-		  seen[k] = true;
+	      --k;
+	    }
 
-		  goto next;
-		}
+	  if (++i == nlist)
+	    break;
+	next_clear:
+	  memset (&seen[i], false, (nlist - i) * sizeof (seen[0]));
 
-	  --k;
+	next:;
 	}
-
-      if (++i == nlist)
-	break;
-    next_clear:
-      memset (&seen[i], false, (nlist - i) * sizeof (seen[0]));
-
-    next:;
     }
 
   /* Terminate the list of dependencies.  */

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=8d24af9c83ec810872bf46a4ff8c3d415c84d8d2

commit 8d24af9c83ec810872bf46a4ff8c3d415c84d8d2
Merge: 84e0394 4bff6e0
Author: Andreas Schwab <schwab@redhat.com>
Date:   Wed Mar 2 15:41:46 2011 +0100

    Merge remote-tracking branch 'origin/master' into fedora/master

diff --cc ChangeLog
index a04434e,a60bf2b..72c932f
--- a/ChangeLog
+++ b/ChangeLog
@@@ -780,34 -865,6 +876,22 @@@
  	* sysdeps/unix/sysv/linux/internal_statvfs.c (INTERNAL_STATVFS):
  	Mask out sign-bit copies when constructing f_fsid.
  
- 2010-09-28  Andreas Schwab  <schwab@redhat.com>
- 
- 	* elf/rtld.c (dl_main): Move setting of GLRO(dl_init_all_dirs)
- 	before performing relro protection.
- 
 +2010-09-27  Andreas Schwab  <schwab@redhat.com>
 +
- 	* include/link.h (struct link_map): Add l_free_initfini.
- 	* elf/dl-deps.c (_dl_map_object_deps): Set it when assigning
- 	l_initfini.
- 	* elf/rtld.c (dl_main): Clear it on all objects loaded on startup.
- 	* elf/dl-libc.c (free_mem): Free l_initfini if l_free_initfini is
- 	set.
- 
 +	[BZ #11561]
 +	* posix/regcomp.c (parse_bracket_exp): When looking up collating
 +	elements compare against the byte sequence of it, not its name.
 +
 +	[BZ #6530]
 +	* stdio-common/vfprintf.c (process_string_arg): Revert 2000-07-22
 +	change.
 +
 +	* nss/nss_files/files-XXX.c (internal_getent): Declare linebuflen
 +	as size_t.
 +
 +	* sysdeps/i386/i686/multiarch/strspn.S (ENTRY): Add missing
 +	backslash.
 +
  2010-09-24  Petr Baudis <pasky@suse.cz>
  
  	* debug/stack_chk_fail_local.c: Add missing licence exception.
diff --cc elf/rtld.c
index 5e0db12,174954b..4a9109e
--- a/elf/rtld.c
+++ b/elf/rtld.c
@@@ -2299,6 -2302,9 +2298,8 @@@ ERROR: ld.so: object '%s' cannot be loa
  			  lossage);
      }
  
+   /* Make sure no new search directories have been added.  */
+   assert (GLRO(dl_init_all_dirs) == GL(dl_all_dirs));
 -
    if (! prelinked && rtld_multiple_ref)
      {
        /* There was an explicit ref to the dynamic linker as a shared lib.

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=84e0394875ff6bd69f05fe065680370f17803c87

commit 84e0394875ff6bd69f05fe065680370f17803c87
Author: Andreas Schwab <schwab@redhat.com>
Date:   Wed Mar 2 15:29:16 2011 +0100

    Revert "Revert "Patch followup.""
    
    This reverts commit 09967d6b9196a22b5c00ce1ec2272599b0aa1d97.

diff --git a/ChangeLog b/ChangeLog
index f719d5c..a04434e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -90,6 +90,7 @@
 
 2011-01-19  Ulrich Drepper  <drepper@gmail.com>
 
+	[BZ #11724]
 	* elf/dl-deps.c (_dl_map_object_deps): Rewrite sorting determining order
 	of constructors.
 	* elf/dl-fini.c (_dl_sort_fini): Rewrite sorting determining order
diff --git a/NEWS b/NEWS
index b7bbc92..836160d 100644
--- a/NEWS
+++ b/NEWS
@@ -9,7 +9,7 @@ Version 2.14
 
 * The following bugs are resolved with this release:
 
-  12460
+  11724, 12460
 
 Version 2.13
 

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=b31bc758710e24a6c24b6914de9ec931ad436893

commit b31bc758710e24a6c24b6914de9ec931ad436893
Author: Andreas Schwab <schwab@redhat.com>
Date:   Thu Feb 17 13:50:32 2011 +0100

    Revert "Revert "Fix ordering of DSO constructors and destructors.""
    
    This reverts commit ce360d3d34e41e1b03d942c51e5694d6a34b093f.

diff --git a/ChangeLog b/ChangeLog
index da4f22d..f719d5c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -88,6 +88,33 @@
 	descriptor instead of privileges.  Be careful to drop all
 	capabilities when not needed.
 
+2011-01-19  Ulrich Drepper  <drepper@gmail.com>
+
+	* elf/dl-deps.c (_dl_map_object_deps): Rewrite sorting determining order
+	of constructors.
+	* elf/dl-fini.c (_dl_sort_fini): Rewrite sorting determining order
+	of destructors.
+	(_dl_fini): Don't call _dl_sort_fini if there is only one object.
+
+	[BZ #11724]
+	* elf/Makefile: Add rules to build and run new test.
+	* elf/tst-initorder.c: New file.
+	* elf/tst-initorder.exp: New file.
+	* elf/tst-initordera1.c: New file.
+	* elf/tst-initordera2.c: New file.
+	* elf/tst-initordera3.c: New file.
+	* elf/tst-initordera4.c: New file.
+	* elf/tst-initorderb1.c: New file.
+	* elf/tst-initorderb2.c: New file.
+	* elf/tst-order-a1.c: New file.
+	* elf/tst-order-a2.c: New file.
+	* elf/tst-order-a3.c: New file.
+	* elf/tst-order-a4.c: New file.
+	* elf/tst-order-b1.c: New file.
+	* elf/tst-order-b2.c: New file.
+	* elf/tst-order-main.c: New file.
+	New test case by George Gensure <werkt0@gmail.com>.
+
 2010-10-01  Andreas Schwab  <schwab@redhat.com>
 
 	* sysdeps/posix/getaddrinfo.c (gaih_inet): Don't discard result of
diff --git a/elf/Makefile b/elf/Makefile
index f84b833..3607e04 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -119,7 +119,10 @@ distribute	:= rtld-Rules \
 		   ifuncmain7.c ifuncmain7pic.c ifuncmain7picstatic.c \
 		   ifuncmain7pie.c ifuncmain7static.c \
 		   tst-unique1.c tst-unique1mod1.c tst-unique1mod2.c \
-		   tst-unique2.c tst-unique2mod1.c tst-unique2mod2.c
+		   tst-unique2.c tst-unique2mod1.c tst-unique2mod2.c \
+			 tst-initordera1.c tst-initordera2.c tst-initorderb1.c \
+			 tst-initorderb2.c tst-initordera3.c tst-initordera4.c \
+			 tst-initorder.c
 
 CFLAGS-dl-runtime.c = -fexceptions -fasynchronous-unwind-tables
 CFLAGS-dl-lookup.c = -fexceptions -fasynchronous-unwind-tables
@@ -200,7 +203,8 @@ tests += loadtest restest1 preloadtest loadfail multiload origtest resolvfail \
 	 unload3 unload4 unload5 unload6 unload7 unload8 tst-global1 order2 \
 	 tst-audit1 tst-audit2 \
 	 tst-stackguard1 tst-addr1 tst-thrlock \
-	 tst-unique1 tst-unique2
+	 tst-unique1 tst-unique2 \
+	 tst-initorder
 #	 reldep9
 test-srcs = tst-pathopt
 tests-execstack-yes = tst-execstack tst-execstack-needed tst-execstack-prog
@@ -253,7 +257,10 @@ modules-names = testobj1 testobj2 testobj3 testobj4 testobj5 testobj6 \
 		unload8mod1 unload8mod1x unload8mod2 unload8mod3 \
 		order2mod1 order2mod2 order2mod3 order2mod4 \
 		tst-unique1mod1 tst-unique1mod2 \
-		tst-unique2mod1 tst-unique2mod2
+		tst-unique2mod1 tst-unique2mod2 \
+		tst-initordera1 tst-initorderb1 \
+		tst-initordera2 tst-initorderb2 \
+		tst-initordera3 tst-initordera4
 ifeq (yes,$(have-initfini-array))
 modules-names += tst-array2dep tst-array5dep
 endif
@@ -537,6 +544,11 @@ $(objpfx)unload7mod2.so: $(objpfx)unload7mod1.so
 $(objpfx)unload8mod1.so: $(objpfx)unload8mod2.so
 $(objpfx)unload8mod2.so: $(objpfx)unload8mod3.so
 $(objpfx)unload8mod3.so: $(libdl)
+$(objpfx)tst-initordera2.so: $(objpfx)tst-initordera1.so
+$(objpfx)tst-initorderb2.so: $(objpfx)tst-initorderb1.so $(objpfx)tst-initordera2.so
+$(objpfx)tst-initordera3.so: $(objpfx)tst-initorderb2.so $(objpfx)tst-initorderb1.so
+$(objpfx)tst-initordera4.so: $(objpfx)tst-initordera3.so
+$(objpfx)tst-initorder: $(objpfx)tst-initordera4.so $(objpfx)tst-initordera1.so $(objpfx)tst-initorderb2.so
 
 LDFLAGS-tst-tlsmod5.so = -nostdlib
 LDFLAGS-tst-tlsmod6.so = -nostdlib
@@ -1171,6 +1183,12 @@ $(objpfx)tst-unique1.out: $(objpfx)tst-unique1mod1.so \
 $(objpfx)tst-unique2: $(libdl) $(objpfx)tst-unique2mod1.so
 $(objpfx)tst-unique2.out: $(objpfx)tst-unique2mod2.so
 
+$(objpfx)tst-initorder.out: $(objpfx)tst-initorder
+	$(elf-objpfx)${rtld-installed-name} \
+	  --library-path $(rpath-link)$(patsubst %,:%,$(sysdep-library-path)) \
+	  $< > $@
+	cmp $@ tst-initorder.exp > /dev/null
+
 ifeq (yes,$(config-cflags-avx))
 AVX-CFLAGS=-mavx
 ifeq (yes,$(config-cflags-novzeroupper))
diff --git a/elf/dl-deps.c b/elf/dl-deps.c
index 1cab2d1..c32ae02 100644
--- a/elf/dl-deps.c
+++ b/elf/dl-deps.c
@@ -1,5 +1,5 @@
 /* Load the dependencies of a mapped object.
-   Copyright (C) 1996-2003, 2004, 2005, 2006, 2007, 2010
+   Copyright (C) 1996-2003, 2004, 2005, 2006, 2007, 2010, 2011
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -592,7 +592,7 @@ Filters not supported with LD_TRACE_PRELINKING"));
 	    /* Need to allocate new array of relocation dependencies.  */
 	    struct link_map_reldeps *l_reldeps;
 	    l_reldeps = malloc (sizeof (*l_reldeps)
-	    			+ map->l_reldepsmax
+				+ map->l_reldepsmax
 				  * sizeof (struct link_map *));
 	    if (l_reldeps == NULL)
 	      /* Bad luck, keep the reldeps duplicated between
@@ -617,48 +617,60 @@ Filters not supported with LD_TRACE_PRELINKING"));
   /* Now determine the order in which the initialization has to happen.  */
   memcpy (l_initfini, map->l_searchlist.r_list,
 	  nlist * sizeof (struct link_map *));
+
   /* We can skip looking for the binary itself which is at the front
-     of the search list.  Look through the list backward so that circular
-     dependencies are not changing the order.  */
-  for (i = 1; i < nlist; ++i)
+     of the search list.  */
+  assert (nlist > 1);
+  i = 1;
+  bool seen[nlist];
+  memset (seen, false, nlist * sizeof (seen[0]));
+  while (1)
     {
-      struct link_map *l = map->l_searchlist.r_list[i];
-      unsigned int j;
-      unsigned int k;
-
-      /* Find the place in the initfini list where the map is currently
-	 located.  */
-      for (j = 1; l_initfini[j] != l; ++j)
-	;
-
-      /* Find all object for which the current one is a dependency and
-	 move the found object (if necessary) in front.  */
-      for (k = j + 1; k < nlist; ++k)
+      /* Keep track of which object we looked at this round.  */
+      seen[i] = true;
+      struct link_map *thisp = l_initfini[i];
+
+      /* Find the last object in the list for which the current one is
+	 a dependency and move the current object behind the object
+	 with the dependency.  */
+      unsigned int k = nlist - 1;
+      while (k > i)
 	{
-	  struct link_map **runp;
-
-	  runp = l_initfini[k]->l_initfini;
+	  struct link_map **runp = l_initfini[k]->l_initfini;
 	  if (runp != NULL)
-	    {
-	      while (*runp != NULL)
-		if (__builtin_expect (*runp++ == l, 0))
-		  {
-		    struct link_map *here = l_initfini[k];
-
-		    /* Move it now.  */
-		    memmove (&l_initfini[j] + 1, &l_initfini[j],
-			     (k - j) * sizeof (struct link_map *));
-		    l_initfini[j] = here;
+	    /* Look through the dependencies of the object.  */
+	    while (*runp != NULL)
+	      if (__builtin_expect (*runp++ == thisp, 0))
+		{
+		  /* Move the current object to the back past the last
+		     object with it as the dependency.  */
+		  memmove (&l_initfini[i], &l_initfini[i + 1],
+			   (k - i) * sizeof (l_initfini[0]));
+		  l_initfini[k] = thisp;
+
+		  if (seen[i + 1])
+		    {
+		      ++i;
+		      goto next_clear;
+		    }
+
+		  memmove (&seen[i], &seen[i + 1], (k - i) * sizeof (seen[0]));
+		  seen[k] = true;
+
+		  goto next;
+		}
+
+	  --k;
+	}
 
-		    /* Don't insert further matches before the last
-		       entry moved to the front.  */
-		    ++j;
+      if (++i == nlist)
+	break;
+    next_clear:
+      memset (&seen[i], false, (nlist - i) * sizeof (seen[0]));
 
-		    break;
-		  }
-	    }
-	}
+    next:;
     }
+
   /* Terminate the list of dependencies.  */
   l_initfini[nlist] = NULL;
   atomic_write_barrier ();
diff --git a/elf/dl-fini.c b/elf/dl-fini.c
index ff4c33e..ba6c62a 100644
--- a/elf/dl-fini.c
+++ b/elf/dl-fini.c
@@ -1,5 +1,6 @@
 /* Call the termination functions of loaded shared objects.
-   Copyright (C) 1995,96,1998-2002,2004-2005,2009 Free Software Foundation, Inc.
+   Copyright (C) 1995,96,1998-2002,2004-2005,2009,2011
+   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
@@ -32,86 +33,84 @@ internal_function
 _dl_sort_fini (struct link_map *l, struct link_map **maps, size_t nmaps,
 	       char *used, Lmid_t ns)
 {
-  if (ns == LM_ID_BASE)
-    /* The main executable always comes first.  */
-    l = l->l_next;
-
-  for (; l != NULL; l = l->l_next)
-    /* Do not handle ld.so in secondary namespaces and object which
-       are not removed.  */
-    if (l == l->l_real && l->l_idx != -1)
-      {
-	/* Find the place in the 'maps' array.  */
-	unsigned int j;
-	for (j = ns == LM_ID_BASE ? 1 : 0; maps[j] != l; ++j)
-	  assert (j < nmaps);
-
-	/* Find all object for which the current one is a dependency
-	   and move the found object (if necessary) in front.  */
-	for (unsigned int k = j + 1; k < nmaps; ++k)
-	  {
-	    struct link_map **runp = maps[k]->l_initfini;
-	    if (runp != NULL)
-	      {
-		while (*runp != NULL)
-		  if (*runp == l)
+  /* We can skip looking for the binary itself which is at the front
+     of the search list for the main namespace.  */
+  assert (nmaps > 1);
+  unsigned int i = ns == LM_ID_BASE;
+  bool seen[nmaps];
+  memset (seen, false, nmaps * sizeof (seen[0]));
+  while (1)
+    {
+      /* Keep track of which object we looked at this round.  */
+      seen[i] = true;
+      struct link_map *thisp = maps[i];
+
+      /* Do not handle ld.so in secondary namespaces and object which
+	 are not removed.  */
+      if (thisp != thisp->l_real || thisp->l_idx == -1)
+	goto skip;
+
+      /* Find the last object in the list for which the current one is
+	 a dependency and move the current object behind the object
+	 with the dependency.  */
+      unsigned int k = nmaps - 1;
+      while (k > i)
+	{
+	  struct link_map **runp = maps[k]->l_initfini;
+	  if (runp != NULL)
+	    /* Look through the dependencies of the object.  */
+	    while (*runp != NULL)
+	      if (__builtin_expect (*runp++ == thisp, 0))
+		{
+		move:
+		  /* Move the current object to the back past the last
+		     object with it as the dependency.  */
+		  memmove (&maps[i], &maps[i + 1],
+			   (k - i) * sizeof (maps[0]));
+		  maps[k] = thisp;
+
+		  if (used != NULL)
 		    {
-		      struct link_map *here = maps[k];
+		      char here_used = used[i];
+		      memmove (&used[i], &used[i + 1],
+			       (k - i) * sizeof (used[0]));
+		      used[k] = here_used;
+		    }
 
-		      /* Move it now.  */
-		      memmove (&maps[j] + 1,
-			       &maps[j], (k - j) * sizeof (struct link_map *));
-		      maps[j] = here;
+		  if (seen[i + 1])
+		    {
+		      ++i;
+		      goto next_clear;
+		    }
 
-		      if (used != NULL)
-			{
-			  char here_used = used[k];
+		  memmove (&seen[i], &seen[i + 1], (k - i) * sizeof (seen[0]));
+		  seen[k] = true;
 
-			  memmove (&used[j] + 1,
-				   &used[j], (k - j) * sizeof (char));
-			  used[j] = here_used;
-			}
+		  goto next;
+		}
 
-		      ++j;
+	  if (__builtin_expect (maps[k]->l_reldeps != NULL, 0))
+	    {
+	      unsigned int m = maps[k]->l_reldeps->act;
+	      struct link_map **relmaps = &maps[k]->l_reldeps->list[0];
 
-		      break;
-		    }
-		  else
-		    ++runp;
-	      }
-
-	    if (__builtin_expect (maps[k]->l_reldeps != NULL, 0))
-	      {
-		unsigned int m = maps[k]->l_reldeps->act;
-		struct link_map **relmaps = &maps[k]->l_reldeps->list[0];
-
-		while (m-- > 0)
-		  {
-		    if (relmaps[m] == l)
-		      {
-			struct link_map *here = maps[k];
-
-			/* Move it now.  */
-			memmove (&maps[j] + 1,
-				 &maps[j],
-				 (k - j) * sizeof (struct link_map *));
-			maps[j] = here;
-
-			if (used != NULL)
-			  {
-			    char here_used = used[k];
-
-			    memmove (&used[j] + 1,
-				     &used[j], (k - j) * sizeof (char));
-			    used[j] = here_used;
-			  }
-
-			break;
-		      }
-		  }
-	      }
-	  }
-      }
+	    /* Look through the relocation dependencies of the object.  */
+	      while (m-- > 0)
+		if (__builtin_expect (relmaps[m] == thisp, 0))
+		  goto move;
+	    }
+
+	  --k;
+	}
+
+    skip:
+      if (++i == nmaps)
+	break;
+    next_clear:
+      memset (&seen[i], false, (nmaps - i) * sizeof (seen[0]));
+
+    next:;
+    }
 }
 
 
@@ -196,7 +195,7 @@ _dl_fini (void)
       assert (ns == LM_ID_BASE || i == nloaded || i == nloaded - 1);
       nmaps = i;
 
-      if (nmaps != 0)
+      if (nmaps > 1)
 	/* Now we have to do the sorting.  */
 	_dl_sort_fini (GL(dl_ns)[ns]._ns_loaded, maps, nmaps, NULL, ns);
 
diff --git a/elf/tst-initorder.c b/elf/tst-initorder.c
new file mode 100644
index 0000000..9638382
--- /dev/null
+++ b/elf/tst-initorder.c
@@ -0,0 +1,7 @@
+#include <stdio.h>
+
+int
+main( int argc, char *argv[] )
+{
+  printf( "main\n" );
+}
diff --git a/elf/tst-initorder.exp b/elf/tst-initorder.exp
new file mode 100644
index 0000000..8718f65
--- /dev/null
+++ b/elf/tst-initorder.exp
@@ -0,0 +1,13 @@
+start_a1
+start_a2
+start_b1
+start_b2
+start_a3
+start_a4
+main
+finish_a4
+finish_a3
+finish_b2
+finish_b1
+finish_a2
+finish_a1
diff --git a/elf/tst-initordera1.c b/elf/tst-initordera1.c
new file mode 100644
index 0000000..f161257
--- /dev/null
+++ b/elf/tst-initordera1.c
@@ -0,0 +1,16 @@
+#include <stdio.h>
+
+extern void start_a1( void ) __attribute__((constructor));
+extern void finish_a1( void ) __attribute__((destructor));
+
+void
+start_a1( void )
+{
+  printf( "start_a1\n" );
+}
+
+void
+finish_a1( void )
+{
+  printf( "finish_a1\n" );
+}
diff --git a/elf/tst-initordera2.c b/elf/tst-initordera2.c
new file mode 100644
index 0000000..a5a9b42
--- /dev/null
+++ b/elf/tst-initordera2.c
@@ -0,0 +1,16 @@
+#include <stdio.h>
+
+extern void start_a2( void ) __attribute__((constructor));
+extern void finish_a2( void ) __attribute__((destructor));
+
+void
+start_a2( void )
+{
+  printf( "start_a2\n" );
+}
+
+void
+finish_a2( void )
+{
+  printf( "finish_a2\n" );
+}
diff --git a/elf/tst-initordera3.c b/elf/tst-initordera3.c
new file mode 100644
index 0000000..1c7f496
--- /dev/null
+++ b/elf/tst-initordera3.c
@@ -0,0 +1,16 @@
+#include <stdio.h>
+
+extern void start_a3( void ) __attribute__((constructor));
+extern void finish_a3( void ) __attribute__((destructor));
+
+void
+start_a3( void )
+{
+  printf( "start_a3\n" );
+}
+
+void
+finish_a3( void )
+{
+  printf( "finish_a3\n" );
+}
diff --git a/elf/tst-initordera4.c b/elf/tst-initordera4.c
new file mode 100644
index 0000000..70b9f5e
--- /dev/null
+++ b/elf/tst-initordera4.c
@@ -0,0 +1,16 @@
+#include <stdio.h>
+
+extern void start_a4( void ) __attribute__((constructor));
+extern void finish_a4( void ) __attribute__((destructor));
+
+void
+start_a4( void )
+{
+  printf( "start_a4\n" );
+}
+
+void
+finish_a4( void )
+{
+  printf( "finish_a4\n" );
+}
diff --git a/elf/tst-initorderb1.c b/elf/tst-initorderb1.c
new file mode 100644
index 0000000..993ea3f
--- /dev/null
+++ b/elf/tst-initorderb1.c
@@ -0,0 +1,16 @@
+#include <stdio.h>
+
+extern void start_b1( void ) __attribute__((constructor));
+extern void finish_b1( void ) __attribute__((destructor));
+
+void
+start_b1( void )
+{
+  printf( "start_b1\n" );
+}
+
+void
+finish_b1( void )
+{
+  printf( "finish_b1\n" );
+}
diff --git a/elf/tst-initorderb2.c b/elf/tst-initorderb2.c
new file mode 100644
index 0000000..3334dda
--- /dev/null
+++ b/elf/tst-initorderb2.c
@@ -0,0 +1,16 @@
+#include <stdio.h>
+
+extern void start_b2( void ) __attribute__((constructor));
+extern void finish_b2( void ) __attribute__((destructor));
+
+void
+start_b2( void )
+{
+  printf( "start_b2\n" );
+}
+
+void
+finish_b2( void )
+{
+  printf( "finish_b2\n" );
+}
diff --git a/elf/tst-order-a1.c b/elf/tst-order-a1.c
new file mode 100644
index 0000000..f161257
--- /dev/null
+++ b/elf/tst-order-a1.c
@@ -0,0 +1,16 @@
+#include <stdio.h>
+
+extern void start_a1( void ) __attribute__((constructor));
+extern void finish_a1( void ) __attribute__((destructor));
+
+void
+start_a1( void )
+{
+  printf( "start_a1\n" );
+}
+
+void
+finish_a1( void )
+{
+  printf( "finish_a1\n" );
+}
diff --git a/elf/tst-order-a2.c b/elf/tst-order-a2.c
new file mode 100644
index 0000000..a5a9b42
--- /dev/null
+++ b/elf/tst-order-a2.c
@@ -0,0 +1,16 @@
+#include <stdio.h>
+
+extern void start_a2( void ) __attribute__((constructor));
+extern void finish_a2( void ) __attribute__((destructor));
+
+void
+start_a2( void )
+{
+  printf( "start_a2\n" );
+}
+
+void
+finish_a2( void )
+{
+  printf( "finish_a2\n" );
+}
diff --git a/elf/tst-order-a3.c b/elf/tst-order-a3.c
new file mode 100644
index 0000000..1c7f496
--- /dev/null
+++ b/elf/tst-order-a3.c
@@ -0,0 +1,16 @@
+#include <stdio.h>
+
+extern void start_a3( void ) __attribute__((constructor));
+extern void finish_a3( void ) __attribute__((destructor));
+
+void
+start_a3( void )
+{
+  printf( "start_a3\n" );
+}
+
+void
+finish_a3( void )
+{
+  printf( "finish_a3\n" );
+}
diff --git a/elf/tst-order-a4.c b/elf/tst-order-a4.c
new file mode 100644
index 0000000..70b9f5e
--- /dev/null
+++ b/elf/tst-order-a4.c
@@ -0,0 +1,16 @@
+#include <stdio.h>
+
+extern void start_a4( void ) __attribute__((constructor));
+extern void finish_a4( void ) __attribute__((destructor));
+
+void
+start_a4( void )
+{
+  printf( "start_a4\n" );
+}
+
+void
+finish_a4( void )
+{
+  printf( "finish_a4\n" );
+}
diff --git a/elf/tst-order-b1.c b/elf/tst-order-b1.c
new file mode 100644
index 0000000..993ea3f
--- /dev/null
+++ b/elf/tst-order-b1.c
@@ -0,0 +1,16 @@
+#include <stdio.h>
+
+extern void start_b1( void ) __attribute__((constructor));
+extern void finish_b1( void ) __attribute__((destructor));
+
+void
+start_b1( void )
+{
+  printf( "start_b1\n" );
+}
+
+void
+finish_b1( void )
+{
+  printf( "finish_b1\n" );
+}
diff --git a/elf/tst-order-b2.c b/elf/tst-order-b2.c
new file mode 100644
index 0000000..3334dda
--- /dev/null
+++ b/elf/tst-order-b2.c
@@ -0,0 +1,16 @@
+#include <stdio.h>
+
+extern void start_b2( void ) __attribute__((constructor));
+extern void finish_b2( void ) __attribute__((destructor));
+
+void
+start_b2( void )
+{
+  printf( "start_b2\n" );
+}
+
+void
+finish_b2( void )
+{
+  printf( "finish_b2\n" );
+}
diff --git a/elf/tst-order-main.c b/elf/tst-order-main.c
new file mode 100644
index 0000000..80f4f6b
--- /dev/null
+++ b/elf/tst-order-main.c
@@ -0,0 +1,10 @@
+#include <stdio.h>
+#include <unistd.h>
+#include <stdlib.h>
+
+int
+main( int argc, char *argv[] )
+{
+  printf( "main\n" );
+  exit(EXIT_SUCCESS);
+}

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=2534cf1a1eacf8d3c151839b3a45eb7a17b1669d

commit 2534cf1a1eacf8d3c151839b3a45eb7a17b1669d
Author: Andreas Schwab <schwab@redhat.com>
Date:   Mon Feb 14 17:10:03 2011 +0100

    2.13.90-4

diff --git a/fedora/glibc.spec.in b/fedora/glibc.spec.in
index c6fda9d..eccb4e5 100644
--- a/fedora/glibc.spec.in
+++ b/fedora/glibc.spec.in
@@ -21,7 +21,7 @@
 Summary: The GNU libc libraries
 Name: glibc
 Version: %{glibcversion}
-Release: 1
+Release: 4
 # GPLv2+ is used in a bunch of programs, LGPLv2+ is used for libraries.
 # Things that are linked directly into dynamically linked programs
 # and shared libraries (e.g. crt files, lib*_nonshared.a) have an additional
@@ -1039,6 +1039,18 @@ rm -f *.filelist*
 %endif
 
 %changelog
+* Mon Feb 14 2011 Andreas Schwab <schwab@redhat.com> - 2.13.90-4
+- Update from master
+  - Update sysdeps/unix/sysv/linux/sparc/bits/socket.h
+  - Synchronize generic bits/sched.h cpu_set_t with Linux implementation
+  - Schedule nscd cache pruning more accurately from re-added values
+  - Fix passing symbol value to pltexit callbacks when ld.so auditing
+  - Fix range error handling in sgetspent
+- Revert "Fix ordering of DSO constructors and destructors" (#673014)
+- Create debuginfo-common on biarch archs
+- Reinstall assembler workaround.
+- Replace setuid by file capabilities (#646469)
+
 * Tue Jan 25 2011 Andreas Schwab <schwab@redhat.com> - 2.13.90-1
 - Update from master
   - Fix ordering of DSO constructors and destructors (BZ#11724)

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=69b2742192aea5b031506cb9fc62329ab379b4ba

commit 69b2742192aea5b031506cb9fc62329ab379b4ba
Merge: ce360d3 edf9294
Author: Andreas Schwab <schwab@redhat.com>
Date:   Mon Feb 14 16:53:27 2011 +0100

    Merge remote-tracking branch 'origin/master' into fedora/master

diff --cc ChangeLog
index 02071ec,2d9a1e1..da4f22d
--- a/ChangeLog
+++ b/ChangeLog
@@@ -1,8 -1,114 +1,92 @@@
  2011-02-03  Andreas Schwab  <schwab@redhat.com>
  
+ 	* sysdeps/unix/sysv/linux/sparc/bits/socket.h: Sync with
+ 	sysdeps/unix/sysv/linux/bits/socket.h.
+ 
+ 2011-01-30  Samuel Thibault  <samuel.thibault@ens-lyon.org>
+ 
+ 	* bits/sched.h (__CPU_ZERO, __CPU_SET, __CPU_CLR, __CPU_ISSET)
+ 	(__CPU_COUNT): Remove old macros.
+ 	(__CPU_ZERO_S, __CPU_SET_S, __CPU_CLR_S, __CPU_ISSET_S)
+ 	(__CPU_COUNT, __CPU_EQUAL_S, __CPU_OP_S, __CPU_ALLOC_SIZE)
+ 	(__CPU_ALLOC, __CPU_FREE): Add macros.
+ 	(__sched_cpualloc, __sched_cpufree): Add declarations.
+ 
+ 2011-02-05  Ulrich Drepper  <drepper@gmail.com>
+ 
+ 	* nscd/nscd-client.h: Define MAX_TIMEOUT_VALUE.
+ 	(struct datahead): Reuse 32 bits of the alignment for a TTL field.
+ 	* nscd/aicache.c (addhstaiX): Return timeout of added value.
+ 	(readdhstai): Return value of addhstaiX call.
+ 	* nscd/grpcache.c (cache_addgr): Return timeout of added value.
+ 	(addgrbyX): Return value returned by cache_addgr.
+ 	(readdgrbyname): Return value returned by addgrbyX.
+ 	(readdgrbygid): Likewise.
+ 	* nscd/pwdcache.c (cache_addpw): Return timeout of added value.
+ 	(addpwbyX): Return value returned by cache_addpw.
+ 	(readdpwbyname): Return value returned by addhstbyX.
+ 	(readdpwbyuid): Likewise.
+ 	* nscd/servicescache.c (cache_addserv): Return timeout of added value.
+ 	(addservbyX): Return value returned by cache_addserv.
+ 	(readdservbyname): Return value returned by addservbyX:
+ 	(readdservbyport): Likewise.
+ 	* nscd/hstcache.c (cache_addhst): Return timeout of added value.
+ 	(addhstbyX): Return value returned by cache_addhst.
+ 	(readdhstbyname): Return value returned by addhstbyX.
+ 	(readdhstbyaddr): Likewise.
+ 	(readdhstbynamev6): Likewise.
+ 	(readdhstbyaddrv6): Likewise.
+ 	* nscd/initgrcache.c (addinitgroupsX): Return timeout of added value.
+ 	(readdinitgroups): Return value returned by addinitgroupsX.
+ 	* nscd/cache.c (readdfcts): Change return value of functions to time_t.
+ 	(prune_cache): Keep track of timeout value of re-added entries.
+ 	* nscd/connections.c (nscd_run_prune): Use MAX_TIMEOUT_VALUE.
+ 	* nscd/nscd.h: Adjust prototypes of readd* functions.
+ 
+ 2011-02-04  Roland McGrath  <roland@redhat.com>
+ 
+ 	* nis/nis_server.c (nis_servstate): Use the right name for 0.
+ 	(nis_stats): Likewise.
+ 	* nis/nis_modify.c (nis_modify): Likewise.
+ 	* nis/nis_remove.c (nis_remove): Likewise.
+ 	* nis/nis_add.c (nis_add): Likewise.
+ 
+ 	* elf/dl-object.c (_dl_new_object): Remove unused variable L.
+ 
+ 	* posix/fnmatch_loop.c: Add some consts.
+ 
+ 	* sysdeps/x86_64/multiarch/memset-x86-64.S: Add an #undef.
+ 
+ 2011-02-02  H.J. Lu  <hongjiu.lu@intel.com>
+ 
+ 	[BZ #12460]
+ 	* config.make.in (config-cflags-novzeroupper): Define.
+ 	* configure.in: Substitute libc_cv_cc_novzeroupper.
+ 	* elf/Makefile (AVX-CFLAGS): Define.
+ 	(CFLAGS-tst-audit4.c): Replace -mavx with $(AVX-CFLAGS).
+ 	(CFLAGS-tst-auditmod4a.c): Likewise.
+ 	(CFLAGS-tst-auditmod4b.c): Likewise.
+ 	(CFLAGS-tst-auditmod6b.c): Likewise.
+ 	(CFLAGS-tst-auditmod6c.c): Likewise.
+ 	(CFLAGS-tst-auditmod7b.c): Likewise.
+ 	* sysdeps/i386/configure.in: Check -mno-vzeroupper.
+ 
+ 2011-02-02  Ulrich Drepper  <drepper@gmail.com>
+ 
+ 	* elf/dl-runtime.c (_dl_call_pltexit): Pass correct address of the
+ 	function to the callback.
+ 	Patch partly by Jiri Olsa <jolsa@redhat.com>.
+ 
+ 2011-02-02  Andreas Schwab  <schwab@redhat.com>
+ 
+ 	* shadow/sgetspent.c: Check return value of __sgetspent_r instead
+ 	of errno.
+ 
 -2011-01-19  Ulrich Drepper  <drepper@gmail.com>
 -
 -	[BZ #11724]
 -	* elf/dl-deps.c (_dl_map_object_deps): Rewrite sorting determining order
 -	of constructors.
 -	* elf/dl-fini.c (_dl_sort_fini): Rewrite sorting determining order
 -	of destructors.
 -	(_dl_fini): Don't call _dl_sort_fini if there is only one object.
 -
 -	[BZ #11724]
 -	* elf/Makefile: Add rules to build and run new test.
 -	* elf/tst-initorder.c: New file.
 -	* elf/tst-initorder.exp: New file.
 -	* elf/tst-initordera1.c: New file.
 -	* elf/tst-initordera2.c: New file.
 -	* elf/tst-initordera3.c: New file.
 -	* elf/tst-initordera4.c: New file.
 -	* elf/tst-initorderb1.c: New file.
 -	* elf/tst-initorderb2.c: New file.
 -	* elf/tst-order-a1.c: New file.
 -	* elf/tst-order-a2.c: New file.
 -	* elf/tst-order-a3.c: New file.
 -	* elf/tst-order-a4.c: New file.
 -	* elf/tst-order-b1.c: New file.
 -	* elf/tst-order-b2.c: New file.
 -	* elf/tst-order-main.c: New file.
 -	New test case by George Gensure <werkt0@gmail.com>.
++2011-02-03  Andreas Schwab  <schwab@redhat.com>
++
 +	* login/programs/pt_chown.c (main): Check for valid file
 +	descriptor instead of privileges.  Be careful to drop all
 +	capabilities when not needed.
  
  2010-10-01  Andreas Schwab  <schwab@redhat.com>
  
diff --cc NEWS
index 7444b9d,836160d..b7bbc92
--- a/NEWS
+++ b/NEWS
@@@ -5,6 -5,12 +5,12 @@@ See the end for copying conditions
  Please send GNU C library bug reports via <http://sources.redhat.com/bugzilla/>
  using `glibc' in the "product" field.
  
+ Version 2.14
+ 
+ * The following bugs are resolved with this release:
+ 
 -  11724, 12460
++  12460
+ 
  Version 2.13
  
  * The following bugs are resolved with this release:
diff --cc elf/Makefile
index 02fa1c9,36ea9b8..f84b833
--- a/elf/Makefile
+++ b/elf/Makefile
@@@ -1171,11 -1174,21 +1171,15 @@@ $(objpfx)tst-unique1.out: $(objpfx)tst-
  $(objpfx)tst-unique2: $(libdl) $(objpfx)tst-unique2mod1.so
  $(objpfx)tst-unique2.out: $(objpfx)tst-unique2mod2.so
  
 -$(objpfx)tst-initorder.out: $(objpfx)tst-initorder
 -	$(elf-objpfx)${rtld-installed-name} \
 -	  --library-path $(rpath-link)$(patsubst %,:%,$(sysdep-library-path)) \
 -	  $< > $@
 -	cmp $@ tst-initorder.exp > /dev/null
 -
  ifeq (yes,$(config-cflags-avx))
- CFLAGS-tst-audit4.c += -mavx
- CFLAGS-tst-auditmod4a.c += -mavx
- CFLAGS-tst-auditmod4b.c += -mavx
- CFLAGS-tst-auditmod6b.c += -mavx
- CFLAGS-tst-auditmod6c.c += -mavx
- CFLAGS-tst-auditmod7b.c += -mavx
+ AVX-CFLAGS=-mavx
+ ifeq (yes,$(config-cflags-novzeroupper))
+ AVX-CFLAGS+=-mno-vzeroupper
+ endif
+ CFLAGS-tst-audit4.c += $(AVX-CFLAGS)
+ CFLAGS-tst-auditmod4a.c += $(AVX-CFLAGS)
+ CFLAGS-tst-auditmod4b.c += $(AVX-CFLAGS)
+ CFLAGS-tst-auditmod6b.c += $(AVX-CFLAGS)
+ CFLAGS-tst-auditmod6c.c += $(AVX-CFLAGS)
+ CFLAGS-tst-auditmod7b.c += $(AVX-CFLAGS)
  endif

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=ce360d3d34e41e1b03d942c51e5694d6a34b093f

commit ce360d3d34e41e1b03d942c51e5694d6a34b093f
Author: Andreas Schwab <schwab@redhat.com>
Date:   Mon Feb 14 16:20:39 2011 +0100

    Revert "Fix ordering of DSO constructors and destructors."
    
    This reverts commit 968dad0ab1f367a087ff4ad503b511dd0c565adc.

diff --git a/ChangeLog b/ChangeLog
index 00ed3fd..02071ec 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,33 +4,6 @@
 	descriptor instead of privileges.  Be careful to drop all
 	capabilities when not needed.
 
-2011-01-19  Ulrich Drepper  <drepper@gmail.com>
-
-	* elf/dl-deps.c (_dl_map_object_deps): Rewrite sorting determining order
-	of constructors.
-	* elf/dl-fini.c (_dl_sort_fini): Rewrite sorting determining order
-	of destructors.
-	(_dl_fini): Don't call _dl_sort_fini if there is only one object.
-
-	[BZ #11724]
-	* elf/Makefile: Add rules to build and run new test.
-	* elf/tst-initorder.c: New file.
-	* elf/tst-initorder.exp: New file.
-	* elf/tst-initordera1.c: New file.
-	* elf/tst-initordera2.c: New file.
-	* elf/tst-initordera3.c: New file.
-	* elf/tst-initordera4.c: New file.
-	* elf/tst-initorderb1.c: New file.
-	* elf/tst-initorderb2.c: New file.
-	* elf/tst-order-a1.c: New file.
-	* elf/tst-order-a2.c: New file.
-	* elf/tst-order-a3.c: New file.
-	* elf/tst-order-a4.c: New file.
-	* elf/tst-order-b1.c: New file.
-	* elf/tst-order-b2.c: New file.
-	* elf/tst-order-main.c: New file.
-	New test case by George Gensure <werkt0@gmail.com>.
-
 2010-10-01  Andreas Schwab  <schwab@redhat.com>
 
 	* sysdeps/posix/getaddrinfo.c (gaih_inet): Don't discard result of
diff --git a/elf/Makefile b/elf/Makefile
index c169df5..02fa1c9 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -119,10 +119,7 @@ distribute	:= rtld-Rules \
 		   ifuncmain7.c ifuncmain7pic.c ifuncmain7picstatic.c \
 		   ifuncmain7pie.c ifuncmain7static.c \
 		   tst-unique1.c tst-unique1mod1.c tst-unique1mod2.c \
-		   tst-unique2.c tst-unique2mod1.c tst-unique2mod2.c \
-			 tst-initordera1.c tst-initordera2.c tst-initorderb1.c \
-			 tst-initorderb2.c tst-initordera3.c tst-initordera4.c \
-			 tst-initorder.c
+		   tst-unique2.c tst-unique2mod1.c tst-unique2mod2.c
 
 CFLAGS-dl-runtime.c = -fexceptions -fasynchronous-unwind-tables
 CFLAGS-dl-lookup.c = -fexceptions -fasynchronous-unwind-tables
@@ -203,8 +200,7 @@ tests += loadtest restest1 preloadtest loadfail multiload origtest resolvfail \
 	 unload3 unload4 unload5 unload6 unload7 unload8 tst-global1 order2 \
 	 tst-audit1 tst-audit2 \
 	 tst-stackguard1 tst-addr1 tst-thrlock \
-	 tst-unique1 tst-unique2 \
-	 tst-initorder
+	 tst-unique1 tst-unique2
 #	 reldep9
 test-srcs = tst-pathopt
 tests-execstack-yes = tst-execstack tst-execstack-needed tst-execstack-prog
@@ -257,10 +253,7 @@ modules-names = testobj1 testobj2 testobj3 testobj4 testobj5 testobj6 \
 		unload8mod1 unload8mod1x unload8mod2 unload8mod3 \
 		order2mod1 order2mod2 order2mod3 order2mod4 \
 		tst-unique1mod1 tst-unique1mod2 \
-		tst-unique2mod1 tst-unique2mod2 \
-		tst-initordera1 tst-initorderb1 \
-		tst-initordera2 tst-initorderb2 \
-		tst-initordera3 tst-initordera4
+		tst-unique2mod1 tst-unique2mod2
 ifeq (yes,$(have-initfini-array))
 modules-names += tst-array2dep tst-array5dep
 endif
@@ -544,11 +537,6 @@ $(objpfx)unload7mod2.so: $(objpfx)unload7mod1.so
 $(objpfx)unload8mod1.so: $(objpfx)unload8mod2.so
 $(objpfx)unload8mod2.so: $(objpfx)unload8mod3.so
 $(objpfx)unload8mod3.so: $(libdl)
-$(objpfx)tst-initordera2.so: $(objpfx)tst-initordera1.so
-$(objpfx)tst-initorderb2.so: $(objpfx)tst-initorderb1.so $(objpfx)tst-initordera2.so
-$(objpfx)tst-initordera3.so: $(objpfx)tst-initorderb2.so $(objpfx)tst-initorderb1.so
-$(objpfx)tst-initordera4.so: $(objpfx)tst-initordera3.so
-$(objpfx)tst-initorder: $(objpfx)tst-initordera4.so $(objpfx)tst-initordera1.so $(objpfx)tst-initorderb2.so
 
 LDFLAGS-tst-tlsmod5.so = -nostdlib
 LDFLAGS-tst-tlsmod6.so = -nostdlib
@@ -1183,12 +1171,6 @@ $(objpfx)tst-unique1.out: $(objpfx)tst-unique1mod1.so \
 $(objpfx)tst-unique2: $(libdl) $(objpfx)tst-unique2mod1.so
 $(objpfx)tst-unique2.out: $(objpfx)tst-unique2mod2.so
 
-$(objpfx)tst-initorder.out: $(objpfx)tst-initorder
-	$(elf-objpfx)${rtld-installed-name} \
-	  --library-path $(rpath-link)$(patsubst %,:%,$(sysdep-library-path)) \
-	  $< > $@
-	cmp $@ tst-initorder.exp > /dev/null
-
 ifeq (yes,$(config-cflags-avx))
 CFLAGS-tst-audit4.c += -mavx
 CFLAGS-tst-auditmod4a.c += -mavx
diff --git a/elf/dl-deps.c b/elf/dl-deps.c
index c32ae02..1cab2d1 100644
--- a/elf/dl-deps.c
+++ b/elf/dl-deps.c
@@ -1,5 +1,5 @@
 /* Load the dependencies of a mapped object.
-   Copyright (C) 1996-2003, 2004, 2005, 2006, 2007, 2010, 2011
+   Copyright (C) 1996-2003, 2004, 2005, 2006, 2007, 2010
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -592,7 +592,7 @@ Filters not supported with LD_TRACE_PRELINKING"));
 	    /* Need to allocate new array of relocation dependencies.  */
 	    struct link_map_reldeps *l_reldeps;
 	    l_reldeps = malloc (sizeof (*l_reldeps)
-				+ map->l_reldepsmax
+	    			+ map->l_reldepsmax
 				  * sizeof (struct link_map *));
 	    if (l_reldeps == NULL)
 	      /* Bad luck, keep the reldeps duplicated between
@@ -617,60 +617,48 @@ Filters not supported with LD_TRACE_PRELINKING"));
   /* Now determine the order in which the initialization has to happen.  */
   memcpy (l_initfini, map->l_searchlist.r_list,
 	  nlist * sizeof (struct link_map *));
-
   /* We can skip looking for the binary itself which is at the front
-     of the search list.  */
-  assert (nlist > 1);
-  i = 1;
-  bool seen[nlist];
-  memset (seen, false, nlist * sizeof (seen[0]));
-  while (1)
+     of the search list.  Look through the list backward so that circular
+     dependencies are not changing the order.  */
+  for (i = 1; i < nlist; ++i)
     {
-      /* Keep track of which object we looked at this round.  */
-      seen[i] = true;
-      struct link_map *thisp = l_initfini[i];
-
-      /* Find the last object in the list for which the current one is
-	 a dependency and move the current object behind the object
-	 with the dependency.  */
-      unsigned int k = nlist - 1;
-      while (k > i)
+      struct link_map *l = map->l_searchlist.r_list[i];
+      unsigned int j;
+      unsigned int k;
+
+      /* Find the place in the initfini list where the map is currently
+	 located.  */
+      for (j = 1; l_initfini[j] != l; ++j)
+	;
+
+      /* Find all object for which the current one is a dependency and
+	 move the found object (if necessary) in front.  */
+      for (k = j + 1; k < nlist; ++k)
 	{
-	  struct link_map **runp = l_initfini[k]->l_initfini;
+	  struct link_map **runp;
+
+	  runp = l_initfini[k]->l_initfini;
 	  if (runp != NULL)
-	    /* Look through the dependencies of the object.  */
-	    while (*runp != NULL)
-	      if (__builtin_expect (*runp++ == thisp, 0))
-		{
-		  /* Move the current object to the back past the last
-		     object with it as the dependency.  */
-		  memmove (&l_initfini[i], &l_initfini[i + 1],
-			   (k - i) * sizeof (l_initfini[0]));
-		  l_initfini[k] = thisp;
-
-		  if (seen[i + 1])
-		    {
-		      ++i;
-		      goto next_clear;
-		    }
-
-		  memmove (&seen[i], &seen[i + 1], (k - i) * sizeof (seen[0]));
-		  seen[k] = true;
-
-		  goto next;
-		}
-
-	  --k;
-	}
+	    {
+	      while (*runp != NULL)
+		if (__builtin_expect (*runp++ == l, 0))
+		  {
+		    struct link_map *here = l_initfini[k];
 
-      if (++i == nlist)
-	break;
-    next_clear:
-      memset (&seen[i], false, (nlist - i) * sizeof (seen[0]));
+		    /* Move it now.  */
+		    memmove (&l_initfini[j] + 1, &l_initfini[j],
+			     (k - j) * sizeof (struct link_map *));
+		    l_initfini[j] = here;
 
-    next:;
-    }
+		    /* Don't insert further matches before the last
+		       entry moved to the front.  */
+		    ++j;
 
+		    break;
+		  }
+	    }
+	}
+    }
   /* Terminate the list of dependencies.  */
   l_initfini[nlist] = NULL;
   atomic_write_barrier ();
diff --git a/elf/dl-fini.c b/elf/dl-fini.c
index ba6c62a..ff4c33e 100644
--- a/elf/dl-fini.c
+++ b/elf/dl-fini.c
@@ -1,6 +1,5 @@
 /* Call the termination functions of loaded shared objects.
-   Copyright (C) 1995,96,1998-2002,2004-2005,2009,2011
-   Free Software Foundation, Inc.
+   Copyright (C) 1995,96,1998-2002,2004-2005,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
@@ -33,84 +32,86 @@ internal_function
 _dl_sort_fini (struct link_map *l, struct link_map **maps, size_t nmaps,
 	       char *used, Lmid_t ns)
 {
-  /* We can skip looking for the binary itself which is at the front
-     of the search list for the main namespace.  */
-  assert (nmaps > 1);
-  unsigned int i = ns == LM_ID_BASE;
-  bool seen[nmaps];
-  memset (seen, false, nmaps * sizeof (seen[0]));
-  while (1)
-    {
-      /* Keep track of which object we looked at this round.  */
-      seen[i] = true;
-      struct link_map *thisp = maps[i];
-
-      /* Do not handle ld.so in secondary namespaces and object which
-	 are not removed.  */
-      if (thisp != thisp->l_real || thisp->l_idx == -1)
-	goto skip;
-
-      /* Find the last object in the list for which the current one is
-	 a dependency and move the current object behind the object
-	 with the dependency.  */
-      unsigned int k = nmaps - 1;
-      while (k > i)
-	{
-	  struct link_map **runp = maps[k]->l_initfini;
-	  if (runp != NULL)
-	    /* Look through the dependencies of the object.  */
-	    while (*runp != NULL)
-	      if (__builtin_expect (*runp++ == thisp, 0))
-		{
-		move:
-		  /* Move the current object to the back past the last
-		     object with it as the dependency.  */
-		  memmove (&maps[i], &maps[i + 1],
-			   (k - i) * sizeof (maps[0]));
-		  maps[k] = thisp;
-
-		  if (used != NULL)
+  if (ns == LM_ID_BASE)
+    /* The main executable always comes first.  */
+    l = l->l_next;
+
+  for (; l != NULL; l = l->l_next)
+    /* Do not handle ld.so in secondary namespaces and object which
+       are not removed.  */
+    if (l == l->l_real && l->l_idx != -1)
+      {
+	/* Find the place in the 'maps' array.  */
+	unsigned int j;
+	for (j = ns == LM_ID_BASE ? 1 : 0; maps[j] != l; ++j)
+	  assert (j < nmaps);
+
+	/* Find all object for which the current one is a dependency
+	   and move the found object (if necessary) in front.  */
+	for (unsigned int k = j + 1; k < nmaps; ++k)
+	  {
+	    struct link_map **runp = maps[k]->l_initfini;
+	    if (runp != NULL)
+	      {
+		while (*runp != NULL)
+		  if (*runp == l)
 		    {
-		      char here_used = used[i];
-		      memmove (&used[i], &used[i + 1],
-			       (k - i) * sizeof (used[0]));
-		      used[k] = here_used;
-		    }
+		      struct link_map *here = maps[k];
 
-		  if (seen[i + 1])
-		    {
-		      ++i;
-		      goto next_clear;
-		    }
+		      /* Move it now.  */
+		      memmove (&maps[j] + 1,
+			       &maps[j], (k - j) * sizeof (struct link_map *));
+		      maps[j] = here;
 
-		  memmove (&seen[i], &seen[i + 1], (k - i) * sizeof (seen[0]));
-		  seen[k] = true;
+		      if (used != NULL)
+			{
+			  char here_used = used[k];
 
-		  goto next;
-		}
+			  memmove (&used[j] + 1,
+				   &used[j], (k - j) * sizeof (char));
+			  used[j] = here_used;
+			}
 
-	  if (__builtin_expect (maps[k]->l_reldeps != NULL, 0))
-	    {
-	      unsigned int m = maps[k]->l_reldeps->act;
-	      struct link_map **relmaps = &maps[k]->l_reldeps->list[0];
+		      ++j;
 
-	    /* Look through the relocation dependencies of the object.  */
-	      while (m-- > 0)
-		if (__builtin_expect (relmaps[m] == thisp, 0))
-		  goto move;
-	    }
-
-	  --k;
-	}
-
-    skip:
-      if (++i == nmaps)
-	break;
-    next_clear:
-      memset (&seen[i], false, (nmaps - i) * sizeof (seen[0]));
-
-    next:;
-    }
+		      break;
+		    }
+		  else
+		    ++runp;
+	      }
+
+	    if (__builtin_expect (maps[k]->l_reldeps != NULL, 0))
+	      {
+		unsigned int m = maps[k]->l_reldeps->act;
+		struct link_map **relmaps = &maps[k]->l_reldeps->list[0];
+
+		while (m-- > 0)
+		  {
+		    if (relmaps[m] == l)
+		      {
+			struct link_map *here = maps[k];
+
+			/* Move it now.  */
+			memmove (&maps[j] + 1,
+				 &maps[j],
+				 (k - j) * sizeof (struct link_map *));
+			maps[j] = here;
+
+			if (used != NULL)
+			  {
+			    char here_used = used[k];
+
+			    memmove (&used[j] + 1,
+				     &used[j], (k - j) * sizeof (char));
+			    used[j] = here_used;
+			  }
+
+			break;
+		      }
+		  }
+	      }
+	  }
+      }
 }
 
 
@@ -195,7 +196,7 @@ _dl_fini (void)
       assert (ns == LM_ID_BASE || i == nloaded || i == nloaded - 1);
       nmaps = i;
 
-      if (nmaps > 1)
+      if (nmaps != 0)
 	/* Now we have to do the sorting.  */
 	_dl_sort_fini (GL(dl_ns)[ns]._ns_loaded, maps, nmaps, NULL, ns);
 
diff --git a/elf/tst-initorder.c b/elf/tst-initorder.c
deleted file mode 100644
index 9638382..0000000
--- a/elf/tst-initorder.c
+++ /dev/null
@@ -1,7 +0,0 @@
-#include <stdio.h>
-
-int
-main( int argc, char *argv[] )
-{
-  printf( "main\n" );
-}
diff --git a/elf/tst-initorder.exp b/elf/tst-initorder.exp
deleted file mode 100644
index 8718f65..0000000
--- a/elf/tst-initorder.exp
+++ /dev/null
@@ -1,13 +0,0 @@
-start_a1
-start_a2
-start_b1
-start_b2
-start_a3
-start_a4
-main
-finish_a4
-finish_a3
-finish_b2
-finish_b1
-finish_a2
-finish_a1
diff --git a/elf/tst-initordera1.c b/elf/tst-initordera1.c
deleted file mode 100644
index f161257..0000000
--- a/elf/tst-initordera1.c
+++ /dev/null
@@ -1,16 +0,0 @@
-#include <stdio.h>
-
-extern void start_a1( void ) __attribute__((constructor));
-extern void finish_a1( void ) __attribute__((destructor));
-
-void
-start_a1( void )
-{
-  printf( "start_a1\n" );
-}
-
-void
-finish_a1( void )
-{
-  printf( "finish_a1\n" );
-}
diff --git a/elf/tst-initordera2.c b/elf/tst-initordera2.c
deleted file mode 100644
index a5a9b42..0000000
--- a/elf/tst-initordera2.c
+++ /dev/null
@@ -1,16 +0,0 @@
-#include <stdio.h>
-
-extern void start_a2( void ) __attribute__((constructor));
-extern void finish_a2( void ) __attribute__((destructor));
-
-void
-start_a2( void )
-{
-  printf( "start_a2\n" );
-}
-
-void
-finish_a2( void )
-{
-  printf( "finish_a2\n" );
-}
diff --git a/elf/tst-initordera3.c b/elf/tst-initordera3.c
deleted file mode 100644
index 1c7f496..0000000
--- a/elf/tst-initordera3.c
+++ /dev/null
@@ -1,16 +0,0 @@
-#include <stdio.h>
-
-extern void start_a3( void ) __attribute__((constructor));
-extern void finish_a3( void ) __attribute__((destructor));
-
-void
-start_a3( void )
-{
-  printf( "start_a3\n" );
-}
-
-void
-finish_a3( void )
-{
-  printf( "finish_a3\n" );
-}
diff --git a/elf/tst-initordera4.c b/elf/tst-initordera4.c
deleted file mode 100644
index 70b9f5e..0000000
--- a/elf/tst-initordera4.c
+++ /dev/null
@@ -1,16 +0,0 @@
-#include <stdio.h>
-
-extern void start_a4( void ) __attribute__((constructor));
-extern void finish_a4( void ) __attribute__((destructor));
-
-void
-start_a4( void )
-{
-  printf( "start_a4\n" );
-}
-
-void
-finish_a4( void )
-{
-  printf( "finish_a4\n" );
-}
diff --git a/elf/tst-initorderb1.c b/elf/tst-initorderb1.c
deleted file mode 100644
index 993ea3f..0000000
--- a/elf/tst-initorderb1.c
+++ /dev/null
@@ -1,16 +0,0 @@
-#include <stdio.h>
-
-extern void start_b1( void ) __attribute__((constructor));
-extern void finish_b1( void ) __attribute__((destructor));
-
-void
-start_b1( void )
-{
-  printf( "start_b1\n" );
-}
-
-void
-finish_b1( void )
-{
-  printf( "finish_b1\n" );
-}
diff --git a/elf/tst-initorderb2.c b/elf/tst-initorderb2.c
deleted file mode 100644
index 3334dda..0000000
--- a/elf/tst-initorderb2.c
+++ /dev/null
@@ -1,16 +0,0 @@
-#include <stdio.h>
-
-extern void start_b2( void ) __attribute__((constructor));
-extern void finish_b2( void ) __attribute__((destructor));
-
-void
-start_b2( void )
-{
-  printf( "start_b2\n" );
-}
-
-void
-finish_b2( void )
-{
-  printf( "finish_b2\n" );
-}
diff --git a/elf/tst-order-a1.c b/elf/tst-order-a1.c
deleted file mode 100644
index f161257..0000000
--- a/elf/tst-order-a1.c
+++ /dev/null
@@ -1,16 +0,0 @@
-#include <stdio.h>
-
-extern void start_a1( void ) __attribute__((constructor));
-extern void finish_a1( void ) __attribute__((destructor));
-
-void
-start_a1( void )
-{
-  printf( "start_a1\n" );
-}
-
-void
-finish_a1( void )
-{
-  printf( "finish_a1\n" );
-}
diff --git a/elf/tst-order-a2.c b/elf/tst-order-a2.c
deleted file mode 100644
index a5a9b42..0000000
--- a/elf/tst-order-a2.c
+++ /dev/null
@@ -1,16 +0,0 @@
-#include <stdio.h>
-
-extern void start_a2( void ) __attribute__((constructor));
-extern void finish_a2( void ) __attribute__((destructor));
-
-void
-start_a2( void )
-{
-  printf( "start_a2\n" );
-}
-
-void
-finish_a2( void )
-{
-  printf( "finish_a2\n" );
-}
diff --git a/elf/tst-order-a3.c b/elf/tst-order-a3.c
deleted file mode 100644
index 1c7f496..0000000
--- a/elf/tst-order-a3.c
+++ /dev/null
@@ -1,16 +0,0 @@
-#include <stdio.h>
-
-extern void start_a3( void ) __attribute__((constructor));
-extern void finish_a3( void ) __attribute__((destructor));
-
-void
-start_a3( void )
-{
-  printf( "start_a3\n" );
-}
-
-void
-finish_a3( void )
-{
-  printf( "finish_a3\n" );
-}
diff --git a/elf/tst-order-a4.c b/elf/tst-order-a4.c
deleted file mode 100644
index 70b9f5e..0000000
--- a/elf/tst-order-a4.c
+++ /dev/null
@@ -1,16 +0,0 @@
-#include <stdio.h>
-
-extern void start_a4( void ) __attribute__((constructor));
-extern void finish_a4( void ) __attribute__((destructor));
-
-void
-start_a4( void )
-{
-  printf( "start_a4\n" );
-}
-
-void
-finish_a4( void )
-{
-  printf( "finish_a4\n" );
-}
diff --git a/elf/tst-order-b1.c b/elf/tst-order-b1.c
deleted file mode 100644
index 993ea3f..0000000
--- a/elf/tst-order-b1.c
+++ /dev/null
@@ -1,16 +0,0 @@
-#include <stdio.h>
-
-extern void start_b1( void ) __attribute__((constructor));
-extern void finish_b1( void ) __attribute__((destructor));
-
-void
-start_b1( void )
-{
-  printf( "start_b1\n" );
-}
-
-void
-finish_b1( void )
-{
-  printf( "finish_b1\n" );
-}
diff --git a/elf/tst-order-b2.c b/elf/tst-order-b2.c
deleted file mode 100644
index 3334dda..0000000
--- a/elf/tst-order-b2.c
+++ /dev/null
@@ -1,16 +0,0 @@
-#include <stdio.h>
-
-extern void start_b2( void ) __attribute__((constructor));
-extern void finish_b2( void ) __attribute__((destructor));
-
-void
-start_b2( void )
-{
-  printf( "start_b2\n" );
-}
-
-void
-finish_b2( void )
-{
-  printf( "finish_b2\n" );
-}
diff --git a/elf/tst-order-main.c b/elf/tst-order-main.c
deleted file mode 100644
index 80f4f6b..0000000
--- a/elf/tst-order-main.c
+++ /dev/null
@@ -1,10 +0,0 @@
-#include <stdio.h>
-#include <unistd.h>
-#include <stdlib.h>
-
-int
-main( int argc, char *argv[] )
-{
-  printf( "main\n" );
-  exit(EXIT_SUCCESS);
-}

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=09967d6b9196a22b5c00ce1ec2272599b0aa1d97

commit 09967d6b9196a22b5c00ce1ec2272599b0aa1d97
Author: Andreas Schwab <schwab@redhat.com>
Date:   Mon Feb 14 16:19:46 2011 +0100

    Revert "Patch followup."
    
    This reverts commit 9f94d2ea71aaf73f964f8c1de5da85df94ef25bb.

diff --git a/ChangeLog b/ChangeLog
index 0e4ac83..00ed3fd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,7 +6,6 @@
 
 2011-01-19  Ulrich Drepper  <drepper@gmail.com>
 
-	[BZ #11724]
 	* elf/dl-deps.c (_dl_map_object_deps): Rewrite sorting determining order
 	of constructors.
 	* elf/dl-fini.c (_dl_sort_fini): Rewrite sorting determining order
diff --git a/NEWS b/NEWS
index b6db53c..7444b9d 100644
--- a/NEWS
+++ b/NEWS
@@ -1,16 +1,10 @@
-GNU C Library NEWS -- history of user-visible changes.  2011-1-19
+GNU C Library NEWS -- history of user-visible changes.  2011-1-15
 Copyright (C) 1992-2009, 2010, 2011 Free Software Foundation, Inc.
 See the end for copying conditions.
 
 Please send GNU C library bug reports via <http://sources.redhat.com/bugzilla/>
 using `glibc' in the "product" field.
 
-Version 2.1
-
-* The following bugs are resolved with this release:
-
-  11724
-
 Version 2.13
 
 * The following bugs are resolved with this release:

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=19e6b7786f4f63d9978bd3965014bfaea292d626

commit 19e6b7786f4f63d9978bd3965014bfaea292d626
Author: Andreas Schwab <schwab@redhat.com>
Date:   Thu Feb 10 18:00:17 2011 +0100

    Create debuginfo-common on biarch archs

diff --git a/fedora/glibc.spec.in b/fedora/glibc.spec.in
index b1d1ec2..c6fda9d 100644
--- a/fedora/glibc.spec.in
+++ b/fedora/glibc.spec.in
@@ -14,7 +14,8 @@
 %define buildpower6 0
 %endif
 %define rtkaioarches %{ix86} x86_64 ia64 ppc ppc64 s390 s390x
-%define debuginfocommonarches alpha alphaev6
+%define biarcharches %{ix86} x86_64 ppc ppc64
+%define debuginfocommonarches %{biarcharches} alpha alphaev6
 %define multiarcharches ppc ppc64 %{ix86} x86_64 %{sparc}
 
 Summary: The GNU libc libraries
@@ -789,12 +790,12 @@ eu-readelf -hS $RPM_BUILD_ROOT/usr/bin/getconf $RPM_BUILD_ROOT/usr/libexec/getco
 find_debuginfo_args='--strict-build-id -g'
 %ifarch %{debuginfocommonarches}
 find_debuginfo_args="$find_debuginfo_args \
-  -l common.filelist -l utils.filelist -l nscd.filelist \
+  -l common.filelist -l utils.filelist -l nscd.filelist -p '.*/sbin/.*' \
   -o debuginfocommon.filelist \
   -l rpm.filelist -l nosegneg.filelist \
 "
 %endif
-/usr/lib/rpm/find-debuginfo.sh $find_debuginfo_args -o debuginfo.filelist
+eval /usr/lib/rpm/find-debuginfo.sh "$find_debuginfo_args" -o debuginfo.filelist
 
 list_debug_archives()
 {
@@ -804,6 +805,17 @@ list_debug_archives()
 
 %ifarch %{debuginfocommonarches}
 
+sed -i '\#^%{_prefix}/src/debug/#d' debuginfocommon.filelist
+find $RPM_BUILD_ROOT%{_prefix}/src/debug \
+     \( -type d -printf '%%%%dir ' \) , \
+     -printf '%{_prefix}/src/debug/%%P\n' > debuginfocommon.sources
+
+%ifarch %{biarcharches}
+
+cat debuginfocommon.sources >> debuginfo.filelist
+
+%else
+
 %ifarch %{ix86}
 %define basearch i686
 %endif
@@ -814,11 +826,6 @@ list_debug_archives()
 %define basearch sparc
 %endif
 
-sed -i '\#^%{_prefix}/src/debug/#d' debuginfocommon.filelist
-find $RPM_BUILD_ROOT%{_prefix}/src/debug \
-     \( -type d -printf '%%%%dir ' \) , \
-     -printf '%{_prefix}/src/debug/%%P\n' > debuginfocommon.sources
-
 # auxarches get only these few source files
 auxarches_debugsources=\
 '/(generic|linux|%{basearch}|nptl(_db)?)/|/%{glibcsrcdir}/build|/dl-osinfo\.h'
@@ -828,6 +835,8 @@ egrep "$auxarches_debugsources" debuginfocommon.sources >> debuginfo.filelist
 egrep -v "$auxarches_debugsources" \
   debuginfocommon.sources >> debuginfocommon.filelist
 
+%endif
+
 list_debug_archives >> debuginfocommon.filelist
 
 %endif

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=9750f3f8c462c748242e784c1787a0e19f4c01d5

commit 9750f3f8c462c748242e784c1787a0e19f4c01d5
Author: Andreas Schwab <schwab@redhat.com>
Date:   Wed Feb 9 15:01:38 2011 +0100

    Revert "Revert "Workaround assembler bug sneaking in nopl""
    
    This reverts commit fff824a566ae57189af979d8113424dc010ee09f.

diff --git a/ChangeLog b/ChangeLog
index 2e9df84..0e4ac83 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1537,6 +1537,10 @@
 	* elf/dl-close.c (_dl_close_worker): Reset private search list if
 	it wasn't used.
 
+2010-06-21  Andreas Schwab  <schwab@redhat.com>
+
+	* sysdeps/i386/i686/Makefile: Don't pass -mtune to assembler.
+
 2010-06-07  Andreas Schwab  <schwab@redhat.com>
 
 	* dlfcn/Makefile: Remove explicit dependencies on libc.so and
diff --git a/sysdeps/i386/i686/Makefile b/sysdeps/i386/i686/Makefile
index e6b2924..dbcf1c3 100644
--- a/sysdeps/i386/i686/Makefile
+++ b/sysdeps/i386/i686/Makefile
@@ -9,19 +9,3 @@ stack-align-test-flags += -msse
 ifeq ($(subdir),string)
 sysdep_routines += cacheinfo
 endif
-
-ifeq (yes,$(config-asflags-i686))
-CFLAGS-.o += -Wa,-mtune=i686
-CFLAGS-.os += -Wa,-mtune=i686
-CFLAGS-.op += -Wa,-mtune=i686
-CFLAGS-.og += -Wa,-mtune=i686
-CFLAGS-.ob += -Wa,-mtune=i686
-CFLAGS-.oS += -Wa,-mtune=i686
-
-ASFLAGS-.o += -Wa,-mtune=i686
-ASFLAGS-.os += -Wa,-mtune=i686
-ASFLAGS-.op += -Wa,-mtune=i686
-ASFLAGS-.og += -Wa,-mtune=i686
-ASFLAGS-.ob += -Wa,-mtune=i686
-ASFLAGS-.oS += -Wa,-mtune=i686
-endif

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=ee3d4021aaaeacff7cf2addcdaa48859fffba2aa

commit ee3d4021aaaeacff7cf2addcdaa48859fffba2aa
Author: Andreas Schwab <schwab@redhat.com>
Date:   Thu Feb 3 15:45:02 2011 +0100

    Replace setuid by file capabilities

diff --git a/ChangeLog b/ChangeLog
index 6e4875e..2e9df84 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2011-02-03  Andreas Schwab  <schwab@redhat.com>
+
+	* login/programs/pt_chown.c (main): Check for valid file
+	descriptor instead of privileges.  Be careful to drop all
+	capabilities when not needed.
+
 2011-01-19  Ulrich Drepper  <drepper@gmail.com>
 
 	[BZ #11724]
diff --git a/fedora/glibc.spec.in b/fedora/glibc.spec.in
index 6eda615..b1d1ec2 100644
--- a/fedora/glibc.spec.in
+++ b/fedora/glibc.spec.in
@@ -984,7 +984,7 @@ rm -f *.filelist*
 %attr(0644,root,root) %verify(not md5 size mtime mode) %ghost %config(missingok,noreplace) %{_prefix}/lib/locale/locale-archive
 %dir %attr(755,root,root) /etc/default
 %verify(not md5 size mtime) %config(noreplace) /etc/default/nss
-%attr(4711,root,root) %{_prefix}/libexec/pt_chown
+%attr(755,root,root) %caps(cap_chown,cap_fowner=pe) %{_prefix}/libexec/pt_chown
 %doc documentation/*
 
 %files -f devel.filelist devel
diff --git a/login/programs/pt_chown.c b/login/programs/pt_chown.c
index 4c36f2ce..4629e2f 100644
--- a/login/programs/pt_chown.c
+++ b/login/programs/pt_chown.c
@@ -29,6 +29,7 @@
 #include <string.h>
 #include <sys/stat.h>
 #include <unistd.h>
+#include <fcntl.h>
 #ifdef HAVE_LIBCAP
 # include <sys/capability.h>
 # include <sys/prctl.h>
@@ -143,7 +144,7 @@ main (int argc, char *argv[])
   uid_t uid = getuid ();
   int remaining;
 
-  if (argc == 1 && euid == 0)
+  if (argc == 1 && fcntl (PTY_FILENO, F_GETFD) == 0)
     {
 #ifdef HAVE_LIBCAP
   /* Drop privileges.  */
@@ -176,6 +177,13 @@ main (int argc, char *argv[])
 
   /* We aren't going to be using privileges, so drop them right now. */
   setuid (uid);
+#ifdef HAVE_LIBCAP
+  cap_t caps = cap_init ();
+  if (caps == NULL)
+    error (1, errno, "cap_init");
+  cap_set_proc (caps);
+  cap_free (caps);
+#endif
 
   /* Set locale via LC_ALL.  */
   setlocale (LC_ALL, "");
@@ -195,9 +203,5 @@ main (int argc, char *argv[])
       return EXIT_FAILURE;
     }
 
-  /* Check if we are properly installed.  */
-  if (euid != 0)
-    error (FAIL_EXEC, 0, gettext ("needs to be installed setuid `root'"));
-
   return EXIT_SUCCESS;
 }

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                                          |  208 +++++-
 Makeconfig                                         |    6 +-
 Makerules                                          |    8 +-
 NEWS                                               |    6 +-
 aclocal.m4                                         |   13 +-
 bits/sched.h                                       |   87 ++-
 config.make.in                                     |    1 +
 configure                                          |  134 +----
 configure.in                                       |   23 +-
 elf/Makefile                                       |   22 +-
 elf/dl-close.c                                     |   15 +-
 elf/dl-deps.c                                      |   97 ++--
 elf/dl-libc.c                                      |    6 +-
 elf/dl-load.c                                      |    2 +
 elf/dl-object.c                                    |    4 +-
 elf/dl-runtime.c                                   |    3 +-
 elf/elf.h                                          |    8 +-
 elf/noload.c                                       |   22 +-
 elf/rtld-Rules                                     |    4 +-
 elf/rtld.c                                         |    5 +-
 fedora/glibc.spec.in                               |   50 +-
 include/link.h                                     |    8 +-
 libidn/configure                                   |    4 +-
 login/programs/pt_chown.c                          |   14 +-
 manual/install.texi                                |    4 +-
 nis/nis_add.c                                      |    4 +-
 nis/nis_modify.c                                   |    4 +-
 nis/nis_remove.c                                   |    4 +-
 nis/nis_server.c                                   |    6 +-
 nis/nis_table.c                                    |    4 +-
 nptl/sysdeps/pthread/configure                     |  242 ++++---
 nptl/sysdeps/x86_64/configure                      |   98 +++-
 nscd/aicache.c                                     |   22 +-
 nscd/cache.c                                       |   13 +-
 nscd/connections.c                                 |    7 +-
 nscd/grpcache.c                                    |   30 +-
 nscd/hstcache.c                                    |   42 +-
 nscd/initgrcache.c                                 |   19 +-
 nscd/nscd-client.h                                 |    9 +-
 nscd/nscd.h                                        |   46 +-
 nscd/pwdcache.c                                    |   35 +-
 nscd/servicescache.c                               |   28 +-
 posix/fnmatch_loop.c                               |    4 +-
 shadow/sgetspent.c                                 |    6 +-
 stdio-common/Makefile                              |    2 +-
 stdio-common/_i18n_number.h                        |   14 +-
 stdio-common/bug23.c                               |   21 +
 stdio-common/printf-parsemb.c                      |    6 +-
 stdio-common/psiginfo.c                            |    7 +-
 stdio-common/vfprintf.c                            |    5 +-
 sysdeps/i386/configure                             |  757 +++++++++++---------
 sysdeps/i386/configure.in                          |    8 +
 sysdeps/i386/i686/Makefile                         |   16 -
 sysdeps/mach/hurd/ifreq.h                          |   45 ++
 sysdeps/mach/i386/sysdep.h                         |    5 +
 sysdeps/mach/i386/thread_state.h                   |    5 +
 sysdeps/powerpc/powerpc64/power7/Makefile          |    5 +
 sysdeps/unix/sysv/linux/configure                  |  196 ++++--
 sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h |    4 +-
 sysdeps/unix/sysv/linux/sparc/bits/socket.h        |   30 +-
 sysdeps/wordsize-64/Makefile                       |    6 +
 sysdeps/wordsize-64/tst-writev.c                   |  107 +++
 sysdeps/x86_64/elf/configure                       |  104 +++-
 sysdeps/x86_64/elf/configure.in                    |    1 +
 sysdeps/x86_64/multiarch/memset-x86-64.S           |    1 +
 65 files changed, 1762 insertions(+), 960 deletions(-)
 create mode 100644 stdio-common/bug23.c
 create mode 100644 sysdeps/mach/hurd/ifreq.h
 create mode 100644 sysdeps/powerpc/powerpc64/power7/Makefile
 create mode 100644 sysdeps/wordsize-64/Makefile
 create mode 100644 sysdeps/wordsize-64/tst-writev.c


hooks/post-receive
-- 
GNU C Library master sources



More information about the Glibc-cvs mailing list