about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog13
-rw-r--r--posix/Makefile2
-rw-r--r--stdlib/cxa_finalize.c8
-rw-r--r--sysdeps/generic/fork.h8
-rw-r--r--sysdeps/ia64/dl-fptr.c4
5 files changed, 31 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index dadc4254c8..e4e2ddbc0f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2002-09-19  David Mosberger  <davidm@hpl.hp.com>
+
+	* sysdeps/ia64/dl-fptr.c (make_fdesc): Load address of "local" via
+	a 64-bit gp-relative address to enable binaries with large data
+	sections.
+
+2002-09-30  Ulrich Drepper  <drepper@redhat.com>
+
+	* stdlib/cxa_finalize.c (__cxa_finalize): Call UNREGISTER_ATFORK
+	if it is defined.
+	* posix/Makefile (distribute): Add fork.h.
+	* sysdeps/generic/fork.h: New file.
+
 2002-09-29  Bruno Haible  <bruno@clisp.org>
 
 	* sysdeps/generic/utmp_file.c (LOCKING_FAILED): New macro.
diff --git a/posix/Makefile b/posix/Makefile
index 272e1cec38..aebd8b3b4b 100644
--- a/posix/Makefile
+++ b/posix/Makefile
@@ -33,7 +33,7 @@ distribute := confstr.h TESTS TESTS2C.sed testcases.h \
 	      PTESTS PTESTS2C.sed ptestcases.h \
 	      globtest.c globtest.sh wordexp-tst.sh annexc.c fnmatch_loop.c   \
 	      spawn_int.h tst-getconf.sh regcomp.c regexec.c regex_internal.c \
-	      regex_internal.h
+	      regex_internal.h fork.h
 
 routines :=								      \
 	uname								      \
diff --git a/stdlib/cxa_finalize.c b/stdlib/cxa_finalize.c
index d9ed955ce6..e42f6bd71c 100644
--- a/stdlib/cxa_finalize.c
+++ b/stdlib/cxa_finalize.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1999, 2001, 2002 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
@@ -20,6 +20,7 @@
 #include <stdlib.h>
 #include <atomicity.h>
 #include "exit.h"
+#include <fork.h>
 
 /* If D is non-NULL, call all functions registered with `__cxa_atexit'
    with the same dso handle.  Otherwise, if D is NULL, do nothing.  */
@@ -41,4 +42,9 @@ __cxa_finalize (void *d)
 	    && compare_and_swap (&f->flavor, ef_cxa, ef_free))
 	  (*f->func.cxa.fn) (f->func.cxa.arg, 0);
     }
+
+  /* Remove the registered fork handlers.  */
+#ifdef UNREGISTER_ATFORK
+  UNREGISTER_ATFORK (d);
+#endif
 }
diff --git a/sysdeps/generic/fork.h b/sysdeps/generic/fork.h
new file mode 100644
index 0000000000..623cae28df
--- /dev/null
+++ b/sysdeps/generic/fork.h
@@ -0,0 +1,8 @@
+/* Stub version of header for fork handling.  Mainly to handle pthread_atfork
+   and friends.  Outside dependencies:
+
+   UNREGISTER_ATFORK
+     If defined it must expand to a function call which takes one void*
+     parameter which is the DSO handle for the DSO which gets unloaded.
+     The function so called has to remove the atfork handlers registered
+     by this module.  */
diff --git a/sysdeps/ia64/dl-fptr.c b/sysdeps/ia64/dl-fptr.c
index dd8eb9d391..809e11311f 100644
--- a/sysdeps/ia64/dl-fptr.c
+++ b/sysdeps/ia64/dl-fptr.c
@@ -1,5 +1,5 @@
 /* Manage function descriptors.  IA-64 version.
-   Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2000, 2001, 2002 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
@@ -127,7 +127,7 @@ make_fdesc (Elf64_Addr ip, Elf64_Addr gp)
   unsigned int old;
   struct local *l;
 
-  asm ("addl %0 = @gprel (local), gp" : "=r" (l));
+  asm ("movl %0 = @gprel (local);; add %0 = %0, gp" : "=&r"(l));
 
   t = l->root;
   while (1)