This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.17-635-g3612972


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, master has been updated
       via  36129722342bed6b3f3729b922c2e513c404ba61 (commit)
      from  ed41ffefc3f947f14d565ea8d239ff2d31f6a7fe (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://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=36129722342bed6b3f3729b922c2e513c404ba61

commit 36129722342bed6b3f3729b922c2e513c404ba61
Author: Carlos O'Donell <carlos@redhat.com>
Date:   Thu May 9 17:37:15 2013 -0400

    Add more comments to dlclose() algorithm.
    
    The algorithm for scanning dependencies upon dlclose is
    less than immediately obvious. This patch adds two bits
    of comments that explain why you start the dependency
    search at l_initfini[1], and why you need to restart
    the search.
    
    ---
    
    2013-05-09  Carlos O'Donell  <carlos@redhat.com>
    
    	* elf/dl-close.c (_dl_close_worker): Add comments.

diff --git a/ChangeLog b/ChangeLog
index 619ce64..d9c38d2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2013-05-09  Carlos O'Donell  <carlos@redhat.com>
+
+	* elf/dl-close.c (_dl_close_worker): Add comments.
+
 2013-05-09  Joseph Myers  <joseph@codesourcery.com>
 
 	[BZ #15359]
diff --git a/elf/dl-close.c b/elf/dl-close.c
index c86f609..fe3014c 100644
--- a/elf/dl-close.c
+++ b/elf/dl-close.c
@@ -183,6 +183,8 @@ _dl_close_worker (struct link_map *map)
       /* Mark all dependencies as used.  */
       if (l->l_initfini != NULL)
 	{
+	  /* We are always the zeroth entry, and since we don't include
+	     ourselves in the dependency analysis start at 1.  */
 	  struct link_map **lp = &l->l_initfini[1];
 	  while (*lp != NULL)
 	    {
@@ -193,6 +195,10 @@ _dl_close_worker (struct link_map *map)
 		  if (!used[(*lp)->l_idx])
 		    {
 		      used[(*lp)->l_idx] = 1;
+		      /* If we marked a new object as used, and we've
+			 already processed it, then we need to go back
+			 and process again from that point forward to
+			 ensure we keep all of its dependencies also.  */
 		      if ((*lp)->l_idx - 1 < done_index)
 			done_index = (*lp)->l_idx - 1;
 		    }

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

Summary of changes:
 ChangeLog      |    4 ++++
 elf/dl-close.c |    6 ++++++
 2 files changed, 10 insertions(+), 0 deletions(-)


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]