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

[commits] r2457 - in /fsf/trunk/libc: ChangeLog elf/do-lookup.h



Author: eglibc
Date: Sun Jun 10 00:03:05 2007
New Revision: 2457

Log:
Import glibc-mainline for 2007-06-10

Modified:
    fsf/trunk/libc/ChangeLog
    fsf/trunk/libc/elf/do-lookup.h

Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Sun Jun 10 00:03:05 2007
@@ -1,3 +1,8 @@
+2007-06-09  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* elf/do-lookup.h (do_lookup_x): Read r_nlist before r_list and
+	make sure gcc doesn't mess around with this.
+
 2007-06-08  Ulrich Drepper  <drepper@xxxxxxxxxx>
 
 	* elf/dl-lookup.c (_dl_lookup_symbol_x): Remove use of r_nlist.

Modified: fsf/trunk/libc/elf/do-lookup.h
==============================================================================
--- fsf/trunk/libc/elf/do-lookup.h (original)
+++ fsf/trunk/libc/elf/do-lookup.h Sun Jun 10 00:03:05 2007
@@ -1,5 +1,5 @@
 /* Look up a symbol in the loaded objects.
-   Copyright (C) 1995-2004, 2005, 2006 Free Software Foundation, Inc.
+   Copyright (C) 1995-2004, 2005, 2006, 2007 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
@@ -29,8 +29,13 @@
 	     const struct r_found_version *const version, int flags,
 	     struct link_map *skip, int type_class)
 {
+  size_t n = scope->r_nlist;
+  /* Make sure we read the value before proceeding.  Otherwise we
+     might use r_list pointing to the initial scope and r_nlist being
+     the value after a resize.  That is the only path in dl-open.c not
+     protected by GSCOPE.  A read barrier here might be to expensive.  */
+  __asm volatile ("" : "+r" (n), "+m" (scope->r_list));
   struct link_map **list = scope->r_list;
-  size_t n = scope->r_nlist;
 
   do
     {