Use consistent quoting in linker messages.
Using single quotes can be more convenient -- because there's no need to
escape -- but the vast majority of existing quoting was done with double
quotes, so move in that direction.
Bug: http://b/27524191
Change-Id: I8f58593120e4c8aeaec45e16fc0178e9c162454d
diff --git a/linker/linker.cpp b/linker/linker.cpp
index 0eba77c..4478c12 100644
--- a/linker/linker.cpp
+++ b/linker/linker.cpp
@@ -574,7 +574,7 @@
std::vector<char> buf(PATH_MAX), proc_self_fd(PATH_MAX);
__libc_format_buffer(&proc_self_fd[0], proc_self_fd.size(), "/proc/self/fd/%d", fd);
if (readlink(&proc_self_fd[0], &buf[0], buf.size()) == -1) {
- PRINT("readlink('%s') failed: %s [fd=%d]", &proc_self_fd[0], strerror(errno), fd);
+ PRINT("readlink(\"%s\") failed: %s [fd=%d]", &proc_self_fd[0], strerror(errno), fd);
return false;
}
@@ -755,8 +755,8 @@
ELF_ST_BIND(s->st_info) == STB_WEAK) {
return s->st_shndx != SHN_UNDEF;
} else if (ELF_ST_BIND(s->st_info) != STB_LOCAL) {
- DL_WARN("unexpected ST_BIND value: %d for '%s' in '%s'",
- ELF_ST_BIND(s->st_info), si->get_string(s->st_name), si->get_realpath());
+ DL_WARN("unexpected ST_BIND value: %d for \"%s\" in \"%s\"",
+ ELF_ST_BIND(s->st_info), si->get_string(s->st_name), si->get_realpath());
}
return false;
@@ -1506,7 +1506,7 @@
}
const char* const path = normalized_path.c_str();
- TRACE("Trying zip file open from path '%s' -> normalized '%s'", input_path, path);
+ TRACE("Trying zip file open from path \"%s\" -> normalized \"%s\"", input_path, path);
// Treat an '!/' separator inside a path as the separator between the name
// of the zip file on disk and the subdirectory to search within it.
@@ -1669,7 +1669,7 @@
if (get_application_target_sdk_version() <= 22) {
const char* bname = basename(dt_needed);
if (bname != dt_needed) {
- DL_WARN("'%s' library has invalid DT_NEEDED entry '%s'", sopath, dt_needed);
+ DL_WARN("library \"%s\" has invalid DT_NEEDED entry \"%s\"", sopath, dt_needed);
add_dlwarning(sopath, "invalid DT_NEEDED entry", dt_needed);
}
@@ -1939,7 +1939,7 @@
// Library might still be loaded, the accurate detection
// of this fact is done by load_library.
- TRACE("[ '%s' find_loaded_library_by_soname returned false (*candidate=%s@%p). Trying harder...]",
+ TRACE("[ \"%s\" find_loaded_library_by_soname failed (*candidate=%s@%p). Trying harder...]",
task->get_name(), candidate == nullptr ? "n/a" : candidate->get_realpath(), candidate);
if (load_library(ns, task, zip_archive_cache, load_tasks, rtld_flags)) {
@@ -2179,7 +2179,7 @@
}
if (!root->can_unload()) {
- TRACE("not unloading '%s' - the binary is flagged with NODELETE", root->get_realpath());
+ TRACE("not unloading \"%s\" - the binary is flagged with NODELETE", root->get_realpath());
return;
}
@@ -2259,8 +2259,8 @@
soinfo_unload(si);
}
} else {
- TRACE("not unloading '%s' group, decrementing ref_count to %zd",
- root->get_realpath(), ref_count);
+ TRACE("not unloading \"%s\" group, decrementing ref_count to %zd",
+ root->get_realpath(), ref_count);
}
}
@@ -2695,7 +2695,7 @@
const char* sym_name = nullptr;
ElfW(Addr) addend = get_addend(rel, reloc);
- DEBUG("Processing '%s' relocation at index %zd", get_realpath(), idx);
+ DEBUG("Processing \"%s\" relocation at index %zd", get_realpath(), idx);
if (type == R_GENERIC_NONE) {
continue;
}
@@ -3048,7 +3048,7 @@
return;
}
- TRACE("[ Calling %s (size %zd) @ %p for '%s' ]", array_name, count, functions, get_realpath());
+ TRACE("[ Calling %s (size %zd) @ %p for \"%s\" ]", array_name, count, functions, get_realpath());
int begin = reverse ? (count - 1) : 0;
int end = reverse ? -1 : count;
@@ -3059,7 +3059,7 @@
call_function("function", functions[i]);
}
- TRACE("[ Done calling %s for '%s' ]", array_name, get_realpath());
+ TRACE("[ Done calling %s for \"%s\" ]", array_name, get_realpath());
}
void soinfo::call_function(const char* function_name __unused, linker_function_t function) {
@@ -3067,9 +3067,9 @@
return;
}
- TRACE("[ Calling %s @ %p for '%s' ]", function_name, function, get_realpath());
+ TRACE("[ Calling %s @ %p for \"%s\" ]", function_name, function, get_realpath());
function();
- TRACE("[ Done calling %s @ %p for '%s' ]", function_name, function, get_realpath());
+ TRACE("[ Done calling %s @ %p for \"%s\" ]", function_name, function, get_realpath());
}
void soinfo::call_pre_init_constructors() {
@@ -3424,7 +3424,7 @@
/* We can't log anything until the linker is relocated */
bool relocating_linker = (flags_ & FLAG_LINKER) != 0;
if (!relocating_linker) {
- INFO("[ Linking '%s' ]", get_realpath());
+ INFO("[ Linking \"%s\" ]", get_realpath());
DEBUG("si->base = %p si->flags = 0x%08x", reinterpret_cast<void*>(base), flags_);
}
@@ -4124,11 +4124,11 @@
if (!getauxval(AT_SECURE)) {
ldpath_env = getenv("LD_LIBRARY_PATH");
if (ldpath_env != nullptr) {
- INFO("[ LD_LIBRARY_PATH set to '%s' ]", ldpath_env);
+ INFO("[ LD_LIBRARY_PATH set to \"%s\" ]", ldpath_env);
}
ldpreload_env = getenv("LD_PRELOAD");
if (ldpreload_env != nullptr) {
- INFO("[ LD_PRELOAD set to '%s' ]", ldpreload_env);
+ INFO("[ LD_PRELOAD set to \"%s\" ]", ldpreload_env);
}
}
@@ -4281,7 +4281,7 @@
fflush(stdout);
#endif
- TRACE("[ Ready to execute '%s' @ %p ]", si->get_realpath(), reinterpret_cast<void*>(si->entry));
+ TRACE("[ Ready to execute \"%s\" @ %p ]", si->get_realpath(), reinterpret_cast<void*>(si->entry));
return si->entry;
}
diff --git a/linker/linker_dlwarning.cpp b/linker/linker_dlwarning.cpp
index cd76533..c53ad66 100644
--- a/linker/linker_dlwarning.cpp
+++ b/linker/linker_dlwarning.cpp
@@ -30,9 +30,8 @@
current_msg = current_msg + basename(sopath) + ": " + message;
if (value != nullptr) {
- current_msg = current_msg + " \'" + value + "\'";
+ current_msg = current_msg + " \"" + value + "\"";
}
-
}
// Resets the current one (like dlerror but instead of
diff --git a/linker/linker_mips.cpp b/linker/linker_mips.cpp
index 6130066..2d565d7 100644
--- a/linker/linker_mips.cpp
+++ b/linker/linker_mips.cpp
@@ -67,7 +67,7 @@
ElfW(Addr) sym_addr = 0;
const char* sym_name = nullptr;
- DEBUG("Processing '%s' relocation at index %zd", get_realpath(), idx);
+ DEBUG("Processing \"%s\" relocation at index %zd", get_realpath(), idx);
if (type == R_GENERIC_NONE) {
continue;
}
diff --git a/linker/linker_utils.cpp b/linker/linker_utils.cpp
index 1b0c4e4..fb070ee 100644
--- a/linker/linker_utils.cpp
+++ b/linker/linker_utils.cpp
@@ -20,7 +20,7 @@
bool normalize_path(const char* path, std::string* normalized_path) {
// Input should be an absolute path
if (path[0] != '/') {
- PRINT("normalize_path - invalid input: '%s', the input path should be absolute", path);
+ PRINT("normalize_path - invalid input: \"%s\", the input path should be absolute", path);
return false;
}
@@ -89,7 +89,7 @@
}
const char* const path = normalized_path.c_str();
- TRACE("Trying zip file open from path '%s' -> normalized '%s'", input_path, path);
+ TRACE("Trying zip file open from path \"%s\" -> normalized \"%s\"", input_path, path);
// Treat an '!/' separator inside a path as the separator between the name
// of the zip file on disk and the subdirectory to search within it.