[PATCH] D39253: On FreeBSD, skip the first entry in the dl_iterate_phdr list.

Dimitry Andric via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 24 12:29:34 PDT 2017


dim created this revision.
Herald added a subscriber: kubamracek.

Similar to NetBSD, in FreeBSD, the first returned entry when callbacks
are done via dl_iterate_phdr will return the main program.  Ignore that
entry when checking that the dynamic ASan lib is loaded first.


https://reviews.llvm.org/D39253

Files:
  lib/asan/asan_linux.cc


Index: lib/asan/asan_linux.cc
===================================================================
--- lib/asan/asan_linux.cc
+++ lib/asan/asan_linux.cc
@@ -105,7 +105,7 @@
   if (internal_strncmp(info->dlpi_name, "linux-", sizeof("linux-") - 1) == 0)
     return 0;
 
-#if SANITIZER_NETBSD
+#if SANITIZER_FREEBSD || SANITIZER_NETBSD
   // Ignore first entry (the main program)
   char **p = (char **)data;
   if (!(*p)) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D39253.120117.patch
Type: text/x-patch
Size: 422 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171024/d9ecadb1/attachment.bin>


More information about the llvm-commits mailing list