freebsd-dev/libexec/rtld-elf
Jaakko Heinonen 4ef75f147a If dlclose() is called recursively from a _fini() function, the inner
dlclose() call may unload the object of the outer call prematurely
because objects are unreferenced before _fini() calls.

Fix this by unreferencing objects after calling objlist_call_fini() in
dlclose(). Therefore objlist_call_fini() now calls the fini function if
the reference count of an object is 1. In addition we must restart the
list_fini traversal after every _fini() call because another dlclose()
call might have modified the reference counts.

Add an XXX comment to objlist_call_fini() about possible race with
dlopen().

PR:		133246, 149464
Reviewed by:	kan, kib
2010-12-16 16:56:44 +00:00
..
amd64 MFtbemd: 2010-08-23 22:24:11 +00:00
arm Only use the cache after the early stage of loading. This is 2010-05-18 08:55:23 +00:00
i386 MFtbemd: 2010-08-23 22:24:11 +00:00
ia64 Unbreak ia64. 2010-10-22 04:43:04 +00:00
mips Add parentheses around the argument 'x' used in the __bswapXX(x) macros. Revert 2010-08-11 02:28:39 +00:00
powerpc Fix two subtle problems in PPC32 RTLD. The first is a concurrency issue 2010-10-04 16:02:11 +00:00
powerpc64 Check for undefined weak symbols during PLT binding on powerpc64, and do 2010-09-12 17:04:51 +00:00
sparc64 Only use the cache after the early stage of loading. This is 2010-05-18 08:55:23 +00:00
debug.c Fix warnings on 64 bit platforms. 2003-06-19 16:09:18 +00:00
debug.h Use C99's varadic macro syntax instead of gcc's. 2006-03-28 18:26:47 +00:00
libmap.c Fix a malloc overrun in 32-bit compat libmap lookup code. 2006-01-31 06:08:28 +00:00
libmap.h Description from Dan: 2005-02-04 02:46:41 +00:00
Makefile Use -fPIC to build libexec/rtld-elf on sparc64, so it will also be able 2010-11-11 22:53:55 +00:00
malloc.c Use the newly provided aux vectors to get pagesize and osreldate information. 2010-08-17 09:05:39 +00:00
map_object.c In rtld's map_object(), use pread(..., 0) rather than read() to read the 2009-10-06 17:14:39 +00:00
rtld_lock.c Prefer <sys/param.h> to <machine/param.h> for the definition of 2009-04-20 10:35:50 +00:00
rtld_lock.h Provide custom simple allocator for rtld locks in libthr. The allocator 2008-12-02 11:58:31 +00:00
rtld_tls.h Add support for Thread Local Storage. 2004-08-03 08:51:00 +00:00
rtld.1 mdoc: drop redundant .Pp and .LP calls 2010-10-08 12:40:16 +00:00
rtld.c If dlclose() is called recursively from a _fini() function, the inner 2010-12-16 16:56:44 +00:00
rtld.h If dlopen() is called for the dso that has been already loaded as a 2010-11-03 09:23:08 +00:00
Symbol.map Introduce implementation-private rtld interface _rtld_addr_phdr, which 2010-08-23 15:27:03 +00:00
xmalloc.c Add function prototypes. 2003-06-19 05:28:26 +00:00