linker: log only real dlerrors
Currently linker reports all potential dlerrors
for example if library was not found in 'this'
namespace - it initializes linker error buffer
with not found message but when consequent
search in linked namespace succeeds this message
is droped because dlopen was successful.
This commit avoids logging false positive error
messages when debug.ld.* set to dlerror.
Test: manual
Change-Id: I480694a1b1bbacd6bd1d8505cd2ee491710964cc
(cherry picked from commit 11968b80af5be601b820f261e2e102e5b8ed48c4)
diff --git a/linker/dlfcn.cpp b/linker/dlfcn.cpp
index 5ccd656..96dd477 100644
--- a/linker/dlfcn.cpp
+++ b/linker/dlfcn.cpp
@@ -48,6 +48,7 @@
char* old_value = *dlerror_slot;
*dlerror_slot = new_value;
+ LD_LOG(kLogErrors, "%s\n", new_value);
return old_value;
}