dir.${section}: downgrade "can't resolve" diag
When parsing a dir.${section} line in ld.config.txt, the linker uses
realpath() to resolve each directory path. If realpath() fails, the linker
uses the non-resolved path instead. Previously, it issued a warning to
stderr and logcat, but realpath() is expected to fail on /postinstall when
running a binary in /data/local/tmp, so downgrade the warning to an INFO()
notice.
Bug: http://b/120996057
Test: copy ping to /data/local/tmp, run it, verify no errors
Test: bionic unit tests
Change-Id: I2104084e12ea18840230997408559299bf3bddac
diff --git a/linker/linker_config.cpp b/linker/linker_config.cpp
index ac4c1fd..0e75c85 100644
--- a/linker/linker_config.cpp
+++ b/linker/linker_config.cpp
@@ -241,11 +241,15 @@
if (realpath(value.c_str(), buf)) {
resolved_path = buf;
} else if (errno != ENOENT) {
- DL_WARN("%s:%zd: warning: path \"%s\" couldn't be resolved: %s",
- ld_config_file_path,
- cp.lineno(),
- value.c_str(),
- strerror(errno));
+ // realpath is expected to fail with EPERM in some situations, so log
+ // the failure with INFO rather than DL_WARN. e.g. A binary in
+ // /data/local/tmp may attempt to stat /postinstall. See
+ // http://b/120996057.
+ INFO("%s:%zd: warning: path \"%s\" couldn't be resolved: %s",
+ ld_config_file_path,
+ cp.lineno(),
+ value.c_str(),
+ strerror(errno));
resolved_path = value;
} else {
// ENOENT: no need to test if binary is under the path