about summary refs log tree commit diff
path: root/dlfcn/Makefile
diff options
context:
space:
mode:
authorCarlos O'Donell <carlos@systemhalted.org>2015-01-21 01:51:10 -0500
committerCarlos O'Donell <carlos@systemhalted.org>2015-01-21 01:51:10 -0500
commitccdb048df457d581f6ac7ede8b0c7a593a891dfa (patch)
tree9f87447c45093fb2ded95c982e68c9e6e886129c /dlfcn/Makefile
parent042e1521c794a945edc43b5bfa7e69ad70420524 (diff)
downloadglibc-ccdb048df457d581f6ac7ede8b0c7a593a891dfa.tar.gz
glibc-ccdb048df457d581f6ac7ede8b0c7a593a891dfa.tar.xz
glibc-ccdb048df457d581f6ac7ede8b0c7a593a891dfa.zip
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
Diffstat (limited to 'dlfcn/Makefile')
-rw-r--r--dlfcn/Makefile7
1 files changed, 5 insertions, 2 deletions
diff --git a/dlfcn/Makefile b/dlfcn/Makefile
index fce4aaeb08..363278aced 100644
--- a/dlfcn/Makefile
+++ b/dlfcn/Makefile
@@ -36,13 +36,13 @@ endif
 ifeq (yes,$(build-shared))
 tests = glrefmain failtest tst-dladdr default errmsg1 tstcxaatexit \
 	bug-dlopen1 bug-dlsym1 tst-dlinfo bug-atexit1 bug-atexit2 \
-	bug-atexit3 tstatexit bug-dl-leaf
+	bug-atexit3 tstatexit bug-dl-leaf tst-rec-dlopen
 endif
 modules-names = glreflib1 glreflib2 glreflib3 failtestmod defaultmod1 \
 		defaultmod2 errmsg1mod modatexit modcxaatexit \
 		bug-dlsym1-lib1 bug-dlsym1-lib2 bug-atexit1-lib \
 		bug-atexit2-lib bug-atexit3-lib bug-dl-leaf-lib \
-		bug-dl-leaf-lib-cb
+		bug-dl-leaf-lib-cb moddummy1 moddummy2
 
 failtestmod.so-no-z-defs = yes
 glreflib2.so-no-z-defs = yes
@@ -139,3 +139,6 @@ $(objpfx)bug-dl-leaf: $(objpfx)bug-dl-leaf-lib.so
 $(objpfx)bug-dl-leaf.out: $(objpfx)bug-dl-leaf-lib-cb.so
 $(objpfx)bug-dl-leaf-lib.so: $(libdl)
 $(objpfx)bug-dl-leaf-lib-cb.so: $(objpfx)bug-dl-leaf-lib.so
+
+$(objpfx)tst-rec-dlopen: $(libdl)
+$(objpfx)tst-rec-dlopen.out: $(objpfx)moddummy1.so $(objpfx)moddummy2.so