From owner-cvs-src-old@FreeBSD.ORG Mon Aug 23 15:38:41 2010 Return-Path: Delivered-To: cvs-src-old@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C32CC1065695 for ; Mon, 23 Aug 2010 15:38:41 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 949158FC17 for ; Mon, 23 Aug 2010 15:38:41 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.4/8.14.4) with ESMTP id o7NFcfE9023747 for ; Mon, 23 Aug 2010 15:38:41 GMT (envelope-from kib@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.4/8.14.4/Submit) id o7NFcfVq023746 for cvs-src-old@freebsd.org; Mon, 23 Aug 2010 15:38:41 GMT (envelope-from kib@repoman.freebsd.org) Message-Id: <201008231538.o7NFcfVq023746@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to kib@repoman.freebsd.org using -f From: Konstantin Belousov Date: Mon, 23 Aug 2010 15:38:02 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/lib/libc/gen Makefile.inc Symbol.map elf_utils.c src/lib/libc/include libc_private.h src/lib/libc/stdlib atexit.c src/lib/libthr pthread.map src/lib/libthr/thread thr_fork.c thr_private.h src/libexec/rtld-elf rtld.c X-BeenThere: cvs-src-old@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: **OBSOLETE** CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Aug 2010 15:38:41 -0000 kib 2010-08-23 15:38:02 UTC FreeBSD src repository Modified files: lib/libc/gen Makefile.inc Symbol.map lib/libc/include libc_private.h lib/libc/stdlib atexit.c lib/libthr pthread.map lib/libthr/thread thr_fork.c thr_private.h libexec/rtld-elf rtld.c Added files: lib/libc/gen elf_utils.c Log: SVN rev 211706 on 2010-08-23 15:38:02Z by kib On shared object unload, in __cxa_finalize, call and clear all installed atexit and __cxa_atexit handlers that are either installed by unloaded dso, or points to the functions provided by the dso. Use _rtld_addr_phdr to locate segment information from the address of private variable belonging to the dso, supplied by crtstuff.c. Provide utility function __elf_phdr_match_addr to do the match of address against dso executable segment. Call back into libthr from __cxa_finalize using weak __pthread_cxa_finalize symbol to remove any atfork handler which function points into unloaded object. The rtld needs private __pthread_cxa_finalize symbol to not require resolution of the weak undefined symbol at initialization time. This cannot work, since rtld is relocated before sym_zero is set up. Idea by: kan Reviewed by: kan (previous version) MFC after: 3 weeks Revision Changes Path 1.155 +1 -1 src/lib/libc/gen/Makefile.inc 1.35 +1 -0 src/lib/libc/gen/Symbol.map 1.1 +47 -0 src/lib/libc/gen/elf_utils.c (new) 1.25 +2 -0 src/lib/libc/include/libc_private.h 1.11 +20 -3 src/lib/libc/stdlib/atexit.c 1.34 +1 -0 src/lib/libthr/pthread.map 1.15 +22 -0 src/lib/libthr/thread/thr_fork.c 1.99 +3 -0 src/lib/libthr/thread/thr_private.h 1.155 +12 -0 src/libexec/rtld-elf/rtld.c