Page MenuHomeFreeBSD

D33934.diff
No OneTemporary

D33934.diff

diff --git a/contrib/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp b/contrib/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp
--- a/contrib/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp
+++ b/contrib/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp
@@ -46,7 +46,9 @@
#if SANITIZER_FREEBSD
#include <pthread_np.h>
+#include <stdlib.h>
#include <osreldate.h>
+#include <sys/auxv.h>
#include <sys/sysctl.h>
#define pthread_getattr_np pthread_attr_get_np
// The MAP_NORESERVE define has been removed in FreeBSD 11.x, and even before
@@ -865,7 +867,14 @@
void ReExec() {
const char *pathname = "/proc/self/exe";
-#if SANITIZER_NETBSD
+#if SANITIZER_FREEBSD
+ char exe_path[PATH_MAX];
+ if (elf_aux_info(AT_EXECPATH, exe_path, sizeof(exe_path)) == 0) {
+ char link_path[PATH_MAX];
+ if (realpath(exe_path, link_path))
+ pathname = link_path;
+ }
+#elif SANITIZER_NETBSD
static const int name[] = {
CTL_KERN,
KERN_PROC_ARGS,

File Metadata

Mime Type
text/plain
Expires
Fri, Nov 28, 8:52 PM (20 h, 2 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
26300716
Default Alt Text
D33934.diff (1 KB)

Event Timeline