From 1d9d0b80d1412f8a272e0881d34538a041e56b4b Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Thu, 11 Dec 2003 04:52:17 +0000 Subject: [PATCH] Update. 2003-12-10 Ulrich Drepper * sysdeps/pthread/bits/libc-lock.h (__rtld_lock_initialize): Define. * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Call __rtld_lock_initialize for ld.so lock. Patch in part by Adam Li . --- nptl/ChangeLog | 7 +++++++ nptl/sysdeps/pthread/bits/libc-lock.h | 3 +++ nptl/sysdeps/unix/sysv/linux/fork.c | 3 +++ 3 files changed, 13 insertions(+) diff --git a/nptl/ChangeLog b/nptl/ChangeLog index 776a258e..441f0ba 100644 --- a/nptl/ChangeLog +++ b/nptl/ChangeLog @@ -1,3 +1,10 @@ +2003-12-10 Ulrich Drepper + + * sysdeps/pthread/bits/libc-lock.h (__rtld_lock_initialize): Define. + * sysdeps/unix/sysv/linux/fork.c (__libc_fork): Call + __rtld_lock_initialize for ld.so lock. + Patch in part by Adam Li . + 2003-12-02 David Mosberger * Makefile (link-libc-static): Remove -lgcc_eh---it's already mentioned diff --git a/nptl/sysdeps/pthread/bits/libc-lock.h b/nptl/sysdeps/pthread/bits/libc-lock.h index 327e383..0adf273 100644 --- a/nptl/sysdeps/pthread/bits/libc-lock.h +++ b/nptl/sysdeps/pthread/bits/libc-lock.h @@ -131,6 +131,9 @@ typedef pthread_key_t __libc_key_t; #define _RTLD_LOCK_RECURSIVE_INITIALIZER \ {PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP} +#define __rtld_lock_initialize(NAME) \ + (void) ((NAME) = (__rtld_lock_recursive_t) _RTLD_LOCK_RECURSIVE_INITIALIZER) + /* If we check for a weakly referenced symbol and then perform a normal jump to it te code generated for some platforms in case of PIC is unnecessarily slow. What would happen is that the function diff --git a/nptl/sysdeps/unix/sysv/linux/fork.c b/nptl/sysdeps/unix/sysv/linux/fork.c index 43e1b43..84bf379 100644 --- a/nptl/sysdeps/unix/sysv/linux/fork.c +++ b/nptl/sysdeps/unix/sysv/linux/fork.c @@ -151,6 +151,9 @@ __libc_fork (void) /* Reset locks in the I/O code. */ _IO_list_resetlock (); + /* Reset the lock the dynamic loader uses to protect its data. */ + __rtld_lock_initialize (GL(dl_load_lock)); + /* Run the handlers registered for the child. */ while (allp != NULL) { -- 2.7.4