linker: Fix executables shimming
This commit only makes this work with clang
* https://gist.github.com/luk1337/6e783d9d2e94c2e40c918db7b06aca68
Change-Id: I7d5afba45d3292d70e12371078394ed3dcf3a124
Signed-off-by: Simao Gomes Viana <xdevs23@outlook.com>
diff --git a/linker/linker.cpp b/linker/linker.cpp
index 5081f12..80345ba 100644
--- a/linker/linker.cpp
+++ b/linker/linker.cpp
@@ -1174,7 +1174,7 @@
char path[PATH_MAX];
ssize_t path_len = readlink("/proc/self/exe", path, sizeof(path));
if (path_len == -1 || path_len >= static_cast<ssize_t>(sizeof(path))) {
- __libc_fatal("readlink('/proc/self/exe') failed: %s", strerror(errno));
+ async_safe_fatal("readlink('/proc/self/exe') failed: %s", strerror(errno));
}
executable_path = std::string(path, path_len);
}