freebsd-dev/libexec/rtld-elf
Konstantin Belousov 4495a80b97 In r214728, if dlopen() is called for the object that has been already
loaded as a dependency and marked -z nodlopen, object' DAG is already
initialized by load_needed_objects(). Due to this, the init_dag() call
from dlopen() does not increment refcount for the object [1].

Change init_dag() to not increment DAG refcount. Require explicit calls
to ref_dag() to increment, and assert that ref_dag() and unref_dag()
are called for root that has dag initialized. To fix the noted issue,
unconditionally call both init_dag() and ref_dag() in dlopen() for the
case when the object was already loaded, making it similar to the case
of newly loaded object.

Noted by:	jh [1]
Reviewed by:	jh, kan
MFC after:	6 days
2010-11-04 09:29:00 +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 Unbreak ia64. 2010-10-22 04:43:04 +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 In r214728, if dlopen() is called for the object that has been already 2010-11-04 09:29:00 +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