From e07bb02a4f9e7d98f79f428a661c5b982286869d Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 16 Sep 2003 05:54:09 +0000 Subject: Update. 2003-09-15 Jakub Jelinek * 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. --- elf/Makefile | 2 ++ elf/dl-iteratephdr.c | 8 ++++++++ elf/link.h | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) (limited to 'elf') 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 #include +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 -- cgit 1.4.1