From b683fcf69217f7195e73b2f05d608c952101f47a Mon Sep 17 00:00:00 2001 From: kib Date: Thu, 27 Nov 2008 11:27:59 +0000 Subject: Add two rtld exported symbols, _rtld_atfork_pre and _rtld_atfork_post. Threading library calls _pre before the fork, allowing the rtld to lock itself to ensure that other threads of the process are out of dynamic linker. _post releases the locks. This allows the rtld to have consistent state in the child. Although child may legitimately call only async-safe functions, the call may need plt relocation resolution, and this requires working rtld. Reported and debugging help by: rink Reviewed by: kan, davidxu MFC after: 1 month (anyway, not before 7.1 is out) --- libexec/rtld-elf/rtld.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libexec/rtld-elf/rtld.c') diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 144ea6c..f67093a 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -206,6 +206,8 @@ static func_ptr_type exports[] = { (func_ptr_type) &_rtld_allocate_tls, (func_ptr_type) &_rtld_free_tls, (func_ptr_type) &dl_iterate_phdr, + (func_ptr_type) &_rtld_atfork_pre, + (func_ptr_type) &_rtld_atfork_post, NULL }; -- cgit v1.1