about summary refs log tree commit diff
path: root/elf
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-09-16 05:54:09 +0000
committerUlrich Drepper <drepper@redhat.com>2003-09-16 05:54:09 +0000
commite07bb02a4f9e7d98f79f428a661c5b982286869d (patch)
tree7ced4d56fa4f3822b7ac24e4216a660585ddf7f7 /elf
parent005f8d92720387e74ab5decd8407c2c50a6e454e (diff)
downloadglibc-e07bb02a4f9e7d98f79f428a661c5b982286869d.tar.gz
glibc-e07bb02a4f9e7d98f79f428a661c5b982286869d.tar.xz
glibc-e07bb02a4f9e7d98f79f428a661c5b982286869d.zip
Update.
2003-09-15  Jakub Jelinek  <jakub@redhat.com>

	* argp/argp.h (argp_parse, __argp_parse): Remove __THROW.
	* argp/Makefile (CFLAGS-argp-help.c, CFLAGS-argp-parse.c): Add
	$(uses-callbacks).
	* dirent/Makefile (CFLAGS-scandir.c, CFLAGS-scandir64.c): Likewise.
	* elf/Makefile (CFLAGS-dl-iterate-phdr.c,
	CFLAGS-dl-iterate-phdr-static.c): Add $(uses-callbacks).
	* elf/dl-iteratephdr.c (cancel_handler): New function.
	(__dl_iterate_phdr): Add __libc_cleanup_{push,pop}.
	* elf/link.h (dl_iterate_phdr): Remove __THROW.
	* io/Makefile (CFLAGS-fts.c): Merge into one assignment.
	Add $(uses-callbacks).
	(CFLAGS-ftw.c, CFLAGS-ftw64.c): Add $(uses-callbacks).
	* misc/Makefile (CFLAGS-tsearch.c, CFLAGS-lsearch.c): Change
	$(exceptions) to $(uses-callbacks).
	* Makeconfig (uses-callbacks): Set to $(exceptions).
	* posix/Makefile (CFLAGS-glob.c, CFLAGS-glob64.c): Add
	$(uses-callbacks).
	* stdlib/Makefile (CFLAGS-bsearch.c, CFLAGS-msort.c, CFLAGS-qsort.c):
	Likewise.
Diffstat (limited to 'elf')
-rw-r--r--elf/Makefile2
-rw-r--r--elf/dl-iteratephdr.c8
-rw-r--r--elf/link.h2
3 files changed, 11 insertions, 1 deletions
diff --git a/elf/Makefile b/elf/Makefile
index 7554962fb4..734b7854e8 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -84,6 +84,8 @@ distribute	:= rtld-Rules \
 
 CFLAGS-dl-runtime.c = -fexceptions -fasynchronous-unwind-tables
 CFLAGS-dl-lookup.c = -fexceptions -fasynchronous-unwind-tables
+CFLAGS-dl-iterate-phdr.c = $(uses-callbacks)
+CFLAGS-dl-iterate-phdr-static.c = $(uses-callbacks)
 
 include ../Makeconfig
 
diff --git a/elf/dl-iteratephdr.c b/elf/dl-iteratephdr.c
index dccaf0aff8..d4feb690c3 100644
--- a/elf/dl-iteratephdr.c
+++ b/elf/dl-iteratephdr.c
@@ -23,6 +23,12 @@
 #include <stddef.h>
 #include <bits/libc-lock.h>
 
+static void
+cancel_handler (void *arg __attribute__((unused)))
+{
+  __rtld_lock_unlock_recursive (GL(dl_load_lock));
+}
+
 int
 __dl_iterate_phdr (int (*callback) (struct dl_phdr_info *info,
 				    size_t size, void *data), void *data)
@@ -33,6 +39,7 @@ __dl_iterate_phdr (int (*callback) (struct dl_phdr_info *info,
 
   /* Make sure we are alone.  */
   __rtld_lock_lock_recursive (GL(dl_load_lock));
+  __libc_cleanup_push (cancel_handler, 0);
 
   for (l = GL(dl_loaded); l != NULL; l = l->l_next)
     {
@@ -46,6 +53,7 @@ __dl_iterate_phdr (int (*callback) (struct dl_phdr_info *info,
     }
 
   /* Release the lock.  */
+  __libc_cleanup_pop (0);
   __rtld_lock_unlock_recursive (GL(dl_load_lock));
 
   return ret;
diff --git a/elf/link.h b/elf/link.h
index f8e7f629d0..7e2a8f6fee 100644
--- a/elf/link.h
+++ b/elf/link.h
@@ -106,7 +106,7 @@ __BEGIN_DECLS
 
 extern int dl_iterate_phdr (int (*callback) (struct dl_phdr_info *info,
 					     size_t size, void *data),
-			    void *data) __THROW;
+			    void *data);
 
 __END_DECLS