diff options
author | Dimitry Andric <dimitry@andric.com> | 2017-10-24 19:45:59 +0000 |
---|---|---|
committer | Dimitry Andric <dimitry@andric.com> | 2017-10-24 19:45:59 +0000 |
commit | f49c63699ef9867eb0127ee4a66dd5508870688d (patch) | |
tree | 0157bb6bc7af5522e1431fc62e0662f0d036a87b /lib/asan/asan_linux.cc | |
parent | e9b5a2559d63c029f8af63870ddd1892cfe019f3 (diff) |
On FreeBSD, skip the first entry in the dl_iterate_phdr list.
Summary:
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.
Reviewers: eugenis, krytarowski, emaste, joerg
Reviewed By: eugenis, krytarowski
Subscribers: kubamracek, llvm-commits
Differential Revision: https://reviews.llvm.org/D39253
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@316487 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/asan/asan_linux.cc')
-rw-r--r-- | lib/asan/asan_linux.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/asan/asan_linux.cc b/lib/asan/asan_linux.cc index 9ebfea254..a949a9888 100644 --- a/lib/asan/asan_linux.cc +++ b/lib/asan/asan_linux.cc @@ -105,7 +105,7 @@ static int FindFirstDSOCallback(struct dl_phdr_info *info, size_t size, 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)) { |