From bc5949fd4f8cddf4eee74492c86a8a72f4dee0e7 Mon Sep 17 00:00:00 2001 From: Leonid Lisovskiy Date: Mon, 20 Jun 2016 20:29:45 +0300 Subject: ldso: fix dlsym hang when reloading DSOs It can happen under certain cases that the DSO had refcount 0, but was already loaded. (NODELETE flag is set, or it is pulled in via both NEEDED dependency and explicit dlopen()). Add extra reference count for NODELETE objects, this will ensure that the reference count never drops below one. It is improved version of http://lists.busybox.net/pipermail/uclibc/2013-June/047826.html Signed-off-by: Leonid Lisovskiy --- test/dlopen/Makefile.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'test/dlopen/Makefile.in') diff --git a/test/dlopen/Makefile.in b/test/dlopen/Makefile.in index 0bed0f749..740453a19 100644 --- a/test/dlopen/Makefile.in +++ b/test/dlopen/Makefile.in @@ -5,7 +5,7 @@ export UCLIBC_ONLY := 1 TESTS := dltest dltest2 dlstatic test1 test2 test3 dlundef dlafk dladdr \ - testscope nodelete tst-origin + testscope nodelete nodelete1 tst-origin ifneq ($(HAVE_SHARED),y) TESTS_DISABLED := test3 @@ -80,3 +80,5 @@ LDFLAGS_nodelete := -rdynamic -ldl LDFLAGS_nodelmod1.so := -Wl,-z,nodelete LDFLAGS_nodelmod3.so := ./nodelmod4.so LDFLAGS_nodelmod4.so := -Wl,-z,nodelete +nodelete1: nodelmod1.so nodelmod2.so +LDFLAGS_nodelete1 := -rdynamic -ldl -- cgit v1.2.3