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.
This commit is contained in:
Ulrich Drepper 2003-09-16 05:54:09 +00:00
parent 005f8d9272
commit e07bb02a4f
15 changed files with 65 additions and 16 deletions

View File

@ -1,3 +1,25 @@
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.
2003-09-15 Andreas Schwab <schwab@suse.de> 2003-09-15 Andreas Schwab <schwab@suse.de>
* sysdeps/m68k/setjmp.c: Add hidden_def. * sysdeps/m68k/setjmp.c: Add hidden_def.

View File

@ -83,6 +83,9 @@ export sysdep_dir := $(sysdep_dir)
# Get the values defined by options to `configure'. # Get the values defined by options to `configure'.
include $(common-objpfx)config.make include $(common-objpfx)config.make
# What flags to give to sources which call user provided callbacks
uses-callbacks = $(exceptions)
# We have a special subdir for each binary format. # We have a special subdir for each binary format.
# For now, only ELF is fully supported. # For now, only ELF is fully supported.
ifeq ($(elf),yes) ifeq ($(elf),yes)

View File

@ -28,7 +28,8 @@ routines = $(addprefix argp-, ba fmtstream fs-xinl help parse pv \
tests = argp-test tst-argp1 tests = argp-test tst-argp1
CFLAGS-argp-help.c = -fexceptions CFLAGS-argp-help.c = $(uses-callbacks) -fexceptions
CFLAGS-argp-parse.c = $(uses-callbacks)
CFLAGS-argp-fmtstream.c = -fexceptions CFLAGS-argp-fmtstream.c = -fexceptions
include ../Rules include ../Rules

View File

@ -1,4 +1,4 @@
# Copyright (C) 1991-2000, 2002 Free Software Foundation, Inc. # Copyright (C) 1991-2000, 2002, 2003 Free Software Foundation, Inc.
# This file is part of the GNU C Library. # This file is part of the GNU C Library.
# The GNU C Library is free software; you can redistribute it and/or # The GNU C Library is free software; you can redistribute it and/or
@ -30,6 +30,9 @@ distribute := dirstream.h
tests := list tst-seekdir opendir-tst1 bug-readdir1 tests := list tst-seekdir opendir-tst1 bug-readdir1
CFLAGS-scandir.c = $(uses-callbacks)
CFLAGS-scandir64.c = $(uses-callbacks)
include ../Rules include ../Rules
opendir-tst1-ARGS = --test-dir=${common-objpfx}dirent opendir-tst1-ARGS = --test-dir=${common-objpfx}dirent

View File

@ -84,6 +84,8 @@ distribute := rtld-Rules \
CFLAGS-dl-runtime.c = -fexceptions -fasynchronous-unwind-tables CFLAGS-dl-runtime.c = -fexceptions -fasynchronous-unwind-tables
CFLAGS-dl-lookup.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 include ../Makeconfig

View File

@ -23,6 +23,12 @@
#include <stddef.h> #include <stddef.h>
#include <bits/libc-lock.h> #include <bits/libc-lock.h>
static void
cancel_handler (void *arg __attribute__((unused)))
{
__rtld_lock_unlock_recursive (GL(dl_load_lock));
}
int int
__dl_iterate_phdr (int (*callback) (struct dl_phdr_info *info, __dl_iterate_phdr (int (*callback) (struct dl_phdr_info *info,
size_t size, void *data), void *data) 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. */ /* Make sure we are alone. */
__rtld_lock_lock_recursive (GL(dl_load_lock)); __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) 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. */ /* Release the lock. */
__libc_cleanup_pop (0);
__rtld_lock_unlock_recursive (GL(dl_load_lock)); __rtld_lock_unlock_recursive (GL(dl_load_lock));
return ret; return ret;

View File

@ -106,7 +106,7 @@ __BEGIN_DECLS
extern int dl_iterate_phdr (int (*callback) (struct dl_phdr_info *info, extern int dl_iterate_phdr (int (*callback) (struct dl_phdr_info *info,
size_t size, void *data), size_t size, void *data),
void *data) __THROW; void *data);
__END_DECLS __END_DECLS

View File

@ -63,7 +63,6 @@ distribute := ftwtest-sh
include ../Rules include ../Rules
CFLAGS-fts.c = -Wno-uninitialized
CFLAGS-fcntl.c = -fexceptions -fasynchronous-unwind-tables CFLAGS-fcntl.c = -fexceptions -fasynchronous-unwind-tables
CFLAGS-poll.c = -fexceptions -fasynchronous-unwind-tables CFLAGS-poll.c = -fexceptions -fasynchronous-unwind-tables
CFLAGS-lockf.c = -fexceptions CFLAGS-lockf.c = -fexceptions
@ -71,9 +70,9 @@ CFLAGS-statfs.c = -fexceptions
CFLAGS-fstatfs.c = -fexceptions CFLAGS-fstatfs.c = -fexceptions
CFLAGS-statvfs.c = -fexceptions CFLAGS-statvfs.c = -fexceptions
CFLAGS-fstatvfs.c = -fexceptions CFLAGS-fstatvfs.c = -fexceptions
CFLAGS-fts.c = -fexceptions CFLAGS-fts.c = -Wno-uninitialized $(uses-callbacks) -fexceptions
CFLAGS-ftw.c = -fexceptions CFLAGS-ftw.c = $(uses-callbacks) -fexceptions
CFLAGS-ftw64.c = -fexceptions CFLAGS-ftw64.c = $(uses-callbacks) -fexceptions
CFLAGS-lockf.c = -fexceptions CFLAGS-lockf.c = -fexceptions
CFLAGS-posix_fallocate.c = -fexceptions CFLAGS-posix_fallocate.c = -fexceptions
CFLAGS-posix_fallocate64.c = -fexceptions CFLAGS-posix_fallocate64.c = -fexceptions

View File

@ -1,3 +1,8 @@
2003-09-15 Jakub Jelinek <jakub@redhat.com>
* Makefile (CFLAGS-mutex.c): Add $(uses-callbacks).
(CFLAGS-sighandler.c): Change $(exceptions) into $(uses-callbacks).
2003-09-12 Jakub Jelinek <jakub@redhat.com> 2003-09-12 Jakub Jelinek <jakub@redhat.com>
* sysdeps/unix/sysv/linux/s390/bits/typesizes.h: New. * sysdeps/unix/sysv/linux/s390/bits/typesizes.h: New.

View File

@ -184,7 +184,8 @@ CFLAGS-pthread.c += -D__NO_WEAK_PTHREAD_ALIASES $(znodelete-$(have-z-nodelete))
CFLAGS-ptfork.c += -D__NO_WEAK_PTHREAD_ALIASES CFLAGS-ptfork.c += -D__NO_WEAK_PTHREAD_ALIASES
CFLAGS-cancel.c += -D__NO_WEAK_PTHREAD_ALIASES -D_RPC_THREAD_SAFE_ CFLAGS-cancel.c += -D__NO_WEAK_PTHREAD_ALIASES -D_RPC_THREAD_SAFE_
CFLAGS-unload.c += -DPREFIX=\"$(objpfx)\" CFLAGS-unload.c += -DPREFIX=\"$(objpfx)\"
CFLAGS-sighandler.c += $(exceptions) CFLAGS-mutex.c += $(uses-callbacks)
CFLAGS-sighandler.c += $(uses-callbacks)
ifeq (yes,$(versioning)) ifeq (yes,$(versioning))
-include $(common-objpfx)tls.make -include $(common-objpfx)tls.make

View File

@ -75,8 +75,8 @@ gpl2lgpl := error.c error.h
tests := tst-dirname tst-tsearch tst-fdset tst-efgcvt tst-mntent tst-hsearch tests := tst-dirname tst-tsearch tst-fdset tst-efgcvt tst-mntent tst-hsearch
CFLAGS-tsearch.c = $(exceptions) CFLAGS-tsearch.c = $(uses-callbacks)
CFLAGS-lsearch.c = $(exceptions) CFLAGS-lsearch.c = $(uses-callbacks)
CFLAGS-pselect.c = -fexceptions CFLAGS-pselect.c = -fexceptions
CFLAGS-readv.c = -fexceptions -fasynchronous-unwind-tables CFLAGS-readv.c = -fexceptions -fasynchronous-unwind-tables
CFLAGS-writev.c = -fexceptions -fasynchronous-unwind-tables CFLAGS-writev.c = -fexceptions -fasynchronous-unwind-tables

View File

@ -1,3 +1,7 @@
2003-09-15 Jakub Jelinek <jakub@redhat.com>
* Makefile (CFLAGS-pthread_once.c): Add $(uses-callbacks).
2003-09-11 Ulrich Drepper <drepper@redhat.com> 2003-09-11 Ulrich Drepper <drepper@redhat.com>
* pthread_mutex_lock.c: Minor code rearrangements. * pthread_mutex_lock.c: Minor code rearrangements.

View File

@ -162,7 +162,8 @@ CFLAGS-forward.c = -fexceptions
CFLAGS-pthread_testcancel.c = -fexceptions CFLAGS-pthread_testcancel.c = -fexceptions
CFLAGS-pthread_join.c = -fexceptions -fasynchronous-unwind-tables CFLAGS-pthread_join.c = -fexceptions -fasynchronous-unwind-tables
CFLAGS-pthread_timedjoin.c = -fexceptions -fasynchronous-unwind-tables CFLAGS-pthread_timedjoin.c = -fexceptions -fasynchronous-unwind-tables
CFLAGS-pthread_once.c = -fexceptions -fasynchronous-unwind-tables CFLAGS-pthread_once.c = $(uses-callbacks) -fexceptions \
-fasynchronous-unwind-tables
CFLAGS-pthread_cond_wait.c = -fexceptions -fasynchronous-unwind-tables CFLAGS-pthread_cond_wait.c = -fexceptions -fasynchronous-unwind-tables
CFLAGS-pthread_cond_timedwait.c = -fexceptions -fasynchronous-unwind-tables CFLAGS-pthread_cond_timedwait.c = -fexceptions -fasynchronous-unwind-tables
CFLAGS-sem_wait.c = -fexceptions -fasynchronous-unwind-tables CFLAGS-sem_wait.c = -fexceptions -fasynchronous-unwind-tables

View File

@ -136,8 +136,8 @@ CFLAGS-spawn.c = -fexceptions
CFLAGS-spawnp.c = -fexceptions CFLAGS-spawnp.c = -fexceptions
CFLAGS-spawni.c = -fexceptions CFLAGS-spawni.c = -fexceptions
CFLAGS-pause.c = -fexceptions CFLAGS-pause.c = -fexceptions
CFLAGS-glob.c = -fexceptions CFLAGS-glob.c = $(uses-callbacks) -fexceptions
CFLAGS-glob64.c = -fexceptions CFLAGS-glob64.c = $(uses-callbacks) -fexceptions
tstgetopt-ARGS = -a -b -cfoobar --required foobar --optional=bazbug \ tstgetopt-ARGS = -a -b -cfoobar --required foobar --optional=bazbug \
--none random --col --color --colour --none random --col --color --colour

View File

@ -79,9 +79,9 @@ distribute := $(distribute) $(mpn-headers) gen-mpn-copy fpioconst.h
generated += isomac isomac.out generated += isomac isomac.out
CFLAGS-bsearch.c = $(exceptions) CFLAGS-bsearch.c = $(uses-callbacks)
CFLAGS-msort.c = $(exceptions) CFLAGS-msort.c = $(uses-callbacks)
CFLAGS-qsort.c = $(exceptions) CFLAGS-qsort.c = $(uses-callbacks)
CFLAGS-system.c = -fexceptions CFLAGS-system.c = -fexceptions
CFLAGS-fmtmsg.c = -fexceptions CFLAGS-fmtmsg.c = -fexceptions