]> CyberLeo.Net >> Repos - FreeBSD/stable/8.git/commit
MFC r211706:
authorkib <kib@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Wed, 9 May 2012 15:57:59 +0000 (15:57 +0000)
committerkib <kib@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Wed, 9 May 2012 15:57:59 +0000 (15:57 +0000)
commitb88c31a3ac64a113a1c09366df5ea8d57f1f4cf1
tree8c5087bcbd0ec2547580cc5b88e11ad76a995d5b
parent3320a9351decd0d68c2e42a8b2c8bf679c2d7ef6
MFC r211706:
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.

MFC r211894:
Do not call __pthread_cxa_finalize with invalid struct dl_phdr_info.

Requested and tested by: Peter Jeremy <peter rulingia com>

git-svn-id: svn://svn.freebsd.org/base/stable/8@235198 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
lib/libc/gen/Makefile.inc
lib/libc/gen/Symbol.map
lib/libc/gen/elf_utils.c [new file with mode: 0644]
lib/libc/include/libc_private.h
lib/libc/stdlib/atexit.c
lib/libthr/pthread.map
lib/libthr/thread/thr_fork.c
lib/libthr/thread/thr_private.h
libexec/rtld-elf/rtld.c