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, release/2.14/master, updated. glibc-2.14-48-g69c1dfc


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, release/2.14/master has been updated
       via  69c1dfc1a7964cc15d429350905aea821803a40c (commit)
       via  184d66c5b942ea9991f7c68cfbeb1e773fd7d092 (commit)
       via  3cca60520bb5dfaa57209fb9f6fbd2f76ca0cd9d (commit)
       via  8c0c0e8819bac3d1b67d1dacf5b2b51485ca3087 (commit)
       via  e9f35ea6af4b3f9dae6d28e8a306550fd9b7aeb5 (commit)
       via  435e230ccc4d7676f8cb25a61e4db92cc341f16d (commit)
       via  2b160af8145921ef8550c5a2650995d0d58b7bbe (commit)
       via  fcec7096abfa39c586068fd0dd0e32fd1a7255b0 (commit)
       via  9ddfa2b9adc84fd8318a3303f66e19f66e9d3084 (commit)
       via  7be2249733d3fff0d6c7c84937360b3268313223 (commit)
      from  4eddf93f5cc2711187e5e397a76ed727b440e972 (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=69c1dfc1a7964cc15d429350905aea821803a40c

commit 69c1dfc1a7964cc15d429350905aea821803a40c
Author: Andreas Schwab <schwab@redhat.com>
Date:   Fri Jun 25 10:41:17 2010 +0200

    Fix setxid race handling exiting threads
    (cherry picked from commit 523df511514331a7fa0668b37a917b52f71684af)

diff --git a/nptl/ChangeLog b/nptl/ChangeLog
index 7411ae5..c4ae3cb 100644
--- a/nptl/ChangeLog
+++ b/nptl/ChangeLog
@@ -1,3 +1,8 @@
+2011-08-31  Andreas Schwab  <schwab@redhat.com>
+
+	* allocatestack.c (setxid_mark_thread): Ensure that the exiting
+	thread is woken up.
+
 2011-08-08  Andreas Schwab  <schwab@redhat.com>
 
 	* sysdeps/unix/sysv/linux/x86_64/cancellation.S: Maintain aligned
diff --git a/nptl/allocatestack.c b/nptl/allocatestack.c
index 82408f5..d4364bf 100644
--- a/nptl/allocatestack.c
+++ b/nptl/allocatestack.c
@@ -999,7 +999,16 @@ setxid_mark_thread (struct xid_command *cmdp, struct pthread *t)
 
       /* If the thread is exiting right now, ignore it.  */
       if ((ch & EXITING_BITMASK) != 0)
-	return;
+	{
+	  /* Release the futex if there is no other setxid in
+	     progress.  */
+	  if ((ch & SETXID_BITMASK) == 0)
+	    {
+	      t->setxid_futex = 1;
+	      lll_futex_wake (&t->setxid_futex, 1, LLL_PRIVATE);
+	    }
+	  return;
+	}
     }
   while (atomic_compare_and_exchange_bool_acq (&t->cancelhandling,
 					       ch | SETXID_BITMASK, ch));

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

commit 184d66c5b942ea9991f7c68cfbeb1e773fd7d092
Author: Jiri Olsa <jolsa@redhat.com>
Date:   Mon Aug 29 09:14:51 2011 -0400

    rtld, i386: Fix cfi directive in audit trampoline code
    
    _dl_runtime_profile function has wrong cfi directive when
    rewinding stack back for the pltexit path.
    
    Only 8 bytes - 2 'pop edx' instructions from the pltentry-only
    code should be rewinded back.
    
    With attached patch, I'm able to rewind stack correctly
    throught the rtld code from audit library callback.
    (cherry picked from commit fbeb5f4db12dccb985ee10eb87fe00b46562b796)

diff --git a/ChangeLog b/ChangeLog
index 24bdf4a..1ee1880 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-08-29  Jiri Olsa <jolsa@redhat.com>
+
+	* sysdeps/i386/dl-trampoline.S (_dl_runtime_profile): Fix cfi
+	directive.
+
 2011-08-24  Andreas Schwab  <schwab@redhat.com>
 
 	* elf/Makefile: Add rules to build and run unload8 test.
diff --git a/sysdeps/i386/dl-trampoline.S b/sysdeps/i386/dl-trampoline.S
index 73b08ba..19e313e 100644
--- a/sysdeps/i386/dl-trampoline.S
+++ b/sysdeps/i386/dl-trampoline.S
@@ -1,5 +1,5 @@
 /* PLT trampolines.  i386 version.
-   Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2005, 2007, 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
@@ -99,7 +99,7 @@ _dl_runtime_profile:
 	    +4      %edx
 	   %esp     free
 	*/
-	cfi_adjust_cfa_offset (12)
+	cfi_adjust_cfa_offset (8)
 1:	movl %ebx, (%esp)
 	cfi_rel_offset (ebx, 0)
 	movl %edx, %ebx		# This is the frame buffer size

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

commit 3cca60520bb5dfaa57209fb9f6fbd2f76ca0cd9d
Author: Andreas Schwab <schwab@redhat.com>
Date:   Wed Aug 24 09:32:13 2011 +0200

    Fix scope handling during dl_close
    (cherry picked from commit 39dd69dfb9b8948720f05455df6775b70238803f)

diff --git a/ChangeLog b/ChangeLog
index 521c453..24bdf4a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2011-08-24  Andreas Schwab  <schwab@redhat.com>
+
+	* elf/Makefile: Add rules to build and run unload8 test.
+	* elf/unload8.c: New file.
+	* elf/unload8mod1.c: New file.
+	* elf/unload8mod1x.c: New file.
+	* elf/unload8mod2.c: New file.
+	* elf/unload8mod3.c: New file.
+
+	* elf/dl-close.c (_dl_close_worker): Reset private search list if
+	it wasn't used.
+
 2011-08-23  Andreas Schwab  <schwab@redhat.com>
 
 	* sysdeps/i386/i686/multiarch/strspn.S (ENTRY): Add missing
diff --git a/elf/Makefile b/elf/Makefile
index bc8693d..1c5bdee 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -90,6 +90,7 @@ distribute	:= rtld-Rules \
 		   unload4mod1.c unload4mod2.c unload4mod3.c unload4mod4.c \
 		   unload6mod1.c unload6mod2.c unload6mod3.c \
 		   unload7mod1.c unload7mod2.c \
+		   unload8mod1.c unload8mod1x.c unload8mod2.c unload8mod3.c \
 		   tst-audit1.c tst-audit2.c tst-audit3.c tst-audit4.c \
 		   tst-auditmod1.c tst-auditmod3a.c tst-auditmod3b.c \
 		   tst-auditmod4a.c tst-auditmod4b.c \
@@ -222,7 +223,7 @@ tests += loadtest restest1 preloadtest loadfail multiload origtest resolvfail \
 	 tst-align tst-align2 $(tests-execstack-$(have-z-execstack)) \
 	 tst-dlmodcount tst-dlopenrpath tst-deep1 \
 	 tst-dlmopen1 tst-dlmopen2 tst-dlmopen3 \
-	 unload3 unload4 unload5 unload6 unload7 tst-global1 order2 \
+	 unload3 unload4 unload5 unload6 unload7 unload8 tst-global1 order2 \
 	 tst-audit1 tst-audit2 \
 	 tst-stackguard1 tst-addr1 tst-thrlock \
 	 tst-unique1 tst-unique2 tst-unique3 tst-unique4 \
@@ -280,6 +281,7 @@ modules-names = testobj1 testobj2 testobj3 testobj4 testobj5 testobj6 \
 		unload4mod1 unload4mod2 unload4mod3 unload4mod4 \
 		unload6mod1 unload6mod2 unload6mod3 \
 		unload7mod1 unload7mod2 \
+		unload8mod1 unload8mod1x unload8mod2 unload8mod3 \
 		order2mod1 order2mod2 order2mod3 order2mod4 \
 		tst-unique1mod1 tst-unique1mod2 \
 		tst-unique2mod1 tst-unique2mod2 \
@@ -570,6 +572,9 @@ $(objpfx)unload6mod2.so: $(libdl)
 $(objpfx)unload6mod3.so: $(libdl)
 $(objpfx)unload7mod1.so: $(libdl)
 $(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
@@ -883,6 +888,9 @@ $(objpfx)unload7: $(libdl)
 $(objpfx)unload7.out: $(objpfx)unload7mod1.so $(objpfx)unload7mod2.so
 unload7-ENV = MALLOC_PERTURB_=85
 
+$(objpfx)unload8: $(libdl)
+$(objpfx)unload8.out: $(objpfx)unload8mod1.so $(objpfx)unload8mod1x.so
+
 ifdef libdl
 $(objpfx)tst-tls9-static: $(common-objpfx)dlfcn/libdl.a
 $(objpfx)tst-tls9-static.out: $(objpfx)tst-tlsmod5.so $(objpfx)tst-tlsmod6.so
diff --git a/elf/dl-close.c b/elf/dl-close.c
index 229e288..02df0d0 100644
--- a/elf/dl-close.c
+++ b/elf/dl-close.c
@@ -430,6 +430,13 @@ _dl_close_worker (struct link_map *map)
 
 	      imap->l_scope_max = new_size;
 	    }
+	  else if (new_list != NULL)
+	    {
+	      /* We didn't change the scope array, so reset the search
+		 list.  */
+	      imap->l_searchlist.r_list = NULL;
+	      imap->l_searchlist.r_nlist = 0;
+	    }
 
 	  /* The loader is gone, so mark the object as not having one.
 	     Note: l_idx != IDX_STILL_USED -> object will be removed.  */
diff --git a/elf/unload8.c b/elf/unload8.c
new file mode 100644
index 0000000..f984a38
--- /dev/null
+++ b/elf/unload8.c
@@ -0,0 +1,33 @@
+#include <dlfcn.h>
+#include <stdio.h>
+
+int
+main (void)
+{
+  void *h = dlopen ("$ORIGIN/unload8mod1.so", RTLD_LAZY);
+  if (h == NULL)
+    {
+      puts ("dlopen unload8mod1.so failed");
+      return 1;
+    }
+
+  void *h2 = dlopen ("$ORIGIN/unload8mod1x.so", RTLD_LAZY);
+  if (h2 == NULL)
+    {
+      puts ("dlopen unload8mod1x.so failed");
+      return 1;
+    }
+  dlclose (h2);
+
+  int (*mod1) (void) = dlsym (h, "mod1");
+  if (mod1 == NULL)
+    {
+      puts ("dlsym failed");
+      return 1;
+    }
+
+  mod1 ();
+  dlclose (h);
+
+  return 0;
+}
diff --git a/elf/unload8mod1.c b/elf/unload8mod1.c
new file mode 100644
index 0000000..fe7e81c
--- /dev/null
+++ b/elf/unload8mod1.c
@@ -0,0 +1,7 @@
+extern void mod2 (void);
+
+void
+mod1 (void)
+{
+  mod2 ();
+}
diff --git a/elf/unload8mod1x.c b/elf/unload8mod1x.c
new file mode 100644
index 0000000..835b634
--- /dev/null
+++ b/elf/unload8mod1x.c
@@ -0,0 +1 @@
+int mod1x;
diff --git a/elf/unload8mod2.c b/elf/unload8mod2.c
new file mode 100644
index 0000000..2fd8b67
--- /dev/null
+++ b/elf/unload8mod2.c
@@ -0,0 +1,7 @@
+extern void mod3 (void);
+
+void
+mod2 (void)
+{
+  mod3 ();
+}
diff --git a/elf/unload8mod3.c b/elf/unload8mod3.c
new file mode 100644
index 0000000..d49e22b
--- /dev/null
+++ b/elf/unload8mod3.c
@@ -0,0 +1,27 @@
+#include <dlfcn.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+void
+mod3_fini2 (void)
+{
+}
+
+void
+mod3_fini (void)
+{
+  mod3_fini2 ();
+}
+
+void
+mod3 (void)
+{
+  void *h = dlopen ("$ORIGIN/unload8mod2.so", RTLD_LAZY);
+  if (h == NULL)
+    {
+      puts ("dlopen unload8mod2.so failed");
+      exit (1);
+    }
+
+  atexit (mod3_fini);
+}

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

commit 8c0c0e8819bac3d1b67d1dacf5b2b51485ca3087
Author: Andreas Schwab <schwab@redhat.com>
Date:   Tue Aug 23 15:53:51 2011 +0200

    Fix spurious nop at start of __strspn_ia32
    (cherry picked from commit 2cae4995416cc25f381686902b4243f0095daedd)

diff --git a/ChangeLog b/ChangeLog
index 823cf21..521c453 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-08-23  Andreas Schwab  <schwab@redhat.com>
+
+	* sysdeps/i386/i686/multiarch/strspn.S (ENTRY): Add missing
+	backslash.
+
 2011-08-22  Andreas Schwab  <schwab@redhat.com>
 
 	* elf/dl-deps.c (_dl_map_object_deps): Move check for missing
diff --git a/sysdeps/i386/i686/multiarch/strspn.S b/sysdeps/i386/i686/multiarch/strspn.S
index dbdf1af..cd26c80 100644
--- a/sysdeps/i386/i686/multiarch/strspn.S
+++ b/sysdeps/i386/i686/multiarch/strspn.S
@@ -76,8 +76,8 @@ END(strspn)
 # define ENTRY(name) \
 	.type __strspn_ia32, @function; \
 	.globl __strspn_ia32; \
-	.p2align 4
-	__strspn_ia32: cfi_startproc; \
+	.p2align 4; \
+__strspn_ia32: cfi_startproc; \
 	CALL_MCOUNT
 # undef END
 # define END(name) \

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

commit e9f35ea6af4b3f9dae6d28e8a306550fd9b7aeb5
Author: Andreas Schwab <schwab@redhat.com>
Date:   Mon Mar 21 15:00:21 2011 +0100

    Revert "Don't crash when dependencies are missing"
    
    This reverts commit f2092faf2b6bd491a1891d5d5e393a8bf85d01d7.
    (cherry picked from commit f55ffe58e9754e54f2de20c67613e8a26a9878df)

diff --git a/ChangeLog b/ChangeLog
index cc3943f..823cf21 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-08-22  Andreas Schwab  <schwab@redhat.com>
+
+	* elf/dl-deps.c (_dl_map_object_deps): Move check for missing
+	dependencies back to end of function.
+
 2011-08-16  Andreas Schwab  <schwab@redhat.com>
 
 	[BZ #11724]
diff --git a/elf/dl-deps.c b/elf/dl-deps.c
index cc0023d..7fa4d69 100644
--- a/elf/dl-deps.c
+++ b/elf/dl-deps.c
@@ -491,10 +491,6 @@ _dl_map_object_deps (struct link_map *map,
   if (errno == 0 && errno_saved != 0)
     __set_errno (errno_saved);
 
-  if (errno_reason)
-    _dl_signal_error (errno_reason == -1 ? 0 : errno_reason, objname,
-		      NULL, errstring);
-
   struct link_map **old_l_initfini = NULL;
   if (map->l_initfini != NULL && map->l_type == lt_loaded)
     {
@@ -691,4 +687,8 @@ Filters not supported with LD_TRACE_PRELINKING"));
     }
   if (old_l_initfini != NULL)
       map->l_orig_initfini = old_l_initfini;
+
+  if (errno_reason)
+    _dl_signal_error (errno_reason == -1 ? 0 : errno_reason, objname,
+		      NULL, errstring);
 }

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

commit 435e230ccc4d7676f8cb25a61e4db92cc341f16d
Author: Andreas Schwab <schwab@redhat.com>
Date:   Mon Aug 22 16:08:16 2011 -0400

    Correct cycle detection during dependency sorting
    (cherry picked from commit e888bcbe4fb8ad538ec640bfb18b687d51e001e7)

diff --git a/ChangeLog b/ChangeLog
index fc9c1b5..cc3943f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2011-08-16  Andreas Schwab  <schwab@redhat.com>
+
+	[BZ #11724]
+	* elf/dl-deps.c (_dl_map_object_deps): Only assume cycle when
+	object is seen twice.
+	* elf/dl-fini.c (_dl_sort_fini): Likewise.
+
+	* elf/Makefile (distribute): Add tst-initorder2.c.
+	(tests): Add tst-initorder2.
+	(modules-names): Add tst-initorder2a tst-initorder2b
+	tst-initorder2c tst-initorder2d.  Add rules to build them.
+	($(objpfx)tst-initorder2.out): New rule.
+	* elf/tst-initorder2.c: New file.
+	* elf/tst-initorder2.exp: New file.
+
 2011-08-20  Ulrich Drepper  <drepper@gmail.com>
 
 	[BZ #13114]
diff --git a/elf/Makefile b/elf/Makefile
index 6d314a9..bc8693d 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -120,9 +120,10 @@ distribute	:= rtld-Rules \
 		   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-initordera1.c tst-initordera2.c tst-initorderb1.c \
+		   tst-initorderb2.c tst-initordera3.c tst-initordera4.c \
+		   tst-initorder.c \
+		   tst-initorder2.c
 
 CFLAGS-dl-runtime.c = -fexceptions -fasynchronous-unwind-tables
 CFLAGS-dl-lookup.c = -fexceptions -fasynchronous-unwind-tables
@@ -225,7 +226,7 @@ tests += loadtest restest1 preloadtest loadfail multiload origtest resolvfail \
 	 tst-audit1 tst-audit2 \
 	 tst-stackguard1 tst-addr1 tst-thrlock \
 	 tst-unique1 tst-unique2 tst-unique3 tst-unique4 \
-	 tst-initorder
+	 tst-initorder tst-initorder2
 #	 reldep9
 test-srcs = tst-pathopt
 selinux-enabled := $(shell cat /selinux/enforce 2> /dev/null)
@@ -286,7 +287,8 @@ modules-names = testobj1 testobj2 testobj3 testobj4 testobj5 testobj6 \
 		tst-unique4lib \
 		tst-initordera1 tst-initorderb1 \
 		tst-initordera2 tst-initorderb2 \
-		tst-initordera3 tst-initordera4
+		tst-initordera3 tst-initordera4 \
+		tst-initorder2a tst-initorder2b tst-initorder2c tst-initorder2d
 ifeq (yes,$(have-initfini-array))
 modules-names += tst-array2dep tst-array5dep
 endif
@@ -1156,6 +1158,23 @@ $(objpfx)tst-initorder.out: $(objpfx)tst-initorder
 	  $< > $@
 	cmp $@ tst-initorder.exp > /dev/null
 
+$(objpfx)tst-initorder2: $(objpfx)tst-initorder2a.so $(objpfx)tst-initorder2d.so $(objpfx)tst-initorder2c.so
+$(objpfx)tst-initorder2a.so: $(objpfx)tst-initorder2b.so
+$(objpfx)tst-initorder2b.so: $(objpfx)tst-initorder2c.so
+$(objpfx)tst-initorder2c.so: $(objpfx)tst-initorder2d.so
+define o-iterator-doit
+$(objpfx)tst-initorder2$o.os: tst-initorder2.c; \
+$$(compile-command.c) -DNAME=\"$o\"
+endef
+object-suffixes-left := a b c d
+include $(o-iterator)
+
+$(objpfx)tst-initorder2.out: $(objpfx)tst-initorder2
+	$(elf-objpfx)${rtld-installed-name} \
+	  --library-path $(rpath-link)$(patsubst %,:%,$(sysdep-library-path)) \
+	  $< > $@
+	cmp $@ tst-initorder2.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 0b03b90..cc0023d 100644
--- a/elf/dl-deps.c
+++ b/elf/dl-deps.c
@@ -626,12 +626,12 @@ Filters not supported with LD_TRACE_PRELINKING"));
       /* 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]));
+      char seen[nlist];
+      memset (seen, 0, nlist * sizeof (seen[0]));
       while (1)
 	{
 	  /* Keep track of which object we looked at this round.  */
-	  seen[i] = true;
+	  seen[i] += seen[i] < 2;
 	  struct link_map *thisp = l_initfini[i];
 
 	  /* Find the last object in the list for which the current one is
@@ -652,15 +652,16 @@ Filters not supported with LD_TRACE_PRELINKING"));
 			       (k - i) * sizeof (l_initfini[0]));
 		      l_initfini[k] = thisp;
 
-		      if (seen[i + 1])
+		      if (seen[i + 1] > 1)
 			{
 			  ++i;
 			  goto next_clear;
 			}
 
+		      char this_seen = seen[i];
 		      memmove (&seen[i], &seen[i + 1],
 			       (k - i) * sizeof (seen[0]));
-		      seen[k] = true;
+		      seen[k] = this_seen;
 
 		      goto next;
 		    }
@@ -671,7 +672,7 @@ Filters not supported with LD_TRACE_PRELINKING"));
 	  if (++i == nlist)
 	    break;
 	next_clear:
-	  memset (&seen[i], false, (nlist - i) * sizeof (seen[0]));
+	  memset (&seen[i], 0, (nlist - i) * sizeof (seen[0]));
 
 	next:;
 	}
diff --git a/elf/dl-fini.c b/elf/dl-fini.c
index 269bcec..22dd76d 100644
--- a/elf/dl-fini.c
+++ b/elf/dl-fini.c
@@ -40,12 +40,12 @@ _dl_sort_fini (struct link_map *l, struct link_map **maps, size_t nmaps,
   /* We can skip looking for the binary itself which is at the front
      of the search list for the main namespace.  */
   unsigned int i = ns == LM_ID_BASE;
-  bool seen[nmaps];
-  memset (seen, false, nmaps * sizeof (seen[0]));
+  char seen[nmaps];
+  memset (seen, 0, nmaps * sizeof (seen[0]));
   while (1)
     {
       /* Keep track of which object we looked at this round.  */
-      seen[i] = true;
+      seen[i] += seen[i] < 2;
       struct link_map *thisp = maps[i];
 
       /* Do not handle ld.so in secondary namespaces and object which
@@ -80,14 +80,15 @@ _dl_sort_fini (struct link_map *l, struct link_map **maps, size_t nmaps,
 		      used[k] = here_used;
 		    }
 
-		  if (seen[i + 1])
+		  if (seen[i + 1] > 1)
 		    {
 		      ++i;
 		      goto next_clear;
 		    }
 
+		  char this_seen = seen[i];
 		  memmove (&seen[i], &seen[i + 1], (k - i) * sizeof (seen[0]));
-		  seen[k] = true;
+		  seen[k] = this_seen;
 
 		  goto next;
 		}
@@ -97,7 +98,7 @@ _dl_sort_fini (struct link_map *l, struct link_map **maps, size_t nmaps,
 	      unsigned int m = maps[k]->l_reldeps->act;
 	      struct link_map **relmaps = &maps[k]->l_reldeps->list[0];
 
-	    /* Look through the relocation dependencies of the object.  */
+	      /* Look through the relocation dependencies of the object.  */
 	      while (m-- > 0)
 		if (__builtin_expect (relmaps[m] == thisp, 0))
 		  goto move;
@@ -110,7 +111,7 @@ _dl_sort_fini (struct link_map *l, struct link_map **maps, size_t nmaps,
       if (++i == nmaps)
 	break;
     next_clear:
-      memset (&seen[i], false, (nmaps - i) * sizeof (seen[0]));
+      memset (&seen[i], 0, (nmaps - i) * sizeof (seen[0]));
 
     next:;
     }
diff --git a/elf/tst-initorder2.c b/elf/tst-initorder2.c
new file mode 100644
index 0000000..050f956
--- /dev/null
+++ b/elf/tst-initorder2.c
@@ -0,0 +1,20 @@
+#include <stdio.h>
+
+#ifndef NAME
+int
+main (void)
+{
+  puts ("main");
+}
+#else
+static void __attribute__ ((constructor))
+init (void)
+{
+  puts ("init: " NAME);
+}
+static void __attribute__ ((destructor))
+fini (void)
+{
+  puts ("fini: " NAME);
+}
+#endif
diff --git a/elf/tst-initorder2.exp b/elf/tst-initorder2.exp
new file mode 100644
index 0000000..5169489
--- /dev/null
+++ b/elf/tst-initorder2.exp
@@ -0,0 +1,9 @@
+init: d
+init: c
+init: b
+init: a
+main
+fini: a
+fini: b
+fini: c
+fini: d

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

commit 2b160af8145921ef8550c5a2650995d0d58b7bbe
Author: Ulrich Drepper <drepper@gmail.com>
Date:   Sat Aug 20 09:22:16 2011 -0400

    Add test for BZ 13114
    (cherry picked from commit 5c43483f0c868a29161979a783b7a728d665f06e)

diff --git a/ChangeLog b/ChangeLog
index e3021f9..fc9c1b5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2011-08-20  Ulrich Drepper  <drepper@gmail.com>
+
+	[BZ #13114]
+	* stdio-common/Makefile (tests): Add bug24.
+	* stdio-common/bug24.c: New file.
+
 2011-08-19  Andreas Jaeger  <aj@suse.de>
 
 	[BZ #13114]
diff --git a/stdio-common/Makefile b/stdio-common/Makefile
index 6c71f1c..006f546 100644
--- a/stdio-common/Makefile
+++ b/stdio-common/Makefile
@@ -60,7 +60,7 @@ tests := tstscanf test_rdwr test-popen tstgetln test-fseek \
 	 tst-popen tst-unlockedio tst-fmemopen2 tst-put-error tst-fgets \
 	 tst-fwrite bug16 bug17 tst-swscanf tst-sprintf2 bug18 bug18a \
 	 bug19 bug19a tst-popen2 scanf13 scanf14 scanf15 bug20 bug21 bug22 \
-	 scanf16 scanf17 tst-setvbuf1 tst-grouping bug23
+	 scanf16 scanf17 tst-setvbuf1 tst-grouping bug23 bug24
 
 test-srcs = tst-unbputc tst-printf
 
diff --git a/stdio-common/bug24.c b/stdio-common/bug24.c
new file mode 100644
index 0000000..4e6ffcc
--- /dev/null
+++ b/stdio-common/bug24.c
@@ -0,0 +1,26 @@
+#include <stdio.h>
+#include <errno.h>
+
+static int
+do_test (void)
+{
+  FILE *fp = fopen ("/foobar_does_no_exit", "re");
+  if (fp != NULL)
+    {
+      /* A joker created this file.  Ignore the test.  */
+      fclose (fp);
+      return 0;
+    }
+
+  if (errno == ENOENT)
+    {
+      printf ("no bug\n");
+      return 0;
+    }
+
+  printf ("bug : expected ENOENT, got: %m\n");
+  return 1;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"

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

commit fcec7096abfa39c586068fd0dd0e32fd1a7255b0
Author: Andreas Jaeger <aj@suse.de>
Date:   Sat Aug 20 09:12:49 2011 -0400

    Fix fopen (non-existing-file, "re") errno
    (cherry picked from commit a101b025af141e956feb04042ee75e28997c0011)

diff --git a/ChangeLog b/ChangeLog
index 264d725..e3021f9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2011-08-19  Andreas Jaeger  <aj@suse.de>
+
+	[BZ #13114]
+	* libio/fileops.c (_IO_new_file_fopen): Fix handling of
+	non-existant file when using close-on-exec mode.
+
 2011-08-20  Ulrich Drepper  <drepper@gmail.com>
 
 	* sysdeps/x86_64/dl-trampoline.S (_dl_runtime_resolve): Fix CFI for
diff --git a/libio/fileops.c b/libio/fileops.c
index 30de460..a6f7cba 100644
--- a/libio/fileops.c
+++ b/libio/fileops.c
@@ -345,23 +345,22 @@ _IO_new_file_fopen (fp, filename, mode, is32not64)
   result = _IO_file_open (fp, filename, omode|oflags, oprot, read_write,
 			  is32not64);
 
-#ifndef __ASSUME_O_CLOEXEC
-  if ((fp->_flags2 & _IO_FLAGS2_CLOEXEC) != 0 && __have_o_cloexec <= 0)
+  if (result != NULL)
     {
-      int fd = _IO_fileno (fp);
-      if (__have_o_cloexec == 0)
+#ifndef __ASSUME_O_CLOEXEC
+      if ((fp->_flags2 & _IO_FLAGS2_CLOEXEC) != 0 && __have_o_cloexec <= 0)
 	{
-	  int flags = __fcntl (fd, F_GETFD);
-	  __have_o_cloexec = (flags & FD_CLOEXEC) == 0 ? -1 : 1;
+	  int fd = _IO_fileno (fp);
+	  if (__have_o_cloexec == 0)
+	    {
+	      int flags = __fcntl (fd, F_GETFD);
+	      __have_o_cloexec = (flags & FD_CLOEXEC) == 0 ? -1 : 1;
+	    }
+	  if (__have_o_cloexec < 0)
+	    __fcntl (fd, F_SETFD, FD_CLOEXEC);
 	}
-      if (__have_o_cloexec < 0)
-	__fcntl (fd, F_SETFD, FD_CLOEXEC);
-    }
 #endif
 
-#ifdef _LIBC
-  if (result != NULL)
-    {
       /* Test whether the mode string specifies the conversion.  */
       cs = strstr (last_recognized + 1, ",ccs=");
       if (cs != NULL)
@@ -432,7 +431,6 @@ _IO_new_file_fopen (fp, filename, mode, is32not64)
 	  result->_mode = 1;
 	}
     }
-#endif	/* GNU libc */
 
   return result;
 }

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

commit 9ddfa2b9adc84fd8318a3303f66e19f66e9d3084
Author: Ulrich Drepper <drepper@gmail.com>
Date:   Sat Aug 20 08:58:44 2011 -0400

    Fix minor CFI problem in regular x86-64 trampoline
    (cherry picked from commit 0276a718c0fa58916a6e7c54bad22b4e58bb39b4)

diff --git a/ChangeLog b/ChangeLog
index 7250f06..264d725 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2011-08-20  Ulrich Drepper  <drepper@gmail.com>
 
+	* sysdeps/x86_64/dl-trampoline.S (_dl_runtime_resolve): Fix CFI for
+	the very first instruction.
+
+2011-08-20  Ulrich Drepper  <drepper@gmail.com>
+
 	* sysdeps/x86_64/dl-trampoline.h: If MORE_CODE is defined, restore
 	the CFI state in the end.
 	* sysdeps/x86_64/dl-trampoline.S: Define MORE_CODE before first
diff --git a/sysdeps/x86_64/dl-trampoline.S b/sysdeps/x86_64/dl-trampoline.S
index 317610c..258c609 100644
--- a/sysdeps/x86_64/dl-trampoline.S
+++ b/sysdeps/x86_64/dl-trampoline.S
@@ -27,8 +27,9 @@
 	.align 16
 	cfi_startproc
 _dl_runtime_resolve:
+	cfi_adjust_cfa_offset(16) # Incorporate PLT
 	subq $56,%rsp
-	cfi_adjust_cfa_offset(72) # Incorporate PLT
+	cfi_adjust_cfa_offset(56)
 	movq %rax,(%rsp)	# Preserve registers otherwise clobbered.
 	movq %rcx, 8(%rsp)
 	movq %rdx, 16(%rsp)

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

commit 7be2249733d3fff0d6c7c84937360b3268313223
Author: Ulrich Drepper <drepper@gmail.com>
Date:   Sat Aug 20 08:56:30 2011 -0400

    Fix CFI info in x86-64 trampolines for non-AVX code
    (cherry picked from commit c88f17668b67d22fe470933ab81119de587ee175)

diff --git a/ChangeLog b/ChangeLog
index df81b4d..7250f06 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2011-08-20  Ulrich Drepper  <drepper@gmail.com>
+
+	* sysdeps/x86_64/dl-trampoline.h: If MORE_CODE is defined, restore
+	the CFI state in the end.
+	* sysdeps/x86_64/dl-trampoline.S: Define MORE_CODE before first
+	inclusion of dl-trampoline.h.
+	Based on a patch by Jiri Olsa <jolsa@redhat.com>.
+
 2011-08-14  Roland McGrath  <roland@hack.frob.com>
 
 	* locale/Makefile (locale-CPPFLAGS): Renamed CPPFLAGS-locale-programs.
diff --git a/sysdeps/x86_64/dl-trampoline.S b/sysdeps/x86_64/dl-trampoline.S
index 45a2dc2..317610c 100644
--- a/sysdeps/x86_64/dl-trampoline.S
+++ b/sysdeps/x86_64/dl-trampoline.S
@@ -158,14 +158,15 @@ L(have_avx):
 1:	js	L(no_avx)
 
 #  define RESTORE_AVX
+#  define MORE_CODE
 #  include "dl-trampoline.h"
 
 	.align 16
 L(no_avx):
 # endif
 
-#  undef RESTORE_AVX
-#  include "dl-trampoline.h"
+# undef RESTORE_AVX
+# include "dl-trampoline.h"
 
 	cfi_endproc
 	.size _dl_runtime_profile, .-_dl_runtime_profile
diff --git a/sysdeps/x86_64/dl-trampoline.h b/sysdeps/x86_64/dl-trampoline.h
index 5d49ed4..1c39579 100644
--- a/sysdeps/x86_64/dl-trampoline.h
+++ b/sysdeps/x86_64/dl-trampoline.h
@@ -1,6 +1,6 @@
 /* Partial PLT profile trampoline to save and restore x86-64 vector
    registers.
-   Copyright (C) 2009 Free Software Foundation, Inc.
+   Copyright (C) 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
@@ -195,14 +195,14 @@
 	   _dl_call_pltexit.  The La_x86_64_regs is being pointed by rsp now,
 	   so we just need to allocate the sizeof(La_x86_64_retval) space on
 	   the stack, since the alignment has already been taken care of. */
-# ifdef RESTORE_AVX
+#ifdef RESTORE_AVX
 	/* sizeof(La_x86_64_retval).  Need extra space for 2 SSE
 	   registers to detect if xmm0/xmm1 registers are changed
 	   by audit module.  */
 	subq $(LRV_SIZE + XMM_SIZE*2), %rsp
-# else
+#else
 	subq $LRV_SIZE, %rsp	# sizeof(La_x86_64_retval)
-# endif
+#endif
 	movq %rsp, %rcx		# La_x86_64_retval argument to %rcx.
 
 	/* Fill in the La_x86_64_retval structure.  */
@@ -212,7 +212,7 @@
 	movaps %xmm0, LRV_XMM0_OFFSET(%rcx)
 	movaps %xmm1, LRV_XMM1_OFFSET(%rcx)
 
-# ifdef RESTORE_AVX
+#ifdef RESTORE_AVX
 	/* This is to support AVX audit modules.  */
 	vmovdqu %ymm0, LRV_VECTOR0_OFFSET(%rcx)
 	vmovdqu %ymm1, LRV_VECTOR1_OFFSET(%rcx)
@@ -221,14 +221,14 @@
 	   by audit module.  */
 	vmovdqa %xmm0,		  (LRV_SIZE)(%rcx)
 	vmovdqa %xmm1, (LRV_SIZE + XMM_SIZE)(%rcx)
-# endif
+#endif
 
 	fstpt LRV_ST0_OFFSET(%rcx)
 	fstpt LRV_ST1_OFFSET(%rcx)
 
 	movq 24(%rbx), %rdx	# La_x86_64_regs argument to %rdx.
 	movq 40(%rbx), %rsi	# Copy args pushed by PLT in register.
-        movq 32(%rbx), %rdi	# %rdi: link_map, %rsi: reloc_index
+	movq 32(%rbx), %rdi	# %rdi: link_map, %rsi: reloc_index
 	call _dl_call_pltexit
 
 	/* Restore return registers.  */
@@ -238,7 +238,7 @@
 	movaps LRV_XMM0_OFFSET(%rsp), %xmm0
 	movaps LRV_XMM1_OFFSET(%rsp), %xmm1
 
-# ifdef RESTORE_AVX
+#ifdef RESTORE_AVX
 	/* Check if xmm0/xmm1 registers are changed by audit module.  */
 	vpcmpeqq (LRV_SIZE)(%rsp), %xmm0, %xmm2
 	vpmovmskb %xmm2, %esi
@@ -253,7 +253,7 @@
 	vmovdqu LRV_VECTOR1_OFFSET(%rsp), %ymm1
 
 1:
-# endif
+#endif
 
 	fldt LRV_ST1_OFFSET(%rsp)
 	fldt LRV_ST0_OFFSET(%rsp)
@@ -267,3 +267,10 @@
 				# (eats the reloc index and link_map)
 	cfi_adjust_cfa_offset(-48)
 	retq
+
+#ifdef MORE_CODE
+	cfi_adjust_cfa_offset(48)
+	cfi_rel_offset(%rbx, 0)
+	cfi_def_cfa_register(%rbx)
+# undef MORE_CODE
+#endif

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

Summary of changes:
 ChangeLog                            |   67 ++++++++++++++++++++++++++++++++++
 elf/Makefile                         |   39 +++++++++++++++++---
 elf/dl-close.c                       |    7 ++++
 elf/dl-deps.c                        |   21 ++++++-----
 elf/dl-fini.c                        |   15 ++++----
 elf/tst-initorder2.c                 |   20 ++++++++++
 elf/tst-initorder2.exp               |    9 +++++
 elf/unload8.c                        |   33 +++++++++++++++++
 elf/unload8mod1.c                    |    7 ++++
 elf/unload8mod1x.c                   |    1 +
 elf/unload8mod2.c                    |    7 ++++
 elf/unload8mod3.c                    |   27 ++++++++++++++
 libio/fileops.c                      |   24 ++++++-------
 nptl/ChangeLog                       |    5 +++
 nptl/allocatestack.c                 |   11 +++++-
 stdio-common/Makefile                |    2 +-
 stdio-common/bug24.c                 |   26 +++++++++++++
 sysdeps/i386/dl-trampoline.S         |    4 +-
 sysdeps/i386/i686/multiarch/strspn.S |    4 +-
 sysdeps/x86_64/dl-trampoline.S       |    8 +++--
 sysdeps/x86_64/dl-trampoline.h       |   25 ++++++++-----
 21 files changed, 308 insertions(+), 54 deletions(-)
 create mode 100644 elf/tst-initorder2.c
 create mode 100644 elf/tst-initorder2.exp
 create mode 100644 elf/unload8.c
 create mode 100644 elf/unload8mod1.c
 create mode 100644 elf/unload8mod1x.c
 create mode 100644 elf/unload8mod2.c
 create mode 100644 elf/unload8mod3.c
 create mode 100644 stdio-common/bug24.c


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]