aboutsummaryrefslogtreecommitdiff
path: root/linker
diff options
context:
space:
mode:
authorJooyung Han <jooyung@google.com>2020-06-02 15:38:49 +0900
committerJooyung Han <jooyung@google.com>2020-06-02 16:05:01 +0900
commit61a9a4016cc8d5562714732a6dfe9eb014a616d3 (patch)
treed69afb0a1328994ab16750cb7fa6827d7185b225 /linker
parent6a642f7760597c0f1e3bddc6f3ac9e96d5b0e39a (diff)
downloadbionic-61a9a4016cc8d5562714732a6dfe9eb014a616d3.tar.gz
Make .whitelisted property "append"-able
.whitelisted is a list of sonames seperated by ":" just like .shared_libs and .paths properties. It makes sense to make it appendable using += as well ass .shared_libs and .paths. Bug: n/a Test: atest linker-unit-tests Change-Id: If61cc553c8080e8a58de8a3a6051c1853f7bfe5f
Diffstat (limited to 'linker')
-rw-r--r--linker/linker_config.cpp3
-rw-r--r--linker/linker_config_test.cpp5
2 files changed, 6 insertions, 2 deletions
diff --git a/linker/linker_config.cpp b/linker/linker_config.cpp
index ada25a589..aaa3a0314 100644
--- a/linker/linker_config.cpp
+++ b/linker/linker_config.cpp
@@ -325,7 +325,8 @@ static bool parse_config_file(const char* ld_config_file_path,
value = "," + value;
(*properties)[name].append_value(std::move(value));
} else if (android::base::EndsWith(name, ".paths") ||
- android::base::EndsWith(name, ".shared_libs")) {
+ android::base::EndsWith(name, ".shared_libs") ||
+ android::base::EndsWith(name, ".whitelisted")) {
value = ":" + value;
(*properties)[name].append_value(std::move(value));
} else {
diff --git a/linker/linker_config_test.cpp b/linker/linker_config_test.cpp
index 49370566c..3caa4d47f 100644
--- a/linker/linker_config_test.cpp
+++ b/linker/linker_config_test.cpp
@@ -47,6 +47,7 @@
#define ARCH_SUFFIX ""
#endif
+// clang-format off
static const char* config_str =
"# comment \n"
"dir.test = /data/local/tmp\n"
@@ -88,8 +89,10 @@ static const char* config_str =
"namespace.vndk_in_system.visible = true\n"
"namespace.vndk_in_system.search.paths = /system/${LIB}\n"
"namespace.vndk_in_system.permitted.paths = /system/${LIB}\n"
- "namespace.vndk_in_system.whitelisted = libz.so:libyuv.so:libtinyxml2.so\n"
+ "namespace.vndk_in_system.whitelisted = libz.so:libyuv.so\n"
+ "namespace.vndk_in_system.whitelisted += libtinyxml2.so\n"
"\n";
+// clang-format on
static bool write_version(const std::string& path, uint32_t version) {
std::string content = android::base::StringPrintf("%d", version);