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]

Community source repository for glibc add-on ports branch, master, updated. glibc-2.15-54-g7865d19


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 "Community source repository for glibc add-on ports".

The branch, master has been updated
       via  7865d19cf68bcfb32c12fa3e7ce6a85fb4738383 (commit)
      from  b991ef778a9e56dce09664f24dd35b0ae5c4b4e2 (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-ports.git;a=commitdiff;h=7865d19cf68bcfb32c12fa3e7ce6a85fb4738383

commit 7865d19cf68bcfb32c12fa3e7ce6a85fb4738383
Author: Viju Vincent <vijuvince@gmail.com>
Date:   Wed Feb 15 17:25:51 2012 +0000

    Resolve race between dlopen and lazy binding on MIPS.

diff --git a/ChangeLog.mips b/ChangeLog.mips
index ff8cfc2..2a9ed6c 100644
--- a/ChangeLog.mips
+++ b/ChangeLog.mips
@@ -1,3 +1,8 @@
+2012-02-15  Viju Vincent  <vijuvince@gmail.com>
+
+	* sysdeps/mips/dl-trampoline.c (__dl_runtime_resolve): Use locking
+	around calls to _dl_lookup_symbol_x.
+
 2012-02-13  Joseph Myers  <joseph@codesourcery.com>
 
 	* sysdeps/unix/sysv/linux/mips/bits/inotify.h: New file.
diff --git a/sysdeps/mips/dl-trampoline.c b/sysdeps/mips/dl-trampoline.c
index 2c94140..c4367f7 100644
--- a/sysdeps/mips/dl-trampoline.c
+++ b/sysdeps/mips/dl-trampoline.c
@@ -26,6 +26,7 @@
 #include <elf.h>
 #include <ldsodefs.h>
 #include <dl-machine.h>
+#include <sysdep-cancel.h>
 
 /* Get link map for callers object containing STUB_PC.  */
 static inline struct link_map *
@@ -153,17 +154,44 @@ __dl_runtime_resolve (ElfW(Word) sym_index,
 
 	    if (version->hash != 0)
 	      {
+                /* We need to keep the scope around so do some locking.  This is
+		   not necessary for objects which cannot be unloaded or when
+		   we are not using any threads (yet).  */
+		if (!RTLD_SINGLE_THREAD_P)
+		  THREAD_GSCOPE_SET_FLAG ();
+
 		sym_map = _dl_lookup_symbol_x (strtab + sym->st_name, l,
 					       &sym, l->l_scope, version,
 					       ELF_RTYPE_CLASS_PLT, 0, 0);
+
+                /* We are done with the global scope.  */
+		if (!RTLD_SINGLE_THREAD_P)
+		  THREAD_GSCOPE_RESET_FLAG ();
+
 		break;
 	      }
 	    /* Fall through.  */
 	  }
 	case 0:
+	  {
+          /* We need to keep the scope around so do some locking.  This is
+	     not necessary for objects which cannot be unloaded or when
+	     we are not using any threads (yet).  */
+	  int flags = DL_LOOKUP_ADD_DEPENDENCY;
+	  if (!RTLD_SINGLE_THREAD_P)
+	    {
+	      THREAD_GSCOPE_SET_FLAG ();
+	      flags |= DL_LOOKUP_GSCOPE_LOCK;
+	    }
+
 	  sym_map = _dl_lookup_symbol_x (strtab + sym->st_name, l, &sym,
 					 l->l_scope, 0, ELF_RTYPE_CLASS_PLT,
-					 DL_LOOKUP_ADD_DEPENDENCY, 0);
+					 flags, 0);
+
+          /* We are done with the global scope.  */
+	  if (!RTLD_SINGLE_THREAD_P)
+	    THREAD_GSCOPE_RESET_FLAG ();
+	  }
 	}
 
       /* Currently value contains the base load address of the object

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

Summary of changes:
 ChangeLog.mips               |    5 +++++
 sysdeps/mips/dl-trampoline.c |   30 +++++++++++++++++++++++++++++-
 2 files changed, 34 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
Community source repository for glibc add-on ports


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