summaryrefslogtreecommitdiffstats
path: root/linker/dlfcn.c
diff options
context:
space:
mode:
authorEvgeniy Stepanov <eugenis@google.com>2011-12-21 13:03:54 +0400
committerEvgeniy Stepanov <eugenis@google.com>2012-01-10 13:30:41 +0400
commite83c56dfbb6a9a61f0f18031620322af97e80162 (patch)
tree4d173357ad7cffa5e8e01066653afde7ed2473d5 /linker/dlfcn.c
parent334379dadaf481785909367cfc26600514b6119c (diff)
downloadbionic-e83c56dfbb6a9a61f0f18031620322af97e80162.zip
bionic-e83c56dfbb6a9a61f0f18031620322af97e80162.tar.gz
bionic-e83c56dfbb6a9a61f0f18031620322af97e80162.tar.bz2
Execute .preinit_array before any shared object initialization functions.
This change makes linker handling of .preinit_array compliant with the System V ABI: "These [pre-initialization] functions are executed after the dynamic linker has built the process image and performed relocations but before any shared object initialization functions." http://www.sco.com/developers/gabi/latest/ch5.dynamic.html#init_fini Change-Id: Iebfee22bb1ebe1d7c7e69cb4686e4ebae0dfc4bb
Diffstat (limited to 'linker/dlfcn.c')
-rw-r--r--linker/dlfcn.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/linker/dlfcn.c b/linker/dlfcn.c
index 7161455..62dde2f 100644
--- a/linker/dlfcn.c
+++ b/linker/dlfcn.c
@@ -60,6 +60,7 @@ void *dlopen(const char *filename, int flag)
if (unlikely(ret == NULL)) {
set_dlerror(DL_ERR_CANNOT_LOAD_LIBRARY);
} else {
+ call_constructors_recursive(ret);
ret->refcount++;
}
pthread_mutex_unlock(&dl_lock);