summaryrefslogtreecommitdiff
path: root/linker/linker.cpp
diff options
context:
space:
mode:
authorKiyoung Kim <kiyoungkim@google.com>2020-02-07 03:25:42 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2020-02-07 03:25:42 +0000
commita399ede44ec4aa81e4b4cf655496e4618e94ad62 (patch)
treeaa9ccc453b5d11dbd928cc50c67b54446c85007d /linker/linker.cpp
parent6fa2f4f2ff13deffce0e254a72e9d57bbee9000d (diff)
parentfb58744f6b313c5f85a289555b2f5f2d732e3528 (diff)
Merge "Use generated linker config for APEX binaries"
Diffstat (limited to 'linker/linker.cpp')
-rw-r--r--linker/linker.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/linker/linker.cpp b/linker/linker.cpp
index 5d381517a..0acb9c68f 100644
--- a/linker/linker.cpp
+++ b/linker/linker.cpp
@@ -3447,6 +3447,12 @@ static std::vector<android_namespace_t*> init_default_namespace_no_config(bool i
static std::string get_ld_config_file_apex_path(const char* executable_path) {
std::vector<std::string> paths = android::base::Split(executable_path, "/");
if (paths.size() >= 5 && paths[1] == "apex" && paths[3] == "bin") {
+ // Check auto-generated ld.config.txt first
+ std::string generated_apex_config = "/linkerconfig/" + paths[2] + "/ld.config.txt";
+ if (file_exists(generated_apex_config.c_str())) {
+ return generated_apex_config;
+ }
+
return std::string("/apex/") + paths[2] + "/etc/ld.config.txt";
}
return "";