Load libraries in breadth-first order

This patch fixes the problem with symbol search order
  for dlsym(RTLD_DEFAULT/RTLD_NEXT, .) by loading libraries
  and ld_preloads in correct order.

Bug: https://code.google.com/p/android/issues/detail?id=74255
Change-Id: If1ba5c807322409faa914e27ecb675e2c4541f0d
Attempt: 2
This commit is contained in:
Dmitriy Ivanov
2014-09-05 16:42:53 -07:00
parent 320a01d516
commit 14669a939d
13 changed files with 763 additions and 202 deletions

View File

@@ -204,6 +204,7 @@ struct soinfo {
void CallConstructors();
void CallDestructors();
void CallPreInitConstructors();
bool PrelinkImage();
bool LinkImage(const android_dlextinfo* extinfo);
void add_child(soinfo* child);
@@ -217,6 +218,7 @@ struct soinfo {
bool get_has_ifuncs();
soinfo_list_t& get_children();
soinfo_list_t& get_parents();
bool inline has_min_version(uint32_t min_version) {
return (flags & FLAG_NEW_SOINFO) != 0 && version >= min_version;