OSDN Git Service

Do not add arcs to the soinfo graph on dlopen
authorBjorn Andersson <bjorn.andersson@sonymobile.com>
Fri, 23 May 2014 00:53:01 +0000 (17:53 -0700)
committerDmitriy Ivanov <dimitry@google.com>
Fri, 23 May 2014 02:08:14 +0000 (19:08 -0700)
While introducing RTLD_NOLOAD in b648a8a5 a change in how soinfo structs are
connected was also introduced. When calling dlopen the library that is loaded
is added as a child to the soinfo from which the caller comes - i.e. building a
dependency graph.

Unfortunately this shows issues upon unloading, such as blowing the stack if
there are loops in the graph.

This change reverts that part of b648a8a5, keeping everything as a child of the
root soinfo.

Change-Id: I604ee9210613b19f693a568158e69707620a95db
Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
linker/linker.cpp

index 9f458b4..151d4ce 100644 (file)
@@ -841,9 +841,6 @@ soinfo* do_dlopen(const char* name, int flags, soinfo* caller, const android_dle
   soinfo* si = find_library(name, flags, extinfo);
   if (si != NULL) {
     si->CallConstructors();
-    if (caller != NULL) {
-      caller->add_child(si);
-    }
   }
   protect_data(PROT_READ);
   return si;