diff options
author | Kiyoung Kim <kiyoungkim@google.com> | 2019-08-14 09:28:23 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2019-08-14 09:28:23 +0000 |
commit | 6b0d1cd3ac703f812d45f89085c46112d0decaf3 (patch) | |
tree | 7e219cdde1907d846f5fbd780c2d5e05f33cbef7 /linker/linker.cpp | |
parent | 80d85f72dda85a6b31ffd99d7ce0b85e31c4c054 (diff) | |
parent | 35e3b4b0132533d0b2ff5a839d22e202e9374ae3 (diff) |
Merge "Use generated linker config"
Diffstat (limited to 'linker/linker.cpp')
-rw-r--r-- | linker/linker.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/linker/linker.cpp b/linker/linker.cpp index 4aefaf7d4..dc819c18d 100644 --- a/linker/linker.cpp +++ b/linker/linker.cpp @@ -91,6 +91,8 @@ static const char* const kLdConfigArchFilePath = "/system/etc/ld.config." ABI_ST static const char* const kLdConfigFilePath = "/system/etc/ld.config.txt"; static const char* const kLdConfigVndkLiteFilePath = "/system/etc/ld.config.vndk_lite.txt"; +static const char* const kLdGeneratedConfigFilePath = "/dev/linkerconfig/ld.config.txt"; + #if defined(__LP64__) static const char* const kSystemLibDir = "/system/lib64"; static const char* const kOdmLibDir = "/odm/lib64"; @@ -4170,6 +4172,13 @@ static std::string get_ld_config_file_path(const char* executable_path) { } #endif + // Use generated linker config if flag is set + // TODO(b/138920271) Do not check property once it is confirmed as stable + if (android::base::GetBoolProperty("sys.linker.use_generated_config", false) && + file_exists(kLdGeneratedConfigFilePath)) { + return kLdGeneratedConfigFilePath; + } + std::string path = get_ld_config_file_apex_path(executable_path); if (!path.empty()) { if (file_exists(path.c_str())) { |