diff options
Diffstat (limited to 'linker/linker.cpp')
-rw-r--r-- | linker/linker.cpp | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/linker/linker.cpp b/linker/linker.cpp index 9301f8cb5..e5450c7b9 100644 --- a/linker/linker.cpp +++ b/linker/linker.cpp @@ -3375,6 +3375,22 @@ static std::string get_ld_config_file_vndk_path() { return ld_config_file_vndk; } +bool is_linker_config_expected(const char* executable_path) { + // Do not raise message from a host environment which is expected to miss generated linker + // configuration. +#if !defined(__ANDROID__) + return false; +#endif + + if (strcmp(executable_path, "/system/bin/init") == 0) { + // Generated linker configuration can be missed from processes executed + // with init binary + return false; + } + + return true; +} + static std::string get_ld_config_file_path(const char* executable_path) { #ifdef USE_LD_CONFIG_FILE // This is a debugging/testing only feature. Must not be available on @@ -3403,12 +3419,10 @@ static std::string get_ld_config_file_path(const char* executable_path) { return kLdGeneratedConfigFilePath; } - // Do not raise message from a host environment which is expected to miss generated linker - // configuration. -#if defined(__ANDROID__) - DL_WARN("Warning: failed to find generated linker configuration from \"%s\"", - kLdGeneratedConfigFilePath); -#endif + if (is_linker_config_expected(executable_path)) { + DL_WARN("Warning: failed to find generated linker configuration from \"%s\"", + kLdGeneratedConfigFilePath); + } path = get_ld_config_file_vndk_path(); if (file_exists(path.c_str())) { |