linker: add more context to link failure error.
This change makes it easier to diagnose mistakes in linker
configuration that result in a library being accidentally loaded in
multiple namespaces without its dependencies available everywhere.
Test: manually tested the error message
Test: bionic-unit-tests
Change-Id: I03a20507f8fc902c2445a7fbbf59767ffffd5ebf
diff --git a/tests/dl_test.cpp b/tests/dl_test.cpp
index 9e46394..b69da97 100644
--- a/tests/dl_test.cpp
+++ b/tests/dl_test.cpp
@@ -204,7 +204,10 @@
// The two libs are in ns2/ subdir.
TEST(dl, exec_without_ld_config_file) {
#if defined(__BIONIC__)
- std::string error_message = "CANNOT LINK EXECUTABLE \"" + GetTestlibRoot() + "/ld_config_test_helper/ld_config_test_helper\": library \"ld_config_test_helper_lib1.so\" not found\n";
+ std::string error_message =
+ "CANNOT LINK EXECUTABLE \"" + GetTestlibRoot() +
+ "/ld_config_test_helper/ld_config_test_helper\": library \"ld_config_test_helper_lib1.so\" "
+ "not found: needed by main executable\n";
std::string helper = GetTestlibRoot() +
"/ld_config_test_helper/ld_config_test_helper";
chmod(helper.c_str(), 0755);