Fix recursive dlopen.
authorCarlos O'Donell <carlos@systemhalted.org>
Wed, 21 Jan 2015 06:51:10 +0000 (01:51 -0500)
committerCarlos O'Donell <carlos@systemhalted.org>
Wed, 21 Jan 2015 06:51:10 +0000 (01:51 -0500)
commitccdb048df457d581f6ac7ede8b0c7a593a891dfa
tree9f87447c45093fb2ded95c982e68c9e6e886129c
parent042e1521c794a945edc43b5bfa7e69ad70420524
Fix recursive dlopen.

The ability to recursively call dlopen is useful for malloc
implementations that wish to load other dynamic modules that
implement reentrant/AS-safe functions to use in their own
implementation.

Given that a user malloc implementation may be called by an
ongoing dlopen to allocate memory the user malloc
implementation interrupts dlopen and if it calls dlopen again
that's a reentrant call.

This patch fixes the issues with the ld.so.cache mapping
and the _r_debug assertion which prevent this from working
as expected.

See:
https://sourceware.org/ml/libc-alpha/2014-12/msg00446.html
ChangeLog
NEWS
dlfcn/Makefile
dlfcn/moddummy1.c [new file with mode: 0644]
dlfcn/moddummy2.c [new file with mode: 0644]
dlfcn/tst-rec-dlopen.c [new file with mode: 0644]
elf/dl-cache.c
elf/dl-load.c
elf/dl-open.c
sysdeps/generic/ldsodefs.h