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

r4699 - in glibc-package/trunk/debian: . patches patches/any



Author: aurel32
Date: 2011-06-04 12:41:33 +0000 (Sat, 04 Jun 2011)
New Revision: 4699

Added:
   glibc-package/trunk/debian/patches/any/cvs-dl-deps.diff
Removed:
   glibc-package/trunk/debian/patches/any/local-dl-deps.diff
Modified:
   glibc-package/trunk/debian/changelog
   glibc-package/trunk/debian/patches/series
Log:
  * Replace patches/any/local-dl-deps.diff by upstream version 
    patches/any/cvs-dl-deps.diff.



Modified: glibc-package/trunk/debian/changelog
===================================================================
--- glibc-package/trunk/debian/changelog	2011-06-04 12:01:02 UTC (rev 4698)
+++ glibc-package/trunk/debian/changelog	2011-06-04 12:41:33 UTC (rev 4699)
@@ -33,6 +33,8 @@
   * Add patches/any/cvs-unique_sym_table-corruptions.diff to fix 
     unique_sym_table corruptions when doing STB_GNU_UNIQUE or 
     ELF_RTYPE_CLASS_COPY lookups.
+  * Replace patches/any/local-dl-deps.diff by upstream version 
+    patches/any/cvs-dl-deps.diff.
 
   [ Steve Langasek ]
   * Tighten the dependency on dpkg to a multiarch aware version.

Added: glibc-package/trunk/debian/patches/any/cvs-dl-deps.diff
===================================================================
--- glibc-package/trunk/debian/patches/any/cvs-dl-deps.diff	                        (rev 0)
+++ glibc-package/trunk/debian/patches/any/cvs-dl-deps.diff	2011-06-04 12:41:33 UTC (rev 4699)
@@ -0,0 +1,153 @@
+2011-05-30  Ulrich Drepper  <drepper@gmail.com>
+ 
+	[BZ #12454]
+	* elf/dl-deps.c (_dl_map_object_deps): Run initializer sorting only
+	when there are multiple maps.
+	* elf/dl-fini.c (_dl_sort_fini): Check for list of one.
+	(_dl_fini): Remove test here.
+ 
+diff --git a/elf/dl-deps.c b/elf/dl-deps.c
+index d3c27f1..0b03b90 100644
+--- a/elf/dl-deps.c
++++ b/elf/dl-deps.c
+@@ -617,61 +617,64 @@ Filters not supported with LD_TRACE_PRELINKING"));
+ 	map->l_searchlist.r_list[i]->l_reserved = 0;
+     }
+ 
+-  /* Now determine the order in which the initialization has to happen.  */
++  /* Sort the initializer list to take dependencies into account.  The binary
++     itself will always be initialize last.  */
+   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)
++  if (__builtin_expect (nlist > 1, 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)
++      /* We can skip looking for the binary itself which is at the front
++	 of the search list.  */
++      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.  */
+diff --git a/elf/dl-fini.c b/elf/dl-fini.c
+index ba6c62a..269bcec 100644
+--- a/elf/dl-fini.c
++++ b/elf/dl-fini.c
+@@ -33,9 +33,12 @@ internal_function
+ _dl_sort_fini (struct link_map *l, struct link_map **maps, size_t nmaps,
+ 	       char *used, Lmid_t ns)
+ {
++  /* A list of one element need not be sorted.  */
++  if (nmaps == 1)
++    return;
++
+   /* 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]));
+@@ -195,9 +198,8 @@ _dl_fini (void)
+       assert (ns == LM_ID_BASE || i == nloaded || i == nloaded - 1);
+       nmaps = i;
+ 
+-      if (nmaps > 1)
+-	/* Now we have to do the sorting.  */
+-	_dl_sort_fini (GL(dl_ns)[ns]._ns_loaded, maps, nmaps, NULL, ns);
++      /* Now we have to do the sorting.  */
++      _dl_sort_fini (GL(dl_ns)[ns]._ns_loaded, maps, nmaps, NULL, ns);
+ 
+       /* We do not rely on the linked list of loaded object anymore from
+ 	 this point on.  We have our own list here (maps).  The various
+

Deleted: glibc-package/trunk/debian/patches/any/local-dl-deps.diff
===================================================================
--- glibc-package/trunk/debian/patches/any/local-dl-deps.diff	2011-06-04 12:01:02 UTC (rev 4698)
+++ glibc-package/trunk/debian/patches/any/local-dl-deps.diff	2011-06-04 12:41:33 UTC (rev 4699)
@@ -1,33 +0,0 @@
-diff --git a/elf/dl-close.c b/elf/dl-close.c
-index efb2b58..3991e65 100644
---- a/elf/dl-close.c
-+++ b/elf/dl-close.c
-@@ -231,7 +231,8 @@ _dl_close_worker (struct link_map *map)
-     }
- 
-   /* Sort the entries.  */
--  _dl_sort_fini (ns->_ns_loaded, maps, nloaded, used, nsid);
-+  if (nloaded > 1)
-+    _dl_sort_fini (ns->_ns_loaded, maps, nloaded, used, nsid);
- 
-   /* Call all termination functions at once.  */
- #ifdef SHARED
-diff --git a/elf/dl-deps.c b/elf/dl-deps.c
-index d3c27f1..ed27090 100644
---- a/elf/dl-deps.c
-+++ b/elf/dl-deps.c
-@@ -623,11 +623,11 @@ 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);
-+  assert (nlist > 0);
-   i = 1;
-   bool seen[nlist];
-   memset (seen, false, nlist * sizeof (seen[0]));
--  while (1)
-+  while (nlist > 1)
-     {
-       /* Keep track of which object we looked at this round.  */
-       seen[i] = true;
-

Modified: glibc-package/trunk/debian/patches/series
===================================================================
--- glibc-package/trunk/debian/patches/series	2011-06-04 12:01:02 UTC (rev 4698)
+++ glibc-package/trunk/debian/patches/series	2011-06-04 12:41:33 UTC (rev 4699)
@@ -253,7 +253,7 @@
 any/local-ldconfig-multiarch.diff
 any/cvs-fopen.diff
 any/submitted-fwrite-wur.diff
-any/local-dl-deps.diff
+any/cvs-dl-deps.diff
 any/cvs-resolv-tld.diff
 any/cvs-sys-param-ARG_MAX.diff
 any/submitted-at-pagesize.diff


Reply to: