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
diff --git a/linker/linker.h b/linker/linker.h
index aa1e5e7..c9e0309 100644
--- a/linker/linker.h
+++ b/linker/linker.h
@@ -149,6 +149,8 @@
unsigned refcount;
struct link_map linkmap;
+
+ int constructors_called;
};
@@ -217,6 +219,7 @@
soinfo *find_containing_library(const void *addr);
Elf32_Sym *find_containing_symbol(const void *addr, soinfo *si);
const char *linker_get_error(void);
+void call_constructors_recursive(soinfo *si);
#ifdef ANDROID_ARM_LINKER
typedef long unsigned int *_Unwind_Ptr;