summaryrefslogtreecommitdiff
path: root/linker/linker.cpp
diff options
context:
space:
mode:
authorJustin Yun <justinyun@google.com>2017-12-03 14:32:36 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-12-03 14:32:36 +0000
commitbf9cf750a4b893a61cd425dffd640986ed6f2857 (patch)
treea7288f7f502b56b549489afcf67a7cacf4a2fac8 /linker/linker.cpp
parentf8fdd5dacd25d25af0c6327025e920558cde2d97 (diff)
parent86a380379965714594457a29077aaee05bad77ba (diff)
Merge "Use ld.config.$VER.txt when current VNDK version is $VER"
am: 86a3803799 Change-Id: I350a75a183717e3cd0a68d3a9ed524f19f077a2f
Diffstat (limited to 'linker/linker.cpp')
-rw-r--r--linker/linker.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/linker/linker.cpp b/linker/linker.cpp
index 1a005faa0..064657964 100644
--- a/linker/linker.cpp
+++ b/linker/linker.cpp
@@ -3553,7 +3553,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.