diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2017-12-03 14:27:49 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2017-12-03 14:27:49 +0000 |
commit | 86a380379965714594457a29077aaee05bad77ba (patch) | |
tree | c9e909d791b30da5a3106d18bb6bc18645768ae1 /linker/linker.cpp | |
parent | 96867b148f5cc85951bc0170c4d94f8f124f9f06 (diff) | |
parent | 53ce74288c4ba4e303b897a4ce0b4e9806c6e87c (diff) |
Merge "Use ld.config.$VER.txt when current VNDK version is $VER"
Diffstat (limited to 'linker/linker.cpp')
-rw-r--r-- | linker/linker.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/linker/linker.cpp b/linker/linker.cpp index 85376e0f7..66ae19110 100644 --- a/linker/linker.cpp +++ b/linker/linker.cpp @@ -3526,7 +3526,14 @@ std::vector<android_namespace_t*> init_default_namespaces(const char* executable std::string error_msg; - const char* config_file = file_exists(kLdConfigArchFilePath) ? kLdConfigArchFilePath : kLdConfigFilePath; + std::string ld_config_vndk = kLdConfigFilePath; + size_t insert_pos = ld_config_vndk.find_last_of("."); + if (insert_pos == std::string::npos) { + insert_pos = ld_config_vndk.length(); + } + ld_config_vndk.insert(insert_pos, Config::get_vndk_version_string('.')); + const char* ld_config_txt = file_exists(ld_config_vndk.c_str()) ? ld_config_vndk.c_str() : kLdConfigFilePath; + const char* config_file = file_exists(kLdConfigArchFilePath) ? kLdConfigArchFilePath : ld_config_txt; #ifdef USE_LD_CONFIG_FILE // This is a debugging/testing only feature. Must not be available on // production builds. |