Merge "Replace abort with exit(1) in __linker_cannot_link"

This commit is contained in:
Treehugger Robot 2017-09-29 19:53:17 +00:00 committed by Gerrit Code Review
commit 95f90784ea
2 changed files with 12 additions and 2 deletions

View file

@ -208,7 +208,17 @@ static char kLinkerPath[] = "/system/bin/linker";
#endif #endif
static void __linker_cannot_link(const char* argv0) { static void __linker_cannot_link(const char* argv0) {
async_safe_fatal("CANNOT LINK EXECUTABLE \"%s\": %s", argv0, linker_get_error_buffer()); async_safe_format_fd(STDERR_FILENO,
"CANNOT LINK EXECUTABLE \"%s\": %s\n",
argv0,
linker_get_error_buffer());
async_safe_format_log(ANDROID_LOG_FATAL,
"linker",
"CANNOT LINK EXECUTABLE \"%s\": %s",
argv0,
linker_get_error_buffer());
_exit(EXIT_FAILURE);
} }
/* /*

View file

@ -162,7 +162,7 @@ TEST(dl, exec_without_ld_config_file) {
chmod(helper.c_str(), 0755); chmod(helper.c_str(), 0755);
ExecTestHelper eth; ExecTestHelper eth;
eth.SetArgs({ helper.c_str(), nullptr }); eth.SetArgs({ helper.c_str(), nullptr });
eth.Run([&]() { execve(helper.c_str(), eth.GetArgs(), eth.GetEnv()); }, -6, error_message.c_str()); eth.Run([&]() { execve(helper.c_str(), eth.GetArgs(), eth.GetEnv()); }, EXIT_FAILURE, error_message.c_str());
#endif #endif
} }