about summary refs log tree commit diff
path: root/dlfcn
diff options
context:
space:
mode:
Diffstat (limited to 'dlfcn')
-rw-r--r--dlfcn/Makefile5
1 files changed, 5 insertions, 0 deletions
diff --git a/dlfcn/Makefile b/dlfcn/Makefile
index 65694165e6..7bd7468993 100644
--- a/dlfcn/Makefile
+++ b/dlfcn/Makefile
@@ -79,3 +79,8 @@ $(objpfx)tstcxaatexit: $(libdl)
 $(objpfx)tstcxaatexit.out: $(objpfx)tstcxaatexit $(objpfx)modcxaatexit.so
 
 $(objpfx)modatexit.so: $(common-objpfx)libc.so $(common-objpfx)libc_nonshared.a
+
+# Depend on libc.so so a DT_NEEDED is generated in the shared objects.
+# This ensures they will load libc.so for needed symbols if loaded by
+# a statically-linked program that hasn't already loaded it.
+$(objpfx)libdl.so: $(common-objpfx)libc.so $(common-objpfx)libc_nonshared.a