diff options
author | kib <kib@FreeBSD.org> | 2010-08-23 15:38:02 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2010-08-23 15:38:02 +0000 |
commit | df9bc4850f3a6aef289d53c0c3d1fc78d63bdda2 (patch) | |
tree | 509be3ad57df8011e952d3da4691f43abd346d2e /libexec | |
parent | 7ca1c6f40abcb8550b7bbf0c67ceb3a73d93b342 (diff) | |
download | FreeBSD-src-df9bc4850f3a6aef289d53c0c3d1fc78d63bdda2.zip FreeBSD-src-df9bc4850f3a6aef289d53c0c3d1fc78d63bdda2.tar.gz |
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
Diffstat (limited to 'libexec')
-rw-r--r-- | libexec/rtld-elf/rtld.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 77eeafb..dc5cdca 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -3692,6 +3692,10 @@ fetch_ventry(const Obj_Entry *obj, unsigned long symnum) return NULL; } +/* + * Overrides for libc_pic-provided functions. + */ + int __getosreldate(void) { @@ -3711,3 +3715,11 @@ __getosreldate(void) osreldate = osrel; return (osreldate); } + +/* + * No unresolved symbols for rtld. + */ +void +__pthread_cxa_finalize(struct dl_phdr_info *a) +{ +} |