OSDN Git Service

Log call to elf-constructors
authorDimitry Ivanov <dimitry@google.com>
Mon, 21 Nov 2016 18:44:35 +0000 (10:44 -0800)
committerDimitry Ivanov <dimitry@google.com>
Mon, 21 Nov 2016 20:32:08 +0000 (12:32 -0800)
Log call to constructors when dlopen logging is enabled.

Bug: http://b/29458203
Test: bionic-unit-tests --gtest_filter=dl*:Dl*
Change-Id: I0cd591bf147f8f910ae9def1ac4089ef44099aff

linker/linker.cpp

index 266ca6e..62e6bb6 100644 (file)
@@ -1804,10 +1804,13 @@ void* do_dlopen(const char* name, int flags, const android_dlextinfo* extinfo,
   ProtectedDataGuard guard;
   soinfo* si = find_library(ns, translated_name, flags, extinfo, caller);
   if (si != nullptr) {
-    failure_guard.disable();
-    si->call_constructors();
     void* handle = si->to_handle();
     LD_LOG(kLogDlopen,
+           "... dlopen calling constructors: realpath=\"%s\", soname=\"%s\", handle=%p",
+           si->get_realpath(), si->get_soname(), handle);
+    si->call_constructors();
+    failure_guard.disable();
+    LD_LOG(kLogDlopen,
            "... dlopen successful: realpath=\"%s\", soname=\"%s\", handle=%p",
            si->get_realpath(), si->get_soname(), handle);
     return handle;