diff options
author | Roland Levillain <rpl@google.com> | 2019-07-02 16:40:19 +0100 |
---|---|---|
committer | Roland Levillain <rpl@google.com> | 2019-07-02 16:58:02 +0100 |
commit | dc25f6c717dfa2d611d2b8bf49d47bc5e660928f (patch) | |
tree | 8dfd9b6ec485b5b8509d5860ec2a5498db402d25 /linker/linker.cpp | |
parent | afce4e897fdd8ed29bcfacf552216e1e106409c0 (diff) |
Use an APEX's linker configuration for any executable under its `bin` directory.
Previously, the linker configuration of an APEX would only be used for
executables located exactly in its `bin` directory. This change
relaxes this condition to also include executables located in any
directory under the APEX's `bin` directory.
This change is needed to support APEX binaries located in directories
under the APEX's `bin` directory that need to use the APEX's linker
configuration (e.g. ART gtests located in
`bin/art/{arm,arm64,x86,x86-64}` in the Testing Runtime APEX).
Test: Run ART gtests on device using the Testing Runtime APEX
Bug: 129534335
Change-Id: I0eac317eba856211a344fa00e66640aae10816ea
Diffstat (limited to 'linker/linker.cpp')
-rw-r--r-- | linker/linker.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/linker/linker.cpp b/linker/linker.cpp index 9bb655792..55d684fa7 100644 --- a/linker/linker.cpp +++ b/linker/linker.cpp @@ -4082,10 +4082,10 @@ static std::vector<android_namespace_t*> init_default_namespace_no_config(bool i return namespaces; } -// return /apex/<name>/etc/ld.config.txt from /apex/<name>/bin/<exec> +// return /apex/<name>/etc/ld.config.txt from /apex/<name>/bin/* 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") { + if (paths.size() >= 5 && paths[1] == "apex" && paths[3] == "bin") { return std::string("/apex/") + paths[2] + "/etc/ld.config.txt"; } return ""; |